Commit 0b3144d
committed
USB: make single lock for all usb dynamic id lists
There are a number of places where we accidentally pass in a constant
structure to later cast it off to a dynamic one, and then attempt to
grab a lock on it, which is not a good idea. To help resolve this, move
the dynamic id lock out of the dynamic id structure for the driver and
into one single lock for all USB dynamic ids. As this lock should never
have any real contention (it's only every accessed when a device is
added or removed, which is always serialized) there should not be any
difference except for some memory savings.
Note, this just converts the existing use of the dynamic id lock to the
new static lock, there is one place that is accessing the dynamic id
list without grabbing the lock, that will be fixed up in a follow-on
change.
Cc: Johan Hovold <[email protected]>
Cc: Herve Codina <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Grant Grundler <[email protected]>
Cc: Oliver Neukum <[email protected]>
Cc: Yajun Deng <[email protected]>
Cc: Douglas Anderson <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/2024111322-kindly-finalist-d247@gregkh
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 528ea1a commit 0b3144d
File tree
5 files changed
+11
-17
lines changed- drivers/usb
- common
- core
- serial
- include/linux
5 files changed
+11
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| |||
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
223 | | - | |
| 222 | + | |
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | 226 | | |
228 | | - | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
233 | 231 | | |
234 | 232 | | |
235 | 233 | | |
236 | | - | |
| 234 | + | |
237 | 235 | | |
238 | 236 | | |
239 | | - | |
240 | 237 | | |
241 | 238 | | |
242 | 239 | | |
243 | | - | |
244 | 240 | | |
245 | 241 | | |
246 | 242 | | |
| |||
1076 | 1072 | | |
1077 | 1073 | | |
1078 | 1074 | | |
1079 | | - | |
1080 | 1075 | | |
1081 | 1076 | | |
1082 | 1077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | | - | |
161 | 159 | | |
162 | 160 | | |
163 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
713 | 712 | | |
714 | 713 | | |
715 | 714 | | |
716 | | - | |
717 | 715 | | |
718 | 716 | | |
719 | 717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
| 1132 | + | |
1132 | 1133 | | |
1133 | | - | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
| |||
0 commit comments