linux/drivers/usb/typec
Xu Yang ca4d8344a7 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: 3ed8e1c2ac ("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>
2021-12-15 23:45:30 +01:00
..
altmodes usb: typec: altmodes/displayport: Notify drm subsys of hotplug events 2021-08-20 12:35:59 +02:00
mux Linux 5.13-rc6 2021-06-14 09:18:07 +02:00
tcpm usb: typec: tcpm: fix tcpm unregister port but leave a pending timer 2021-12-15 23:45:30 +01:00
tipd usb: typec: tipd: Fix initialization sequence for cd321x 2021-11-23 14:08:08 +01:00
ucsi usb: typec: ucsi: Better fix for missing unplug events issue 2021-10-05 12:42:38 +02:00
bus.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
bus.h usb: typec: Organize the private headers properly 2021-04-05 09:07:41 +02:00
class.c usb: typec: Add the missed altmode_id_remove() in typec_register_altmode() 2021-06-17 15:39:33 +02:00
class.h usb: typec: Link all ports during connector registration 2021-04-09 16:00:00 +02:00
hd3ss3220.c usb: typec: hd3ss3220: Use regmap_write_bits() 2021-09-14 10:12:06 +02:00
Kconfig usb: typec: STUSB160X should select REGMAP_I2C 2021-10-18 17:07:28 +02:00
Makefile usb: typec: Port mapping utility 2021-04-09 16:00:00 +02:00
mux.c Linux 5.13-rc6 2021-06-14 09:18:07 +02:00
mux.h usb: typec: mux: Use device type instead of device name for matching 2021-05-27 09:23:57 +02:00
port-mapper.c usb: typec: silence a static checker warning 2021-04-14 15:15:40 +02:00
qcom-pmic-typec.c usb: typec: Add QCOM PMIC typec detection driver 2020-10-09 15:14:43 +02:00
stusb160x.c usb: typec: stusb160x: Don't block probing of consumer of "connector" nodes 2021-07-21 09:16:40 +02:00