2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
Driver core: add notification of bus events
I finally did as you suggested and added the notifier to the struct
bus_type itself. There are still problems to be expected is something
attaches to a bus type where the code can hook in different struct
device sub-classes (which is imho a big bogosity but I won't even try to
argue that case now) but it will solve nicely a number of issues I've
had so far.
That also means that clients interested in registering for such
notifications have to do it before devices are added and after bus types
are registered. Fortunately, most bus types that matter for the various
usage scenarios I have in mind are registerd at postcore_initcall time,
which means I have a really nice spot at arch_initcall time to add my
notifiers.
There are 4 notifications provided. Device being added (before hooked to
the bus) and removed (failure of previous case or after being unhooked
from the bus), along with driver being bound to a device and about to be
unbound.
The usage I have for these are:
- The 2 first ones are used to maintain a struct device_ext that is
hooked to struct device.firmware_data. This structure contains for now a
pointer to the Open Firmware node related to the device (if any), the
NUMA node ID (for quick access to it) and the DMA operations pointers &
iommu table instance for DMA to/from this device. For bus types I own
(like IBM VIO or EBUS), I just maintain that structure directly from the
bus code when creating the devices. But for bus types managed by generic
code like PCI or platform (actually, of_platform which is a variation of
platform linked to Open Firmware device-tree), I need this notifier.
- The other two ones have a completely different usage scenario. I have
cases where multiple devices and their drivers depend on each other. For
example, the IBM EMAC network driver needs to attach to a MAL DMA engine
which is a separate device, and a PHY interface which is also a separate
device. They are all of_platform_device's (well, about to be with my
upcoming patches) but there is no say in what precise order the core
will "probe" them and instanciate the various modules. The solution I
found for that is to have the drivers for emac to use multithread_probe,
and wait for a driver to be bound to the target MAL and PHY control
devices (the device-tree contains reference to the MAL and PHY interface
nodes, which I can then match to of_platform_devices). Right now, I've
been polling, but with that notifier, I can more cleanly wait (with a
timeout of course).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-25 13:44:59 +10:00
|
|
|
|
2012-02-01 11:22:22 -07:00
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-03-04 15:09:07 -08:00
|
|
|
|
2008-05-28 09:28:39 -07:00
|
|
|
|
PM / driver core: disable device's runtime PM during shutdown
There may be an issue when the user issue "reboot/shutdown" command, then
the device has shut down its hardware, after that, this runtime-pm featured
device's driver will probably be scheduled to do its suspend routine,
and at its suspend routine, it may access hardware, but the device has
already shutdown physically, then the system hang may be occurred.
I ran out this issue using an auto-suspend supported USB devices, like
3G modem, keyboard. The usb runtime suspend routine may be scheduled
after the usb controller has been shut down, and the usb runtime suspend
routine will try to suspend its roothub(controller), it will access
register, then the system hang occurs as the controller is shutdown.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: stable@kernel.org
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-11-15 21:52:29 +01:00
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
2013-08-27 10:24:15 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-17 20:42:24 +08:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
2013-07-26 13:10:22 +09:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
driver core / ACPI: Avoid device hot remove locking issues
device_hotplug_lock is held around the acpi_bus_trim() call in
acpi_scan_hot_remove() which generally removes devices (it removes
ACPI device objects at least, but it may also remove "physical"
device objects through .detach() callbacks of ACPI scan handlers).
Thus, potentially, device sysfs attributes are removed under that
lock and to remove those attributes it is necessary to hold the
s_active references of their directory entries for writing.
On the other hand, the execution of a .show() or .store() callback
from a sysfs attribute is carried out with that attribute's s_active
reference held for reading. Consequently, if any device sysfs
attribute that may be removed from within acpi_scan_hot_remove()
through acpi_bus_trim() has a .store() or .show() callback which
acquires device_hotplug_lock, the execution of that callback may
deadlock with the removal of the attribute. [Unfortunately, the
"online" device attribute of CPUs and memory blocks is one of them.]
To avoid such deadlocks, make all of the sysfs attribute callbacks
that need to lock device hotplug, for example store_online(), use
a special function, lock_device_hotplug_sysfs(), to lock device
hotplug and return the result of that function immediately if it is
not zero. This will cause the s_active reference of the directory
entry in question to be released and the syscall to be restarted
if device_hotplug_lock cannot be acquired.
[show_online() actually doesn't need to lock device hotplug, but
it is useful to serialize it with respect to device_offline() and
device_online() for the same device (in case user space attempts to
run them concurrently) which can be done with the help of
device_lock().]
Reported-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reported-and-tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-28 21:41:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-27 12:12:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-06-16 17:10:48 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-20 21:08:45 +08:00
|
|
|
|
2006-06-16 17:10:48 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-30 12:29:21 -07:00
|
|
|
|
2006-06-16 17:10:48 -04:00
|
|
|
|
2009-12-04 11:06:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-09 16:33:10 +01:00
|
|
|
|
|
|
|
|
|
2006-06-16 17:10:48 -04:00
|
|
|
|
2006-09-23 23:35:04 -06:00
|
|
|
|
2006-06-16 17:10:48 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-29 01:23:47 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-05-17 06:39:34 -04:00
|
|
|
|
2008-03-04 15:09:07 -08:00
|
|
|
|
2013-01-17 13:10:23 -08:00
|
|
|
|
|
|
|
|
|
2008-03-04 15:09:07 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-29 01:23:47 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-05-17 06:39:34 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-19 02:58:23 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-10-09 19:52:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-06-01 20:17:34 -04:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-06-01 20:17:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2008-12-16 12:23:36 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-25 01:42:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
|
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
2008-07-25 19:45:39 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2008-12-16 12:23:36 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
|
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-11 10:47:49 -06:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-11 10:47:49 -06:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
2011-07-23 20:24:48 -04:00
|
|
|
|
2013-04-11 11:43:29 -07:00
|
|
|
|
|
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
|
|
|
|
|
2013-04-06 09:56:00 -07:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
|
|
|
|
|
2013-04-11 11:43:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-06 09:56:00 -07:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
2007-03-12 21:08:57 +01:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2007-03-12 21:08:57 +01:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2012-02-01 11:22:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-11-28 23:49:41 -08:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-11-28 23:49:41 -08:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2008-03-04 16:41:05 -08:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
|
|
|
|
|
2010-08-06 21:11:15 +02:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-11-28 23:49:41 -08:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2008-03-04 16:41:05 -08:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-31 14:52:51 +01:00
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-12 20:43:55 +02:00
|
|
|
|
|
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
2007-08-12 20:43:55 +02:00
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
|
|
|
|
|
2007-05-02 14:14:11 +02:00
|
|
|
|
|
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
|
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
2007-08-14 15:15:12 +02:00
|
|
|
|
2007-04-06 01:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2005-10-01 14:49:43 +02:00
|
|
|
|
|
|
|
|
|
2007-07-08 22:29:26 +02:00
|
|
|
|
|
|
|
|
|
2010-01-14 22:54:37 +01:00
|
|
|
|
2007-07-08 22:29:26 +02:00
|
|
|
|
2010-01-14 22:54:37 +01:00
|
|
|
|
|
|
|
|
|
2005-10-01 14:49:43 +02:00
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2005-10-01 14:49:43 +02:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
driver core / ACPI: Avoid device hot remove locking issues
device_hotplug_lock is held around the acpi_bus_trim() call in
acpi_scan_hot_remove() which generally removes devices (it removes
ACPI device objects at least, but it may also remove "physical"
device objects through .detach() callbacks of ACPI scan handlers).
Thus, potentially, device sysfs attributes are removed under that
lock and to remove those attributes it is necessary to hold the
s_active references of their directory entries for writing.
On the other hand, the execution of a .show() or .store() callback
from a sysfs attribute is carried out with that attribute's s_active
reference held for reading. Consequently, if any device sysfs
attribute that may be removed from within acpi_scan_hot_remove()
through acpi_bus_trim() has a .store() or .show() callback which
acquires device_hotplug_lock, the execution of that callback may
deadlock with the removal of the attribute. [Unfortunately, the
"online" device attribute of CPUs and memory blocks is one of them.]
To avoid such deadlocks, make all of the sysfs attribute callbacks
that need to lock device hotplug, for example store_online(), use
a special function, lock_device_hotplug_sysfs(), to lock device
hotplug and return the result of that function immediately if it is
not zero. This will cause the s_active reference of the directory
entry in question to be released and the syscall to be restarted
if device_hotplug_lock cannot be acquired.
[show_online() actually doesn't need to lock device hotplug, but
it is useful to serialize it with respect to device_offline() and
device_online() for the same device (in case user space attempts to
run them concurrently) which can be done with the help of
device_lock().]
Reported-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reported-and-tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-28 21:41:01 +02:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
driver core / ACPI: Avoid device hot remove locking issues
device_hotplug_lock is held around the acpi_bus_trim() call in
acpi_scan_hot_remove() which generally removes devices (it removes
ACPI device objects at least, but it may also remove "physical"
device objects through .detach() callbacks of ACPI scan handlers).
Thus, potentially, device sysfs attributes are removed under that
lock and to remove those attributes it is necessary to hold the
s_active references of their directory entries for writing.
On the other hand, the execution of a .show() or .store() callback
from a sysfs attribute is carried out with that attribute's s_active
reference held for reading. Consequently, if any device sysfs
attribute that may be removed from within acpi_scan_hot_remove()
through acpi_bus_trim() has a .store() or .show() callback which
acquires device_hotplug_lock, the execution of that callback may
deadlock with the removal of the attribute. [Unfortunately, the
"online" device attribute of CPUs and memory blocks is one of them.]
To avoid such deadlocks, make all of the sysfs attribute callbacks
that need to lock device hotplug, for example store_online(), use
a special function, lock_device_hotplug_sysfs(), to lock device
hotplug and return the result of that function immediately if it is
not zero. This will cause the s_active reference of the directory
entry in question to be released and the syscall to be restarted
if device_hotplug_lock cannot be acquired.
[show_online() actually doesn't need to lock device hotplug, but
it is useful to serialize it with respect to device_offline() and
device_online() for the same device (in case user space attempts to
run them concurrently) which can be done with the help of
device_lock().]
Reported-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reported-and-tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-28 21:41:01 +02:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
driver core / ACPI: Avoid device hot remove locking issues
device_hotplug_lock is held around the acpi_bus_trim() call in
acpi_scan_hot_remove() which generally removes devices (it removes
ACPI device objects at least, but it may also remove "physical"
device objects through .detach() callbacks of ACPI scan handlers).
Thus, potentially, device sysfs attributes are removed under that
lock and to remove those attributes it is necessary to hold the
s_active references of their directory entries for writing.
On the other hand, the execution of a .show() or .store() callback
from a sysfs attribute is carried out with that attribute's s_active
reference held for reading. Consequently, if any device sysfs
attribute that may be removed from within acpi_scan_hot_remove()
through acpi_bus_trim() has a .store() or .show() callback which
acquires device_hotplug_lock, the execution of that callback may
deadlock with the removal of the attribute. [Unfortunately, the
"online" device attribute of CPUs and memory blocks is one of them.]
To avoid such deadlocks, make all of the sysfs attribute callbacks
that need to lock device hotplug, for example store_online(), use
a special function, lock_device_hotplug_sysfs(), to lock device
hotplug and return the result of that function immediately if it is
not zero. This will cause the s_active reference of the directory
entry in question to be released and the syscall to be restarted
if device_hotplug_lock cannot be acquired.
[show_online() actually doesn't need to lock device hotplug, but
it is useful to serialize it with respect to device_offline() and
device_online() for the same device (in case user space attempts to
run them concurrently) which can be done with the help of
device_lock().]
Reported-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reported-and-tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-28 21:41:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
2013-08-08 15:22:55 -07:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2013-08-21 13:47:50 -07:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
2013-08-08 15:22:55 -07:00
|
|
|
|
|
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2013-08-21 13:47:50 -07:00
|
|
|
|
2006-06-27 00:06:09 -07:00
|
|
|
|
|
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-28 09:12:52 -07:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2013-07-14 16:05:58 -07:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2013-10-05 18:19:30 -07:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
|
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
2013-12-12 06:11:02 +01:00
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
2013-12-12 06:11:02 +01:00
|
|
|
|
|
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-14 16:05:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-28 09:12:52 -07:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
2006-10-07 21:54:55 +02:00
|
|
|
|
2007-03-10 01:37:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-05 18:19:30 -07:00
|
|
|
|
2013-07-14 16:05:58 -07:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2007-06-14 03:45:17 +09:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2007-11-01 09:29:06 -06:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-12-18 15:34:19 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-02-20 10:31:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 14:31:30 +08:00
|
|
|
|
|
|
|
|
|
2013-02-20 10:31:42 +02:00
|
|
|
|
2013-05-16 14:31:30 +08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-02-20 10:31:42 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-12-18 15:34:19 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-31 10:39:38 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
kernfs, sysfs, driver-core: implement kernfs_remove_self() and its wrappers
Sometimes it's necessary to implement a node which wants to delete
nodes including itself. This isn't straightforward because of kernfs
active reference. While a file operation is in progress, an active
reference is held and kernfs_remove() waits for all such references to
drain before completing. For a self-deleting node, this is a deadlock
as kernfs_remove() ends up waiting for an active reference that itself
is sitting on top of.
This currently is worked around in the sysfs layer using
sysfs_schedule_callback() which makes such removals asynchronous.
While it works, it's rather cumbersome and inherently breaks
synchronicity of the operation - the file operation which triggered
the operation may complete before the removal is finished (or even
started) and the removal may fail asynchronously. If a removal
operation is immmediately followed by another operation which expects
the specific name to be available (e.g. removal followed by rename
onto the same name), there's no way to make the latter operation
reliable.
The thing is there's no inherent reason for this to be asynchrnous.
All that's necessary to do this synchronous is a dedicated operation
which drops its own active ref and deactivates self. This patch
implements kernfs_remove_self() and its wrappers in sysfs and driver
core. kernfs_remove_self() is to be called from one of the file
operations, drops the active ref the task is holding, removes the self
node, and restores active ref to the dead node so that the ref is
balanced afterwards. __kernfs_remove() is updated so that it takes an
early exit if the target node is already fully removed so that the
active ref restored by kernfs_remove_self() after removal doesn't
confuse the deactivation path.
This makes implementing self-deleting nodes very easy. The normal
removal path doesn't even need to be changed to use
kernfs_remove_self() for the self-deleting node. The method can
invoke kernfs_remove_self() on itself before proceeding the normal
removal path. kernfs_remove() invoked on the node by the normal
deletion path will simply be ignored.
This will replace sysfs_schedule_callback(). A subtle feature of
sysfs_schedule_callback() is that it collapses multiple invocations -
even if multiple removals are triggered, the removal callback is run
only once. An equivalent effect can be achieved by testing the return
value of kernfs_remove_self() - only the one which gets %true return
value should proceed with actual deletion. All other instances of
kernfs_remove_self() will wait till the enclosing kernfs operation
which invoked the winning instance of kernfs_remove_self() finishes
and then return %false. This trivially makes all users of
kernfs_remove_self() automatically show correct synchronous behavior
even when there are multiple concurrent operations - all "echo 1 >
delete" instances will finish only after the whole operation is
completed by one of the instances.
Note that manipulation of active ref is implemented in separate public
functions - kernfs_[un]break_active_protection().
kernfs_remove_self() is the only user at the moment but this will be
used to cater to more complex cases.
v2: For !CONFIG_SYSFS, dummy version kernfs_remove_self() was missing
and sysfs_remove_file_self() had incorrect return type. Fix it.
Reported by kbuild test bot.
v3: kernfs_[un]break_active_protection() separated out from
kernfs_remove_self() and exposed as public API.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-03 14:03:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-19 09:39:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-18 15:34:20 +02:00
|
|
|
|
|
|
|
|
|
2006-09-19 09:39:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-18 15:34:20 +02:00
|
|
|
|
|
|
|
|
|
2006-09-19 09:39:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-06 16:56:51 -07:00
|
|
|
|
|
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
|
|
|
|
|
2005-09-06 16:56:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
|
|
|
|
|
2005-09-06 16:56:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-17 11:39:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-01 09:29:06 -06:00
|
|
|
|
2007-12-17 23:05:35 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-01-29 20:39:02 +00:00
|
|
|
|
2010-03-19 01:37:42 +01:00
|
|
|
|
devres: device resource management
Implement device resource management, in short, devres. A device
driver can allocate arbirary size of devres data which is associated
with a release function. On driver detach, release function is
invoked on the devres data, then, devres data is freed.
devreses are typed by associated release functions. Some devreses are
better represented by single instance of the type while others need
multiple instances sharing the same release function. Both usages are
supported.
devreses can be grouped using devres group such that a device driver
can easily release acquired resources halfway through initialization
or selectively release resources (e.g. resources for port 1 out of 4
ports).
This patch adds devres core including documentation and the following
managed interfaces.
* alloc/free : devm_kzalloc(), devm_kzfree()
* IO region : devm_request_region(), devm_release_region()
* IRQ : devm_request_irq(), devm_free_irq()
* DMA : dmam_alloc_coherent(), dmam_free_coherent(),
dmam_declare_coherent_memory(), dmam_pool_create(),
dmam_pool_destroy()
* PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
* iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
pcim_iomap(), pcim_iounmap()
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-01-20 16:00:26 +09:00
|
|
|
|
|
|
|
|
|
2008-08-07 13:06:12 -04:00
|
|
|
|
2006-12-06 20:32:33 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-03-12 11:30:05 -07:00
|
|
|
|
2006-10-23 10:40:54 -07:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2006-10-23 10:40:54 -07:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2007-11-05 22:24:43 -08:00
|
|
|
|
2007-11-01 09:29:06 -06:00
|
|
|
|
2006-10-23 10:40:54 -07:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2006-10-23 10:40:54 -07:00
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
|
|
|
|
|
2006-10-24 00:37:58 +01:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2010-02-05 17:57:02 +09:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
|
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
2007-12-19 01:40:42 +01:00
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 22:43:35 -07:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-05 17:57:02 +09:00
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2010-02-05 17:57:02 +09:00
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2010-02-05 17:57:02 +09:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:25 -07:00
|
|
|
|
2007-12-19 01:40:42 +01:00
|
|
|
|
2010-02-05 17:57:02 +09:00
|
|
|
|
2007-11-05 22:24:43 -08:00
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
|
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2007-01-08 20:16:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-01-21 16:09:44 +01:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2007-12-19 01:40:42 +01:00
|
|
|
|
2008-02-27 15:38:23 +01:00
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
|
|
|
|
|
2007-12-19 01:40:42 +01:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-01-21 16:09:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-14 03:25:56 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-05-28 09:28:39 -07:00
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-01-27 12:12:43 -08:00
|
|
|
|
2007-09-18 22:46:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
|
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2008-01-27 12:12:43 -08:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-09-08 16:54:17 +02:00
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2010-09-24 14:36:49 -07:00
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
2008-05-30 10:16:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-06-04 21:40:43 -07:00
|
|
|
|
2008-05-30 10:16:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
2008-05-30 10:16:40 +10:00
|
|
|
|
|
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
2008-05-30 10:16:40 +10:00
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
2008-05-30 10:16:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-17 12:12:57 +02:00
|
|
|
|
|
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-11 14:16:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-08 12:17:22 -08:00
|
|
|
|
2009-05-11 14:16:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
2012-01-17 11:39:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
2008-05-30 10:45:12 -07:00
|
|
|
|
2008-01-12 20:40:46 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-05-30 10:45:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:23:36 -08:00
|
|
|
|
2009-05-11 14:16:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:23:36 -08:00
|
|
|
|
|
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 15:39:55 -07:00
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
|
|
|
|
|
2008-05-30 10:45:12 -07:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 19:32:49 +00:00
|
|
|
|
|
|
|
|
|
2009-05-28 14:24:07 -07:00
|
|
|
|
2009-12-10 19:32:49 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2006-08-07 22:19:37 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-02-19 03:20:41 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-04-18 15:05:45 -07:00
|
|
|
|
|
|
|
|
|
2006-10-24 00:37:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-10-01 14:49:43 +02:00
|
|
|
|
2006-08-14 22:43:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2006-09-22 11:37:13 +02:00
|
|
|
|
|
|
|
|
|
2005-10-01 14:49:43 +02:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2007-06-14 03:45:17 +09:00
|
|
|
|
2006-09-22 11:37:13 +02:00
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Driver Core: devtmpfs - kernel-maintained tmpfs-based /dev
Devtmpfs lets the kernel create a tmpfs instance called devtmpfs
very early at kernel initialization, before any driver-core device
is registered. Every device with a major/minor will provide a
device node in devtmpfs.
Devtmpfs can be changed and altered by userspace at any time,
and in any way needed - just like today's udev-mounted tmpfs.
Unmodified udev versions will run just fine on top of it, and will
recognize an already existing kernel-created device node and use it.
The default node permissions are root:root 0600. Proper permissions
and user/group ownership, meaningful symlinks, all other policy still
needs to be applied by userspace.
If a node is created by devtmps, devtmpfs will remove the device node
when the device goes away. If the device node was created by
userspace, or the devtmpfs created node was replaced by userspace, it
will no longer be removed by devtmpfs.
If it is requested to auto-mount it, it makes init=/bin/sh work
without any further userspace support. /dev will be fully populated
and dynamic, and always reflect the current device state of the kernel.
With the commonly used dynamic device numbers, it solves the problem
where static devices nodes may point to the wrong devices.
It is intended to make the initial bootup logic simpler and more robust,
by de-coupling the creation of the inital environment, to reliably run
userspace processes, from a complex userspace bootstrap logic to provide
a working /dev.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Tested-By: Harald Hoyer <harald@redhat.com>
Tested-By: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-09 11:39:18 -07:00
|
|
|
|
|
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2007-07-09 11:39:18 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-08-07 13:06:12 -04:00
|
|
|
|
2008-03-12 00:59:38 +01:00
|
|
|
|
2008-08-07 13:06:12 -04:00
|
|
|
|
|
|
|
|
|
2008-12-05 14:10:31 -05:00
|
|
|
|
|
|
|
|
|
2012-01-11 15:12:06 +00:00
|
|
|
|
2008-12-05 14:10:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-29 11:12:11 +02:00
|
|
|
|
2009-07-30 15:27:18 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-06-22 17:17:32 -07:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
2008-08-25 19:50:19 +02:00
|
|
|
|
2010-11-15 23:13:18 +01:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
|
|
|
|
|
2008-05-28 09:28:39 -07:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
|
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-06-22 17:17:32 -07:00
|
|
|
|
2008-05-30 10:45:12 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-08-07 13:06:12 -04:00
|
|
|
|
2008-03-12 00:59:38 +01:00
|
|
|
|
|
|
|
|
|
2007-02-21 17:44:51 +00:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
2009-10-28 19:51:37 +01:00
|
|
|
|
|
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-14 03:45:17 +09:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2006-09-22 11:37:13 +02:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-21 16:09:44 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-05-28 14:24:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-30 10:45:12 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
2012-01-17 11:39:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-03 18:26:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-03 18:49:36 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-21 22:08:01 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-12-05 14:10:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-07 13:06:12 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
Driver Core: devtmpfs - kernel-maintained tmpfs-based /dev
Devtmpfs lets the kernel create a tmpfs instance called devtmpfs
very early at kernel initialization, before any driver-core device
is registered. Every device with a major/minor will provide a
device node in devtmpfs.
Devtmpfs can be changed and altered by userspace at any time,
and in any way needed - just like today's udev-mounted tmpfs.
Unmodified udev versions will run just fine on top of it, and will
recognize an already existing kernel-created device node and use it.
The default node permissions are root:root 0600. Proper permissions
and user/group ownership, meaningful symlinks, all other policy still
needs to be applied by userspace.
If a node is created by devtmps, devtmpfs will remove the device node
when the device goes away. If the device node was created by
userspace, or the devtmpfs created node was replaced by userspace, it
will no longer be removed by devtmpfs.
If it is requested to auto-mount it, it makes init=/bin/sh work
without any further userspace support. /dev will be fully populated
and dynamic, and always reflect the current device state of the kernel.
With the commonly used dynamic device numbers, it solves the problem
where static devices nodes may point to the wrong devices.
It is intended to make the initial bootup logic simpler and more robust,
by de-coupling the creation of the inital environment, to reliably run
userspace processes, from a complex userspace bootstrap logic to provide
a working /dev.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Tested-By: Harald Hoyer <harald@redhat.com>
Tested-By: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-30 15:23:42 +02:00
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
2006-06-15 15:31:56 +02:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2006-09-14 11:23:28 +02:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
2008-05-28 09:28:39 -07:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-09-13 15:34:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-25 19:50:19 +02:00
|
|
|
|
2011-12-14 14:29:38 -08:00
|
|
|
|
2006-06-15 15:31:56 +02:00
|
|
|
|
2013-08-23 17:07:26 -07:00
|
|
|
|
2006-06-28 16:19:58 -07:00
|
|
|
|
2006-11-08 19:46:14 -08:00
|
|
|
|
driver core / PM: move the calling to device_pm_remove behind the calling to bus_remove_device
We hit an hang issue when removing a mmc device on Medfield Android phone by sysfs interface.
device_pm_remove will call pm_runtime_remove which would disable
runtime PM of the device. After that pm_runtime_get* or
pm_runtime_put* will be ignored. So if we disable the runtime PM
before device really be removed, drivers' _remove callback may
access HW even pm_runtime_get* fails. That is bad.
Consider below call sequence when removing a device:
device_del => device_pm_remove
=> class_intf->remove_dev(dev, class_intf) => pm_runtime_get_sync/put_sync
=> bus_remove_device => device_release_driver => pm_runtime_get_sync/put_sync
remove_dev might call pm_runtime_get_sync/put_sync.
Then, generic device_release_driver also calls pm_runtime_get_sync/put_sync.
Since device_del => device_pm_remove firstly, later _get_sync wouldn't really wake up the device.
I git log -p to find the patch which moves the calling to device_pm_remove ahead.
It's below patch:
commit 775b64d2b6ca37697de925f70799c710aab5849a
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Sat Jan 12 20:40:46 2008 +0100
PM: Acquire device locks on suspend
This patch reorganizes the way suspend and resume notifications are
sent to drivers. The major changes are that now the PM core acquires
every device semaphore before calling the methods, and calls to
device_add() during suspends will fail, while calls to device_del()
during suspends will block.
It also provides a way to safely remove a suspended device with the
help of the PM core, by using the device_pm_schedule_removal() callback
introduced specifically for this purpose, and updates two drivers (msr
and cpuid) that need to use it.
As device_pm_schedule_removal is deleted by another patch, we need also revert other parts of the patch,
i.e. move the calling of device_pm_remove after the calling to bus_remove_device.
Signed-off-by: LongX Zhang <longx.zhang@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-10-25 00:21:28 +02:00
|
|
|
|
2012-03-05 08:47:41 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-16 09:00:00 +01:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-11-21 17:29:15 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-03-24 19:08:30 -08:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-24 19:08:30 -08:00
|
|
|
|
|
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
2013-04-06 09:56:00 -07:00
|
|
|
|
|
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
2013-04-11 11:43:29 -07:00
|
|
|
|
2013-04-06 09:56:00 -07:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
2013-04-06 09:56:00 -07:00
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-18 23:01:12 +02:00
|
|
|
|
|
|
|
|
|
2009-04-30 15:23:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-01 20:17:34 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-03-24 19:08:30 -08:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-04-15 16:00:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
2005-03-24 19:08:30 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-01 20:17:34 -04:00
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-15 11:18:11 +02:00
|
|
|
|
|
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
|
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-21 20:41:14 -04:00
|
|
|
|
2006-11-16 15:42:07 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-11-01 09:29:06 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-01 09:29:06 -06:00
|
|
|
|
2008-04-21 10:51:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
Driver core: Add offline/online device operations
In some cases, graceful hot-removal of devices is not possible,
although in principle the devices in question support hotplug.
For example, that may happen for the last CPU in the system or
for memory modules holding kernel memory.
In those cases it is nice to be able to check if the given device
can be gracefully hot-removed before triggering a removal procedure
that cannot be aborted or reversed. Unfortunately, however, the
kernel currently doesn't provide any support for that.
To address that deficiency, introduce support for offline and
online operations that can be performed on devices, respectively,
before a hot-removal and in case when it is necessary (or convenient)
to put a device back online after a successful offline (that has not
been followed by removal). The idea is that the offline will fail
whenever the given device cannot be gracefully removed from the
system and it will not be allowed to use the device after a
successful offline (until a subsequent online) in analogy with the
existing CPU offline/online mechanism.
For now, the offline and online operations are introduced at the
bus type level, as that should be sufficient for the most urgent use
cases (CPUs and memory modules). In the future, however, the
approach may be extended to cover some more complicated device
offline/online scenarios involving device drivers etc.
The lock_device_hotplug() and unlock_device_hotplug() functions are
introduced because subsequent patches need to put larger pieces of
code under device_hotplug_lock to prevent race conditions between
device offline and removal from happening.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-05-02 22:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-18 16:16:52 -05:00
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-18 21:27:55 -08:00
|
|
|
|
2011-01-07 15:17:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-11 18:11:45 +02:00
|
|
|
|
|
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 15:39:55 -07:00
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-17 16:57:58 +02:00
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-20 16:29:13 -08:00
|
|
|
|
2008-12-15 12:58:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-14 16:05:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-21 20:15:48 +01:00
|
|
|
|
2013-07-14 16:05:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-21 20:15:48 +01:00
|
|
|
|
2013-07-14 16:05:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-11 18:11:45 +02:00
|
|
|
|
|
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-14 16:05:57 -07:00
|
|
|
|
|
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-21 20:03:34 -07:00
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-11 18:11:45 +02:00
|
|
|
|
|
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-21 20:03:34 -07:00
|
|
|
|
|
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-21 20:03:34 -07:00
|
|
|
|
2008-05-15 13:44:08 -07:00
|
|
|
|
2013-07-14 16:05:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-01 20:40:17 +01:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2013-02-01 20:40:17 +01:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2008-01-28 16:56:11 +08:00
|
|
|
|
2008-01-12 20:40:46 +01:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2008-01-12 20:40:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-22 17:21:08 -04:00
|
|
|
|
2008-01-28 16:56:11 +08:00
|
|
|
|
|
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
2008-01-28 16:56:11 +08:00
|
|
|
|
2006-06-14 12:14:34 -07:00
|
|
|
|
|
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-08 14:41:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-25 09:44:07 +11:00
|
|
|
|
2010-12-13 14:08:52 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
2010-08-05 17:38:18 +02:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
2013-09-11 22:29:06 -04:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-13 22:12:35 +08:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:29 -07:00
|
|
|
|
2013-09-11 22:29:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-30 11:31:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-04 22:33:14 -07:00
|
|
|
|
2013-09-11 22:29:06 -04:00
|
|
|
|
2009-01-25 15:17:37 +01:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
|
|
|
|
|
2007-07-18 01:43:47 -07:00
|
|
|
|
2006-07-03 14:31:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-28 12:38:31 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-06 12:55:53 -08:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
2007-03-06 12:55:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-08 20:16:44 +01:00
|
|
|
|
2009-03-04 12:44:00 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
2009-03-04 12:44:00 +01:00
|
|
|
|
|
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-08 20:16:44 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-04 12:44:00 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
2008-01-24 22:50:12 -08:00
|
|
|
|
2008-01-21 16:09:44 +01:00
|
|
|
|
2008-10-30 01:36:48 +01:00
|
|
|
|
|
|
|
|
|
2007-01-08 20:16:44 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
2008-01-21 16:09:44 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
2008-02-19 03:20:41 -08:00
|
|
|
|
2008-12-16 12:24:56 -08:00
|
|
|
|
|
|
|
|
|
2008-02-19 03:20:41 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-23 09:16:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-19 03:20:41 -08:00
|
|
|
|
2012-04-23 09:16:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
2009-03-04 12:44:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-23 09:16:36 +02:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
2009-03-04 12:44:00 +01:00
|
|
|
|
2006-11-20 17:07:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-24 20:05:11 -07:00
|
|
|
|
2010-03-22 10:36:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 18:01:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-24 20:05:11 -07:00
|
|
|
|
2010-03-22 10:36:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-06 23:24:52 +01:00
|
|
|
|
2012-06-22 18:01:40 +08:00
|
|
|
|
2013-09-24 20:05:11 -07:00
|
|
|
|
|
|
|
|
|
2012-06-22 18:01:40 +08:00
|
|
|
|
|
|
|
|
|
2011-12-06 23:24:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
|
|
|
|
|
2012-11-23 15:14:12 +08:00
|
|
|
|
|
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
|
|
|
|
|
2012-11-23 15:14:12 +08:00
|
|
|
|
|
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
|
|
|
|
|
2012-06-22 18:01:40 +08:00
|
|
|
|
|
|
|
|
|
2013-09-24 20:05:11 -07:00
|
|
|
|
|
|
|
|
|
2012-06-22 18:01:40 +08:00
|
|
|
|
2010-03-22 10:36:37 -07:00
|
|
|
|
2013-09-24 20:05:11 -07:00
|
|
|
|
2010-03-22 10:36:37 -07:00
|
|
|
|
|
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
2010-03-22 10:36:37 -07:00
|
|
|
|
2007-11-26 22:11:55 -08:00
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:14:11 -07:00
|
|
|
|
|
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 02:29:59 +02:00
|
|
|
|
drivers-core: make structured logging play nice with dynamic-debug
commit c4e00daaa96d3a0786f1f4fe6456281c60ef9a16 changed __dev_printk
in a way that broke dynamic-debug's ability to control the dynamic
prefix of dev_dbg(dev,..), but not dev_dbg(NULL,..) or pr_debug(..),
which is why it wasnt noticed sooner.
When dev==NULL, __dev_printk() just calls printk(), which just works.
But otherwise, it assumed that level was always a string like "<L>"
and just plucked out the 'L', ignoring the rest. However,
dynamic_emit_prefix() adds "[tid] module:func:line:" to the string,
those additions all got lost.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Cc: stable <stable@vger.kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-19 13:46:21 -06:00
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:13:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:14:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 20:11:29 -07:00
|
|
|
|
2010-06-27 01:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|