Skip to content

Commit d903494

Browse files
gregkhopsiff
authored andcommitted
Revert "driver core: enforce device_lock for driver_match_device()"
This reverts commit 8d76b2488eb3cc0717ab81b60622cff4a5f90f79 which is commit dc23806 upstream. It causes boot regressions on some systems as all of the "fixes" for drivers are not properly backported yet. Once that is completed, only then can this be applied, if really necessary given the potential for explosions, perhaps we might want to wait a few -rc releases first... Cc: Danilo Krummrich <dakr@kernel.org> Cc: Rafael J. Wysocki (Intel) <rafael@kernel.org> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Gui-Dong Han <hanguidong02@gmail.com> Cc: Qiu-ji Chen <chenqiuji666@gmail.com> Reported-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/7dfd0e63-a725-4fac-b2a0-f2e621d99d1b@sirena.org.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 53a76425e0764421ba93bb9045d2e454667d5687) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 73a001e commit d903494

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

drivers/base/base.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,9 @@ void device_set_deferred_probe_reason(const struct device *dev, struct va_format
166166
static inline int driver_match_device(const struct device_driver *drv,
167167
struct device *dev)
168168
{
169-
device_lock_assert(dev);
170-
171169
return drv->bus->match ? drv->bus->match(dev, drv) : 1;
172170
}
173171

174-
static inline int driver_match_device_locked(const struct device_driver *drv,
175-
struct device *dev)
176-
{
177-
guard(device)(dev);
178-
return driver_match_device(drv, dev);
179-
}
180-
181172
static inline void dev_sync_state(struct device *dev)
182173
{
183174
if (dev->bus->sync_state)

drivers/base/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
263263
int err = -ENODEV;
264264

265265
dev = bus_find_device_by_name(bus, NULL, buf);
266-
if (dev && driver_match_device_locked(drv, dev)) {
266+
if (dev && driver_match_device(drv, dev)) {
267267
err = device_driver_attach(drv, dev);
268268
if (!err) {
269269
/* success */

drivers/base/dd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ static int __driver_attach(struct device *dev, void *data)
11701170
* is an error.
11711171
*/
11721172

1173-
ret = driver_match_device_locked(drv, dev);
1173+
ret = driver_match_device(drv, dev);
11741174
if (ret == 0) {
11751175
/* no match */
11761176
return 0;

0 commit comments

Comments
 (0)