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: <20150618095754.GI7557@n2100.arm.linux.org.uk>
Date:	Thu, 18 Jun 2015 10:57:54 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Andrzej Hajda <a.hajda@...sung.com>
Cc:	Tomeu Vizoso <tomeu.vizoso@...labora.com>,
	linux-arm-kernel@...ts.infradead.org,
	Alexander Holler <holler@...oftware.de>,
	Alexandre Courbot <gnurou@...il.com>,
	Arnd Bergmann <arnd@...db.de>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Kumar Gala <galak@...eaurora.org>, Len Brown <lenb@...nel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org, Lv Zheng <lv.zheng@...el.com>,
	Mark Brown <broonie@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Pawel Moll <pawel.moll@....com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Robert Moore <robert.moore@...el.com>,
	Rob Herring <robh+dt@...nel.org>,
	Stephen Warren <swarren@...dotorg.org>,
	Terje Bergström <tbergstrom@...dia.com>,
	Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH 00/13] Discover and probe dependencies

On Thu, Jun 18, 2015 at 11:42:01AM +0200, Andrzej Hajda wrote:
> 2. Provider create/register their resources only during probe.
>     It is not always the case - for example componentized drivers in
> probe often
>     calls only component_add, the real initialization is performed in
> bind callback.

bind is called in _a_ probe callback, but it may not be the probe callback
associated with the device.  (It'll be the final component's callback.)

I'm willing to be less critical of componentised drivers claiming their
resources in ->probe _iff_ they separate their data structures, like:

	struct foo_priv {
		void *base;
		struct clk *clk;
		struct dma_chan *chan;
		... other resource data ...;
		struct foo_runtime {
			... runtime data ...
		} rt;
	};

and then, in their bind callback, they memset the foo_runtime structure
to zero, to ensure that the driver always re-binds in the same state as
the first bind.

I've seen too many lax drivers over the years that this is a point I'm
very insistant on: either componentised drivers don't do any resource
claiming in their probe function, or they take steps to ensure non-
resource struct members are properly separated such that they can
guarantee that they aren't going to accidentally use something from a
previous binding.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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