[PATCH v2] driver core: Fix device_pm_lock() locking for device links

Stephen Boyd sboyd at kernel.org
Wed Sep 2 04:10:19 EDT 2020


Quoting Saravana Kannan (2020-09-01 11:44:44)
> This commit fixes two issues:
> 
> 1. The lockdep warning reported by Dong Aisheng <dongas86 at gmail.com> [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).

Just curious, why are there sysfs name collisions for device links?
Shouldn't the device link device be named something like "devlink<N>"
with some IDA incrementing N so that collisions can never happen? If
they were always unique then presumably it would be OK to keep using
SRCU?



More information about the linux-arm-kernel mailing list