Skip to content

Commit fe41269

Browse files
committed
Revert "drivers: core: synchronize really_probe() and dev_uevent()"
jira LE-3587 Rebuild_History Non-Buildable kernel-4.18.0-553.62.1.el8_10 commit-author Dmitry Torokhov <[email protected]> commit dc1771f Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-4.18.0-553.62.1.el8_10/dc1771f7.failed This reverts commit c0a4009. Probing a device can take arbitrary long time. In the field we observed that, for example, probing a bad micro-SD cards in an external USB card reader (or maybe cards were good but cables were flaky) sometimes takes longer than 2 minutes due to multiple retries at various levels of the stack. We can not block uevent_show() method for that long because udev is reading that attribute very often and that blocks udev and interferes with booting of the system. The change that introduced locking was concerned with dev_uevent() racing with unbinding the driver. However we can handle it without locking (which will be done in subsequent patch). There was also claim that synchronization with probe() is needed to properly load USB drivers, however this is a red herring: the change adding the lock was introduced in May of last year and USB loading and probing worked properly for many years before that. Revert the harmful locking. Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]> Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit dc1771f) Signed-off-by: Jonathan Maple <[email protected]> # Conflicts: # drivers/base/core.c
1 parent ba0f209 commit fe41269

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

Comments
 (0)