linux-stable/drivers/base
Dan Williams c23106d427 drivers/base: Introduce kill_device()
commit 00289cd876 upstream.

The libnvdimm subsystem arranges for devices to be destroyed as a result
of a sysfs operation. Since device_unregister() cannot be called from
an actively running sysfs attribute of the same device libnvdimm
arranges for device_unregister() to be performed in an out-of-line async
context.

The driver core maintains a 'dead' state for coordinating its own racing
async registration / de-registration requests. Rather than add local
'dead' state tracking infrastructure to libnvdimm device objects, export
the existing state tracking via a new kill_device() helper.

The kill_device() helper simply marks the device as dead, i.e. that it
is on its way to device_del(), or returns that the device was already
dead. This can be used in advance of calling device_unregister() for
subsystems like libnvdimm that might need to handle multiple user
threads racing to delete a device.

This refactoring does not change any behavior, but it is a pre-requisite
for follow-on fixes and therefore marked for -stable.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Fixes: 4d88a97aa9 ("libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver...")
Cc: <stable@vger.kernel.org>
Tested-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/156341207332.292348.14959761496009347574.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-09 17:52:28 +02:00
..
firmware_loader firmware: improve LSM/IMA security behaviour 2019-07-21 09:03:03 +02:00
power PM / core: Propagate dev->power.wakeup_path when no callbacks 2019-05-31 06:46:23 -07:00
regmap regmap: fix bulk writes on paged registers 2019-07-26 09:14:06 +02:00
test driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
arch_topology.c Revert "base: arch_topology: fix section mismatch build warnings" 2018-03-15 14:36:20 +01:00
attribute_container.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
base.h driver core: Establish order of operations for device_add and device_del via bitflag 2019-08-09 17:52:28 +02:00
bus.c kobject: return error code if writing /sys/.../uevent fails 2019-02-12 19:47:06 +01:00
cacheinfo.c drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT 2019-07-21 09:03:03 +02:00
class.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
component.c component: add debugfs support 2017-12-18 16:51:11 +01:00
container.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
core.c drivers/base: Introduce kill_device() 2019-08-09 17:52:28 +02:00
cpu.c x86/speculation/mds: Add sysfs reporting for MDS 2019-05-14 19:17:56 +02:00
dd.c driver core: Establish order of operations for device_add and device_del via bitflag 2019-08-09 17:52:28 +02:00
devcon.c drivers: base: Unified device connection lookup 2018-03-22 13:10:29 +01:00
devcoredump.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
devres.c devres: Align data[] to ARCH_KMALLOC_MINALIGN 2019-02-12 19:46:56 +01:00
devtmpfs.c kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare() 2018-04-02 20:16:06 +02:00
driver.c driver-core: return EINVAL error instead of BUG_ON() 2018-05-25 18:18:45 +02:00
firmware.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
hypervisor.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
init.c base: fix order of OF initialization 2018-07-07 17:54:29 +02:00
isa.c Merge 4.15-rc3 into driver-core-next 2017-12-11 08:50:05 +01:00
Kconfig firmware_loader: move kconfig FW_LOADER entries to its own file 2018-05-14 16:43:10 +02:00
Makefile dma-mapping: move all DMA mapping code to kernel/dma 2018-06-14 08:50:37 +02:00
map.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
memory.c memory_hotplug: fix kernel_panic on offline page processing 2018-09-04 16:45:02 -07:00
module.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
node.c mm: hide incomplete nr_indirectly_reclaimable in sysfs 2019-04-20 09:16:05 +02:00
pinctrl.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
platform-msi.c platform-msi: Free descriptors in platform_msi_domain_free() 2019-01-09 17:38:42 +01:00
platform.c Power management updates for 4.18-rc1 2018-06-05 09:38:39 -07:00
property.c device property: Get rid of union aliasing 2018-05-17 12:47:21 +02:00
soc.c base: soc: use put_device() instead of kfree() 2018-03-15 14:37:03 +01:00
syscore.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
topology.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
transport_class.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00