Commit 3d6ebf1
cxl/port: Fix cxl_bus_rescan() vs bus_rescan_devices()
It turns out since its original introduction, pre-2.6.12,
bus_rescan_devices() has skipped devices that might be in the process of
attaching or detaching from their driver. For CXL this behavior is
unwanted and expects that cxl_bus_rescan() is a probe barrier.
That behavior is simple enough to achieve with bus_for_each_dev() paired
with call to device_attach(), and it is unclear why bus_rescan_devices()
took the position of lockless consumption of dev->driver which is racy.
The "Fixes:" but no "Cc: stable" on this patch reflects that the issue
is merely by inspection since the bug that triggered the discovery of
this potential problem [1] is fixed by other means. However, a stable
backport should do no harm.
Fixes: 8dd2bc0 ("cxl/mem: Add the cxl_mem driver")
Link: http://lore.kernel.org/[email protected] [1]
Signed-off-by: Dan Williams <[email protected]>
Tested-by: Gregory Price <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Link: https://patch.msgid.link/172964781104.81806.4277549800082443769.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Ira Weiny <[email protected]>1 parent 6575b26 commit 3d6ebf1
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2084 | 2084 | | |
2085 | 2085 | | |
2086 | 2086 | | |
2087 | | - | |
| 2087 | + | |
2088 | 2088 | | |
2089 | | - | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
2090 | 2092 | | |
2091 | | - | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2092 | 2099 | | |
2093 | 2100 | | |
2094 | 2101 | | |
| |||
0 commit comments