diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-27 11:25:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-27 11:25:51 -0400 |
| commit | 523634db145a22cd5562714d4c59ea74686afe38 (patch) | |
| tree | 14f3fa773866d9afe83af9257ff0dffac84e25ac /include/linux/device.h | |
| parent | 5168afe6ef596eaf2ff7a533b780c79ce14445e4 (diff) | |
| parent | 87a30e1f05d73a34e6d1895065541369131aaf1c (diff) | |
Merge tag 'libnvdimm-fixes-5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fixes from Dan Williams:
"A collection of locking and async operations fixes for v5.3-rc2. These
had been soaking in a branch targeting the merge window, but missed
due to a regression hunt. This fixed up version has otherwise been in
-next this past week with no reported issues.
In order to gain confidence in the locking changes the pull also
includes a debug / instrumentation patch to enable lockdep coverage
for libnvdimm subsystem operations that depend on the device_lock for
exclusion. As mentioned in the changelog it is a hack, but it works
and documents the locking expectations of the sub-system in a way that
others can use lockdep to verify. The driver core touches got an ack
from Greg.
Summary:
- Fix duplicate device_unregister() calls (multiple threads competing
to do unregister work when scheduling device removal from a sysfs
attribute of the self-same device).
- Fix badblocks registration order bug. Ensure region badblocks are
initialized in advance of namespace registration.
- Fix a deadlock between the bus lock and probe operations.
- Export device-core infrastructure to coordinate async operations
via the device ->dead state.
- Add device-core infrastructure to validate device_lock() usage with
lockdep"
* tag 'libnvdimm-fixes-5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
driver-core, libnvdimm: Let device subsystems add local lockdep coverage
libnvdimm/bus: Fix wait_nvdimm_bus_probe_idle() ABBA deadlock
libnvdimm/bus: Stop holding nvdimm_bus_list_mutex over __nd_ioctl()
libnvdimm/bus: Prepare the nd_ioctl() path to be re-entrant
libnvdimm/region: Register badblocks before namespaces
libnvdimm/bus: Prevent duplicate device_unregister() calls
drivers/base: Introduce kill_device()
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index c330b75c6c57..6717adee33f0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -915,6 +915,8 @@ struct dev_links_info { | |||
| 915 | * This identifies the device type and carries type-specific | 915 | * This identifies the device type and carries type-specific |
| 916 | * information. | 916 | * information. |
| 917 | * @mutex: Mutex to synchronize calls to its driver. | 917 | * @mutex: Mutex to synchronize calls to its driver. |
| 918 | * @lockdep_mutex: An optional debug lock that a subsystem can use as a | ||
| 919 | * peer lock to gain localized lockdep coverage of the device_lock. | ||
| 918 | * @bus: Type of bus device is on. | 920 | * @bus: Type of bus device is on. |
| 919 | * @driver: Which driver has allocated this | 921 | * @driver: Which driver has allocated this |
| 920 | * @platform_data: Platform data specific to the device. | 922 | * @platform_data: Platform data specific to the device. |
| @@ -998,6 +1000,9 @@ struct device { | |||
| 998 | core doesn't touch it */ | 1000 | core doesn't touch it */ |
| 999 | void *driver_data; /* Driver data, set and get with | 1001 | void *driver_data; /* Driver data, set and get with |
| 1000 | dev_set_drvdata/dev_get_drvdata */ | 1002 | dev_set_drvdata/dev_get_drvdata */ |
| 1003 | #ifdef CONFIG_PROVE_LOCKING | ||
| 1004 | struct mutex lockdep_mutex; | ||
| 1005 | #endif | ||
| 1001 | struct mutex mutex; /* mutex to synchronize calls to | 1006 | struct mutex mutex; /* mutex to synchronize calls to |
| 1002 | * its driver. | 1007 | * its driver. |
| 1003 | */ | 1008 | */ |
| @@ -1383,6 +1388,7 @@ extern int (*platform_notify_remove)(struct device *dev); | |||
| 1383 | */ | 1388 | */ |
| 1384 | extern struct device *get_device(struct device *dev); | 1389 | extern struct device *get_device(struct device *dev); |
| 1385 | extern void put_device(struct device *dev); | 1390 | extern void put_device(struct device *dev); |
| 1391 | extern bool kill_device(struct device *dev); | ||
| 1386 | 1392 | ||
| 1387 | #ifdef CONFIG_DEVTMPFS | 1393 | #ifdef CONFIG_DEVTMPFS |
| 1388 | extern int devtmpfs_create_node(struct device *dev); | 1394 | extern int devtmpfs_create_node(struct device *dev); |
