|
| 1 | +Revert "drivers: core: synchronize really_probe() and dev_uevent()" |
| 2 | + |
| 3 | +jira LE-3587 |
| 4 | +Rebuild_History Non-Buildable kernel-4.18.0-553.62.1.el8_10 |
| 5 | +commit-author Dmitry Torokhov < [email protected]> |
| 6 | +commit dc1771f718548f7d4b93991b174c6e7b5e1ba410 |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-4.18.0-553.62.1.el8_10/dc1771f7.failed |
| 10 | + |
| 11 | +This reverts commit c0a40097f0bc81deafc15f9195d1fb54595cd6d0. |
| 12 | + |
| 13 | +Probing a device can take arbitrary long time. In the field we observed |
| 14 | +that, for example, probing a bad micro-SD cards in an external USB card |
| 15 | +reader (or maybe cards were good but cables were flaky) sometimes takes |
| 16 | +longer than 2 minutes due to multiple retries at various levels of the |
| 17 | +stack. We can not block uevent_show() method for that long because udev |
| 18 | +is reading that attribute very often and that blocks udev and interferes |
| 19 | +with booting of the system. |
| 20 | + |
| 21 | +The change that introduced locking was concerned with dev_uevent() |
| 22 | +racing with unbinding the driver. However we can handle it without |
| 23 | +locking (which will be done in subsequent patch). |
| 24 | + |
| 25 | +There was also claim that synchronization with probe() is needed to |
| 26 | +properly load USB drivers, however this is a red herring: the change |
| 27 | +adding the lock was introduced in May of last year and USB loading and |
| 28 | +probing worked properly for many years before that. |
| 29 | + |
| 30 | +Revert the harmful locking. |
| 31 | + |
| 32 | + |
| 33 | + Signed-off-by: Dmitry Torokhov < [email protected]> |
| 34 | + Reviewed-by: Masami Hiramatsu (Google) < [email protected]> |
| 35 | +Link: https://lore.kernel.org/r/ [email protected] |
| 36 | + Signed-off-by: Greg Kroah-Hartman < [email protected]> |
| 37 | +(cherry picked from commit dc1771f718548f7d4b93991b174c6e7b5e1ba410) |
| 38 | + Signed-off-by: Jonathan Maple < [email protected]> |
| 39 | + |
| 40 | +# Conflicts: |
| 41 | +# drivers/base/core.c |
| 42 | +diff --cc drivers/base/core.c |
| 43 | +index 85168dc6be18,f9c1c623bca5..000000000000 |
| 44 | +--- a/drivers/base/core.c |
| 45 | ++++ b/drivers/base/core.c |
| 46 | +@@@ -2572,11 -2726,8 +2572,13 @@@ static ssize_t uevent_show(struct devic |
| 47 | + if (!env) |
| 48 | + return -ENOMEM; |
| 49 | + |
| 50 | +- /* Synchronize with really_probe() */ |
| 51 | +- device_lock(dev); |
| 52 | + /* let the kset specific function add its keys */ |
| 53 | +++<<<<<<< HEAD |
| 54 | + + retval = kset->uevent_ops->uevent(kset, &dev->kobj, env); |
| 55 | + + device_unlock(dev); |
| 56 | +++======= |
| 57 | ++ retval = kset->uevent_ops->uevent(&dev->kobj, env); |
| 58 | +++>>>>>>> dc1771f71854 (Revert "drivers: core: synchronize really_probe() and dev_uevent()") |
| 59 | + if (retval) |
| 60 | + goto out; |
| 61 | + |
| 62 | +* Unmerged path drivers/base/core.c |
0 commit comments