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] [day] [month] [year] [list]
Date:	Tue, 20 Dec 2011 16:58:51 +1100
From:	NeilBrown <neilb@...e.de>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	MyungJoo Ham <myungjoo.ham@...sung.com>,
	linux-kernel@...r.kernel.org, Randy Dunlap <rdunlap@...otime.net>,
	Mike Lockwood <lockwood@...roid.com>,
	Arve Hjønnevåg <arve@...roid.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Donggeun Kim <dg77.kim@...sung.com>, Greg KH <gregkh@...e.de>,
	Arnd Bergmann <arnd@...db.de>,
	MyungJoo Ham <myungjoo.ham@...il.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Morten CHRISTIANSEN <morten.christiansen@...ricsson.com>
Subject: Re: [PATCH v2 0/3] introduce External Connector Class (extcon)

On Tue, 20 Dec 2011 01:01:09 +0000 Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:

> On Sun, Dec 18, 2011 at 06:15:50PM +1100, NeilBrown wrote:
> > On Thu, 15 Dec 2011 14:51:55 +0800 Mark Brown
> 
> > > Grant has a proposal for this which revolves around devices trying to
> > > acquire their resources and returning a "please retry" error code if
> > > they don't have all their dependencies.  Half the problem here is that
> 
> > A possibility I have been thinking about is to multithread do_initcalls() and
> > have the various request functions (gpio_request, regulator_get, request_irq,
> > etc) optionally block if the resource isn't available.
> 
> That seems to be logically the same in terms of what it actually does
> but introduces concurrency which wasn't there before which means that
> things could get reordered for random reasons.  That seems like it'd not
> be great for robustness.

Logically similar..

One important difference is that (if I understand it correctly), the "please
retry" error need to be propagated up a lot further than it currently is so
that would be quite intrusive.

While my approach does introduce concurrency which wasn't there before, any
driver that can be built as a module must allow for concurrency in the init
function so I suspect (or hope) people normally make that code thread-safe.

I have some code that almost works (will post when it does work).  The only
real issue I have found (apart from personal incompetence) is that we really
need to know up-front what resources are going to be available so we know
whether to wait or to fail (waiting until 'everything is finished' won't work
as there could be several things still waiting at the end and we don't know if
one is waiting for another, of if they are waiting for things that won't
appear).

I imagine that ultimately we can depend on a device-tree file to list every
resource (gpio, irq, regulator) that is relevant here and can write the code
to wait-or-fail accordingly.

> 
> > Do we need to talk about devices that haven't been enumerated yet? or was
> > that just if we wanted to create an explicit dependency graph?
> 
> You need to know about devices that aren't enumerated yet.

I'm still not quite sure what you mean.  In my (limited) experience you need
to know about resources, not devices, and they have names.
And there is some precedent in regulator supply lists for naming devices
before they are enumerated.  So I'm not seeing the problem that you are
seeing.

Thanks,
NeilBrown


Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ