Commit d4abf87
committed
tmff2,t500rs: route FF_GAIN/FF_AUTOCENTER via base workqueue; drop per-wheel worker; fix "scheduling while atomic"
The T500RS backend still had its own workqueue for gain and
autocenter. The maintainer requested to completely remove the per-wheel
workqueue and use the base driver workqueue instead. While playing a
game we also hit a WARN ("scheduling while atomic") when FF_GAIN was
updated: input_ff_event() runs in an RCU read-side section, but the
T500RS callbacks called usb_interrupt_msg(), which can sleep.
This change centralizes the deferral in the core (tmff2) and removes the
extra worker from the wheel backend:
- tmff2: add pending Gain/Autocenter fields and flags; have
tmff2_set_gain()/tmff2_set_autocenter() only cache the values under
the spinlock and schedule the existing delayed_work. The actual USB
I/O is performed from tmff2_work_handler() in process context after
the lock is released. The sysfs gain store is routed through the same
mechanism so everything converges on a single path.
- t500rs: drop the per-wheel workqueue and any related helpers; use the
shared send_buffer and let the base driver workqueue perform the USB
interrupt transfer. Also remove a now-unused helper
(t500rs_do_set_gain_byte) and minor cleanups.
Why:
- Satisfies the maintainer request to remove the extra workqueue and
reuse the base driver workqueue.
- Fixes the "scheduling while atomic" warning by ensuring that gain and
autocenter packets are always sent from process context.
- Reduces duplication and keeps all FF deferral logic in one place.
Notes:
- Effect handlers and the rest of the USB packet layout are unchanged.
- Logging behaviour is unchanged; follow-ups can add rate limiting if
needed.
Build/validate:
- Builds cleanly (no warnings).
- Smoke-tested: module reloads, wheel init OK, no WARN/OOPS when a game
changes FF gain/autocenter.
MSG1 parent dd21177 commit d4abf87
File tree
4 files changed
+117
-284
lines changed- docs
- src
- tmt500rs
4 files changed
+117
-284
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
| |||
274 | 281 | | |
275 | 282 | | |
276 | 283 | | |
| 284 | + | |
277 | 285 | | |
278 | 286 | | |
279 | 287 | | |
| |||
283 | 291 | | |
284 | 292 | | |
285 | 293 | | |
286 | | - | |
287 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
288 | 302 | | |
289 | 303 | | |
290 | 304 | | |
291 | 305 | | |
292 | 306 | | |
| 307 | + | |
293 | 308 | | |
294 | 309 | | |
295 | 310 | | |
| |||
299 | 314 | | |
300 | 315 | | |
301 | 316 | | |
302 | | - | |
303 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
304 | 325 | | |
305 | 326 | | |
306 | 327 | | |
| |||
317 | 338 | | |
318 | 339 | | |
319 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
320 | 365 | | |
321 | 366 | | |
322 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
0 commit comments