<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/platform.c, branch v2.6.23</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.23</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.23'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-05-09T06:58:16Z</updated>
<entry>
<title>drivers/base/platform.c: fix small typo in doc</title>
<updated>2007-05-09T06:58:16Z</updated>
<author>
<name>Márton Németh</name>
<email>nm127@freemail.hu</email>
</author>
<published>2007-05-09T05:48:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=01afd80626e98c2347bc25be92ee4a3faf314514'/>
<id>urn:sha1:01afd80626e98c2347bc25be92ee4a3faf314514</id>
<content type='text'>
Typo: iwithout -&gt; without.

Signed-off-by: Márton Németh &lt;nm127@freemail.hu&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>fix hotplug for legacy platform drivers</title>
<updated>2007-05-08T18:15:10Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2007-05-08T07:29:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49a4ec188f9a96c9a5567956718213d38a456a19'/>
<id>urn:sha1:49a4ec188f9a96c9a5567956718213d38a456a19</id>
<content type='text'>
We've had various reports of some legacy "probe the hardware" style
platform drivers having nasty problems with hotplug support.

The core issue is that those legacy drivers don't fully conform to the
driver model.  They assume a role that should be the responsibility of
infrastructure code: creating device nodes.

The "modprobe" step in hotplugging relies on drivers to have split those
roles into different modules.  The lack of this split causes the problems.
When a driver creates nodes for devices that don't exist (sending a hotplug
event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
step completes (by failing, since it's in the middle of a modprobe), the
result can be an endless loop of modprobe invocations ...  badness.

This fix uses the newish per-device flag controlling issuance of "add"
events.  (A previous version of this patch used a per-device "driver can
hotplug" flag, which only scrubbed $MODALIAS from the environment rather
than suppressing the entire hotplug event.) It also shrinks that flag to
one bit, saving a word in "struct device".

So the net of this patch is removing some nasty failures with legacy
drivers, while retaining hotplug capability for the majority of platform
drivers.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Greg KH &lt;gregkh@suse.de&gt;
Cc: Andres Salomon &lt;dilinger@debian.org&gt;
Cc: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>platform: reorder platform_device_del</title>
<updated>2007-05-03T01:57:59Z</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2007-05-02T18:55:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc4c15d44b2b43279b2667baa7645c65c2ff960e'/>
<id>urn:sha1:dc4c15d44b2b43279b2667baa7645c65c2ff960e</id>
<content type='text'>
In platform_device_del(), we currently delete the device resources
first, then we delete the device itself. This causes a (minor) bug to
occur when one unregisters a platform device before unregistering its
platform driver, and the driver is requesting (in .probe()) and
releasing (in .remove()) a resource of the device. The device
resources are already gone by the time the driver gets the chance to
release the resources it had been requesting, causing an error like:
Trying to free nonexistent resource &lt;0000000000000295-0000000000000296&gt;

If the platform driver is unregistered first, the problem doesn't
occur, as the driver will have the opportunity to release the
resources it had requested before the device resources themselves are
released. It's a bit odd that unregistering the driver first or the
device first doesn't lead to the same result.

So I believe that we should delete the device first in
platform_device_del(). I've searched the git history and found that it
used to be the case before 2.6.8, but was changed here:

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c

&gt; 2004/07/14 16:09:44-07:00 dtor_core
&gt; [PATCH] Driver core: Fix OOPS in device_platform_unregister
&gt; 
&gt; Driver core: platform_device_unregister should release resources first
&gt;              and only then call device_unregister, otherwise if there
&gt;              are no more references to the device it will be freed and
&gt;              the fucntion will try to access freed memory.  

However we now have an explicit call to put_device() at the end of
platform_device_unregister() so I guess the original problem no longer
exists and it is safe to revert that change.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core fixes: device_register() retval check in platform.c</title>
<updated>2007-02-07T18:37:12Z</updated>
<author>
<name>Cornelia Huck</name>
<email>cornelia.huck@de.ibm.com</email>
</author>
<published>2006-11-27T09:35:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fbfb14455391b89edcf37327526988dea7849532'/>
<id>urn:sha1:fbfb14455391b89edcf37327526988dea7849532</id>
<content type='text'>
Check the return value of device_register() in platform_bus_init().

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: Make platform_device_add_data accept a const pointer</title>
<updated>2006-12-13T23:38:46Z</updated>
<author>
<name>Scott Wood</name>
<email>scottwood@freescale.com</email>
</author>
<published>2006-12-04T22:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6eefd34fdcbd34e2cddb8b7da26d838367591954'/>
<id>urn:sha1:6eefd34fdcbd34e2cddb8b7da26d838367591954</id>
<content type='text'>
platform_device_add_data() makes a copy of the data that is given to it,
and thus the parameter can be const.  This removes a warning when data
from get_property() on powerpc is handed to platform_device_add_data(),
as get_property() returns a const pointer.

Signed-off-by: Scott Wood &lt;scottwood@freescale.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: "platform_driver_probe() can save codespace": save codespace</title>
<updated>2006-12-13T23:38:45Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-12-04T22:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c63e07834bb12910bea41da15b8902150f5217c2'/>
<id>urn:sha1:c63e07834bb12910bea41da15b8902150f5217c2</id>
<content type='text'>
This function can be __init

Cc: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Dmitry Torokhov &lt;dtor@mail.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>Driver core: platform_driver_probe(), can save codespace</title>
<updated>2006-12-01T22:52:02Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2006-11-17T07:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c67334fbdfbba533af767610cf3fde8a49710e62'/>
<id>urn:sha1:c67334fbdfbba533af767610cf3fde8a49710e62</id>
<content type='text'>
This defines a new platform_driver_probe() method allowing the driver's
probe() method, and its support code+data, to safely live in __init
sections for typical system configurations.

Many system-on-chip processors could benefit from this API, to the tune
of recovering hundreds to thousands of bytes per driver.  That's memory
which is currently wasted holding code which can never be called after
system startup, yet can not be removed.   It can't be removed because of
the linkage requirement that pointers to init section code (like, ideally,
probe support) must not live in other sections (like driver method tables)
after those pointers would be invalid.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>PM: platform_bus and late_suspend/early_resume</title>
<updated>2006-09-26T04:08:38Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2006-09-03T20:16:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=386415d88b1ae50304f9c61aa3e0db082fa90428'/>
<id>urn:sha1:386415d88b1ae50304f9c61aa3e0db082fa90428</id>
<content type='text'>
Teach platform_bus about the new suspend_late/resume_early PM calls,
issued with IRQs off.  Do we really need sysdev and friends any more,
or can janitors start switching its users over to platform_device so
we can do a minor code-ectomy?

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>[PATCH] Driver Core: Fix platform_device_add to use device_add</title>
<updated>2006-06-21T19:40:48Z</updated>
<author>
<name>Russell King</name>
<email>rmk+lkml@arm.linux.org.uk</email>
</author>
<published>2006-05-06T07:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e391553222211e07dfbe2f01c413b4e6d0ae32aa'/>
<id>urn:sha1:e391553222211e07dfbe2f01c413b4e6d0ae32aa</id>
<content type='text'>
platform_device_add() should be using device_add() rather
than device_register() - any platform device passed to
platform_device_add() should have already been initialised,
either by platform_device_alloc() or platform_device_register().

Signed-off-by: Russell King &lt;rmk@arm.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] platform_bus learns about modalias</title>
<updated>2006-06-21T19:40:48Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2006-05-29T17:37:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0245f7ad5214cb00131d7cd176446e067c913dc'/>
<id>urn:sha1:a0245f7ad5214cb00131d7cd176446e067c913dc</id>
<content type='text'>
This patch adds modalias support to platform devices, for simpler
hotplug/coldplug driven driver setup.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
