kernel_optimize_test/drivers/base
Rafael J. Wysocki d007150b4e drivers: base: Fix device link removal
commit 80dd33cf72d1ab4f0af303f1fa242c6d6c8d328f upstream.

When device_link_free() drops references to the supplier and
consumer devices of the device link going away and the reference
being dropped turns out to be the last one for any of those
device objects, its ->release callback will be invoked and it
may sleep which goes against the SRCU callback execution
requirements.

To address this issue, make the device link removal code carry out
the device_link_free() actions preceded by SRCU synchronization from
a separate work item (the "long" workqueue is used for that, because
it does not matter when the device link memory is released and it may
take time to get to that point) instead of using SRCU callbacks.

While at it, make the code work analogously when SRCU is not enabled
to reduce the differences between the SRCU and non-SRCU cases.

Fixes: 843e600b8a ("driver core: Fix sleeping in invalid context during device link deletion")
Cc: stable <stable@vger.kernel.org>
Reported-by: chenxiang (M) <chenxiang66@hisilicon.com>
Tested-by: chenxiang (M) <chenxiang66@hisilicon.com>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/5722787.lOV4Wx5bFT@kreacher
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03 09:00:34 +02:00
..
firmware_loader
power PM: runtime: Fix unpaired parent child_count for force_resume 2021-05-19 10:12:51 +02:00
regmap regmap: set debugfs_name to NULL after it is freed 2021-05-14 09:50:09 +02:00
test drivers/base: build kunit tests without structleak plugin 2021-03-17 17:06:24 +01:00
arch_topology.c
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c drivers: base: Fix device link removal 2021-06-03 09:00:34 +02:00
cpu.c
dd.c driver core: Fix locking bug in deferred_probe_timeout_work_func() 2021-04-14 08:42:03 +02:00
devcoredump.c
devres.c
devtmpfs.c devtmpfs: fix placement of complete() call 2021-05-14 09:50:11 +02:00
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c drivers/base/memory: don't store phys_device in memory blocks 2021-03-17 17:06:25 +01:00
module.c
node.c node: fix device cleanups in error handling code 2021-05-14 09:50:19 +02:00
pinctrl.c
platform-msi.c
platform.c
property.c
soc.c
swnode.c software node: Fix node registration 2021-03-17 17:06:28 +01:00
syscore.c
topology.c
transport_class.c