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]
Date:	Sun, 30 Aug 2009 11:34:49 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Linus Walleij <linus.ml.walleij@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	Linus Walleij <linus.walleij@...ricsson.com>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Russell King <linux@....linux.org.uk>,
	linux-arm-kernel@...ts.arm.linux.org.uk,
	Alan Stern <stern@...land.harvard.edu>
Subject: Re: [PATCH] AB3100 regulator support v1

On Sun, Aug 30, 2009 at 01:03:38AM +0200, Linus Walleij wrote:

[While setting up a child platform device from a platform driver
probe...]

> >> +     /* This would seem logical but makes everything break... */
> >> +     /* pdev->dev.parent = parent; */

> > Err...  it does?  In what way?

> The sub-platform devices are added, but when I add a platform driver for
> them, the probing does not commence, because they hang in
> driver base/dd.c: __driver_attach() trying to take the parent semaphore,
> i.e. this line:

> 	if (dev->parent)	/* Needed for USB */
> 		down(&dev->parent->sem);

> In this case the parent is ab3100-regulators, the platform device for
> the set of regulators.

On the face of it (and without having actually looked at a running
system or anything yet) I'm rather surprised that platform based MFD
drivers aren't running into this issue more often.  CCing in Alan who
made the change.

However, fixing this is not required to avoid the issue for this
particular driver.  The problem is being caused because in addition to
the core MFD driver for the device you've chosen to create both a
platform device covering all regulators and further per-regulator child
platform devices.  If you create only one level of child device for the
MFD you'll avoid the issue because your core device is an I2C device.
Either have a device per regulator or have a single device which
registers multiple regulators.  The regulator API doesn't mind what you
do so long as it gets a parent for the class device so do whatever seems
sensible for your driver.
--
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