android_kernel_xiaomi_sm8350/drivers/base
David Brownell 49a4ec188f fix hotplug for legacy platform drivers
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 <dbrownell@users.sourceforge.net>
Cc: Greg KH <gregkh@suse.de>
Cc: Andres Salomon <dilinger@debian.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:10 -07:00
..
power remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
attribute_container.c drivers/base/attribute_container.c: use mutex instead of binary semaphore 2007-04-27 10:57:34 -07:00
base.h remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
bus.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
class.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
core.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
cpu.c Replace remaining references to "driverfs" with "sysfs". 2007-02-17 19:13:42 +01:00
dd.c PCI: remove the broken PCI_MULTITHREAD_PROBE option 2007-05-02 19:02:38 -07:00
devres.c
dma-mapping.c
dmapool.c Driver core: use mutex instead of semaphore in DMA pool handler 2007-04-27 10:57:32 -07:00
driver.c Driver core: remove unneeded completion from driver release path 2007-04-27 10:57:29 -07:00
firmware_class.c Driver core: switch firmware_class to uevent_suppress. 2007-04-27 10:57:29 -07:00
firmware.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
hypervisor.c
init.c
isa.c
Kconfig
Makefile Introduce CONFIG_HAS_DMA 2007-05-07 12:12:51 -07:00
map.c
memory.c
node.c Replace remaining references to "driverfs" with "sysfs". 2007-02-17 19:13:42 +01:00
platform.c fix hotplug for legacy platform drivers 2007-05-08 11:15:10 -07:00
sys.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
topology.c
transport_class.c