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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C8A02E6.4080906@nokia.com>
Date:	Fri, 10 Sep 2010 13:05:26 +0300
From:	Adrian Hunter <adrian.hunter@...ia.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Walleij <linus.walleij@...ricsson.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Tony Lindgren <tony@...mide.com>,
	Robert Jarzmik <robert.jarzmik@...e.fr>,
	Sundar Iyer <sundar.iyer@...ricsson.com>,
	Daniel Mack <daniel@...aq.de>,
	Pierre Ossman <pierre@...man.eu>,
	Matt Fleming <matt@...sole-pimps.org>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Eric Miao <eric.y.miao@...il.com>,
	Cliff Brake <cbrake@...-systems.com>,
	"Lavinen Jarkko (Nokia-MS/Helsinki)" <jarkko.lavinen@...ia.com>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] MMC: move regulator handling closer to core v3

Mark Brown wrote:
> On Thu, Sep 09, 2010 at 03:56:31PM +0300, Adrian Hunter wrote:
>> Mark Brown wrote:
> 
>>> What do you mean when you say that you would like boards to "hook
>>> directly into the regulator" - what do you want to be able to do?
>>> Is this the notifiers?  Do you need more of them?
> 
>> There would need to be notifiers before and after any change to the
>> voltage.  However the notifiers would have to be set up before or
>> during regulator initialisation because initialisation already can
>> change the voltage e.g. in set_machine_constraints.
> 
> Why do you believe these notifiers are needed?

As I mentioned below, they would be needed to do PBIAS configuration
automatically using notifiers (notifiers would have been overkill
anyway).  However as you don't think that is a good idea, it is no
matter.

>                                                 I would expect that
> anything that needs pre and post change notifications like this is
> actually changing the configuration itself (since if it's that sensitive
> to changes it seems likely that it wouldn't be enthused about having the
> configuration changed while it's trying to do stuff).

Yes, except when it is the regulator core trying to set the initial power
state on or off.

> 
>>> I can't parse this at all I'm afraid.  Could you be more specific about
>>> what you mean by using enable and disable independantly of the board -
>>> clearly the consumer drivers are already able to be board independant?
> 
>> For OMAP3 (and OMAP2 in some cases) the 1st SD/SDIO/MMC controller
>> can operate at either 1.8V or 3V, however at 3V the board must apply
>> voltage level shifting (PBIAS configuation).  Currently the
>> level-shifting is done by board code that must be called before and
>> after the voltage changes.  The omap_hsmmc driver calls the board
>> code via callbacks in platform data (.before_set_reg and
>> .after_set_reg).
> 
> This really sounds like something that's internal to the MMC controller
> driver - based on your description I'm very surprised that boards even
> get visibility of this.  Surely the MMC controller driver should be
> taking care of configuring PBIAS itself, assuming it's something
> internal to the chip?

It is considered that the driver should know only about hsmmc ip not
all of OMAP.  Additionally the OMAP community does not allow the use
of the necessary system control registers outside of the board level
i.e. arch/arm/mach-omap2 etc.  Hence the driver calls down to the
board level.  That is ugly but not a problem.

>                        Adding code to the regulator API so that the OMAP
> MMC driver can be notified of the configuration it has applied to itself
> (and any failures that ensue) feels baroque.

As you wish.  That rules out using the core to turn off the regulator at
boot up, but that is OK, the driver can do it.  At present the driver
makes the mistake of just doing regulator_enable() / disable() to ensure the
regulator is off, without calling down to the board level for the PBIAS
configuration.  It also comments the code as an "ugly hack" whereas
it is really the only way to do it, if the regulator can't do the
PBIAS configuration automatically.  I will just fix the driver and add
better comments.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ