android_kernel_motorola_sm6375/drivers/base
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Saravana Kannan 5eee799bec UPSTREAM: driver core: Fix device_pm_lock() locking for device links
This commit fixes two issues:

1. The lockdep warning reported by Dong Aisheng <[email protected]> [1].

It is a warning about a cycle (dpm_list_mtx --> kn->active#3 --> fw_lock)
that was introduced when device-link devices were added to expose device
link information in sysfs.

The patch that "introduced" this cycle can't be reverted because it's fixes
a real SRCU issue and also ensures that the device-link device is deleted
as soon as the device-link is deleted. This is important to avoid sysfs
name collisions if the device-link is create again immediately (this can
happen a lot with deferred probing).

2. Inconsistency in grabbing device_pm_lock() during device link deletion

Some device link deletion code paths grab device_pm_lock(), while others
don't.  The device_pm_lock() is grabbed during device_link_add() because it
checks if the supplier is in the dpm_list and also reorders the dpm_list.
However, when a device link is deleted, it does not do either of those and
therefore device_pm_lock() is not necessary. Dropping the device_pm_lock()
in all the device link deletion paths removes the inconsistency in locking.

Thanks to Stephen Boyd for helping me understand the lockdep splat.

Fixes: 843e600b8a2b ("driver core: Fix sleeping in invalid context during device link deletion")
[1] - https://lore.kernel.org/lkml/CAA+hA=S4eAreb7vo69LAXSk2t5=DEKNxHaiY1wSpk4xTp9urLg@mail.gmail.com/
Reported-by: Dong Aisheng <[email protected]>
Signed-off-by: Saravana Kannan <[email protected]>
Tested-by: Peng Fan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 6b57b15abe11aa334ebf726e02c0deaf123ba040)
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I714523d92bbfbad145df2794c481cd0b697d7d16
2020-11-14 16:20:48 +01:00
..
firmware_loader BACKPORT: FROMLIST: firmware_loader: fix memory leak for paged buffer 2020-09-01 09:04:41 +00:00
power This is the 5.4.55 stable release 2020-08-01 11:46:55 +02:00
regmap regmap: debugfs: check count when read regmap file 2020-07-31 18:39:32 +02:00
test driver core: Fix test_async_driver_probe if NUMA is disabled 2020-02-01 09:34:36 +00:00
arch_topology.c ANDROID: sched: add cpumask parameter to cpu capacity vendor hook 2020-09-28 16:04:11 +00:00
attribute_container.c
base.h UPSTREAM: driver core: Don't do deferred probe in parallel with kernel_init thread 2020-08-06 18:50:43 -07:00
bus.c
cacheinfo.c
class.c
component.c component: Silence bind error on -EPROBE_DEFER 2020-05-27 17:46:31 +02:00
container.c
core.c UPSTREAM: driver core: Fix device_pm_lock() locking for device links 2020-11-14 16:20:48 +01:00
cpu.c x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation 2020-06-10 20:24:57 +02:00
dd.c Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c drivers/base/memory.c: indicate all memory blocks as removable 2020-04-01 11:02:02 +02:00
module.c
node.c FROMLIST: scs: add accounting 2019-11-27 12:49:09 -08:00
pinctrl.c
platform-msi.c
platform.c drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish 2020-06-24 17:50:24 +02:00
property.c
soc.c UPSTREAM: base: soc: Handle custom soc information sysfs entries 2019-10-17 13:15:53 -07:00
swnode.c Revert "software node: Simplify software_node_release() function" 2020-05-10 10:31:30 +02:00
syscore.c
topology.c
transport_class.c