linux/drivers/base
Rafael J. Wysocki cead4664c2 FROMGIT: drivers: base: Fix device link removal
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>
(cherry picked from commit 80dd33cf72
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 driver-core-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ied905bee2346bab71c8ebdc554e5f3f7836db516
2021-06-04 11:15:18 -07:00
..
firmware_loader Char/Misc driver patches for 5.10-rc1 2020-10-15 10:01:51 -07:00
power Revert "Revert "PM: runtime: Fix unpaired parent child_count for force_resume"" 2021-06-04 11:15:17 -07: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 ANDROID: topology: Add flag to indicate topology has been updated 2021-05-11 22:55:07 +00:00
attribute_container.c
base.h UPSTREAM: Revert "driver core: fw_devlink: Add support for batching fwnode parsing" 2021-01-21 18:01:50 -08:00
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c FROMGIT: drivers: base: Fix device link removal 2021-06-04 11:15:18 -07:00
cpu.c
dd.c Merge 5.10.30 into android12-5.10 2021-04-15 14:23:41 +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 UPSTREAM: device property: Add fwnode_is_ancestor_of() and fwnode_get_next_parent_dev() 2021-01-21 18:04:03 -08:00
soc.c
swnode.c This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
syscore.c Merge 3e4fb4346c ("Merge tag 'spdx-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx") into android-mailine 2020-10-26 07:05:05 +01:00
topology.c
transport_class.c