Commit ca4d834
usb: typec: tcpm: fix tcpm unregister port but leave a pending timer
In current design, when the tcpm port is unregisterd, the kthread_worker
will be destroyed in the last step. Inside the kthread_destroy_worker(),
the worker will flush all the works and wait for them to end. However, if
one of the works calls hrtimer_start(), this hrtimer will be pending until
timeout even though tcpm port is removed. Once the hrtimer timeout, many
strange kernel dumps appear.
Thus, we can first complete kthread_destroy_worker(), then cancel all the
hrtimers. This will guarantee that no hrtimer is pending at the end.
Fixes: 3ed8e1c ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
cc: <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20211209101507.499096-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 4c4e162 commit ca4d834
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| |||
6291 | 6292 | | |
6292 | 6293 | | |
6293 | 6294 | | |
6294 | | - | |
| 6295 | + | |
| 6296 | + | |
6295 | 6297 | | |
6296 | 6298 | | |
6297 | 6299 | | |
6298 | 6300 | | |
6299 | 6301 | | |
6300 | 6302 | | |
6301 | 6303 | | |
6302 | | - | |
| 6304 | + | |
| 6305 | + | |
6303 | 6306 | | |
6304 | 6307 | | |
6305 | 6308 | | |
6306 | 6309 | | |
6307 | 6310 | | |
6308 | 6311 | | |
6309 | 6312 | | |
6310 | | - | |
| 6313 | + | |
| 6314 | + | |
6311 | 6315 | | |
6312 | 6316 | | |
6313 | 6317 | | |
6314 | 6318 | | |
6315 | 6319 | | |
6316 | 6320 | | |
6317 | 6321 | | |
6318 | | - | |
| 6322 | + | |
| 6323 | + | |
6319 | 6324 | | |
6320 | 6325 | | |
6321 | 6326 | | |
| |||
6403 | 6408 | | |
6404 | 6409 | | |
6405 | 6410 | | |
| 6411 | + | |
6406 | 6412 | | |
6407 | 6413 | | |
6408 | 6414 | | |
| |||
6424 | 6430 | | |
6425 | 6431 | | |
6426 | 6432 | | |
| 6433 | + | |
| 6434 | + | |
| 6435 | + | |
6427 | 6436 | | |
6428 | 6437 | | |
6429 | 6438 | | |
| |||
6435 | 6444 | | |
6436 | 6445 | | |
6437 | 6446 | | |
6438 | | - | |
6439 | 6447 | | |
6440 | 6448 | | |
6441 | 6449 | | |
| |||
0 commit comments