Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

device-core: Kill the lockdep_mutex

Per Peter [1], the lockdep API has native support for all the use cases
lockdep_mutex was attempting to enable. Now that all lockdep_mutex users
have been converted to those APIs, drop this lock.

Link: https://lore.kernel.org/r/Ylf0dewci8myLvoW@hirez.programming.kicks-ass.net [1]
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/165055522548.3745911.14298368286915484086.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

-8
-3
drivers/base/core.c
··· 2864 2864 kobject_init(&dev->kobj, &device_ktype); 2865 2865 INIT_LIST_HEAD(&dev->dma_pools); 2866 2866 mutex_init(&dev->mutex); 2867 - #ifdef CONFIG_PROVE_LOCKING 2868 - mutex_init(&dev->lockdep_mutex); 2869 - #endif 2870 2867 lockdep_set_novalidate_class(&dev->mutex); 2871 2868 spin_lock_init(&dev->devres_lock); 2872 2869 INIT_LIST_HEAD(&dev->devres_head);
-5
include/linux/device.h
··· 400 400 * This identifies the device type and carries type-specific 401 401 * information. 402 402 * @mutex: Mutex to synchronize calls to its driver. 403 - * @lockdep_mutex: An optional debug lock that a subsystem can use as a 404 - * peer lock to gain localized lockdep coverage of the device_lock. 405 403 * @bus: Type of bus device is on. 406 404 * @driver: Which driver has allocated this 407 405 * @platform_data: Platform data specific to the device. ··· 497 499 core doesn't touch it */ 498 500 void *driver_data; /* Driver data, set and get with 499 501 dev_set_drvdata/dev_get_drvdata */ 500 - #ifdef CONFIG_PROVE_LOCKING 501 - struct mutex lockdep_mutex; 502 - #endif 503 502 struct mutex mutex; /* mutex to synchronize calls to 504 503 * its driver. 505 504 */