lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120208083141.GM3852@pengutronix.de>
Date:	Wed, 8 Feb 2012 09:31:41 +0100
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Fabio Estevam <festevam@...il.com>, robert.marklund@...ricsson.com,
	netdev@...r.kernel.org, Sascha Hauer <kernel@...gutronix.de>
Subject: Re: Regulator support for smsc911x

On Tue, Feb 07, 2012 at 07:39:14PM +0000, Mark Brown wrote:
> On Tue, Feb 07, 2012 at 05:25:48PM -0200, Fabio Estevam wrote:
> > On Fri, Feb 3, 2012 at 9:11 AM, Mark Brown
> 
> > > There's also options c) set up the regulators for the board and d) don't
> > > enable the regulator API if the board doesn't use regulators.
> 
> > Option c would require that we change every single board.
> 
> Well, yes.
> 
> > The patch below does option d.
> 
> > What do you think?
> 
> Absolutely not.  Putting conditional code like this in drivers is nuts,
> you would have to do the same thing in every single driver which is not
> a useful use of anyone's time.  This is *clearly* a generic thing and
> should therefore be handled in generic code for the same reason we don't
> have driver specific platform data for actual usage of the API.
> 
> Really, anyone who wants this sort of thing should just enable dummy
> regulators - it's exactly what you're implementing.  I'm pretty sure
> your board does actually have power supplies for the chip, you've just
> not told software about them.

Yes, my board also has a supply for the smc911x, it's the same as used
for the CPU...

There is also option e), something I've been thinking about for a while.
Implement a list of resources which can be attached to a device. By
resources I mean regulators, clocks and pinmux for example. A device
would then just call a make_me_work(state) function which iterates over
this list and enables/disables all resources as necessary. This way we
could attach everything we need to a device without cluttering the
driver code like we do today.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ