diff mbox series

[3/3] usb: typec: tcpm: cancel send discover hrtimer when unregister tcpm port

Message ID 1622627829-11070-3-git-send-email-jun.li@nxp.com
State New
Headers show
Series [1/3] usb: typec: tcpm: cancel vdm and state machine hrtimer when unregister tcpm port | expand

Commit Message

Jun Li June 2, 2021, 9:57 a.m. UTC
Like the state_machine_timer, we should also cancel possible pending
send discover identity hrtimer when unregister tcpm port.

Fixes: c34e85fa69b9 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Signed-off-by: Li Jun <jun.li@nxp.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Heikki Krogerus June 7, 2021, 9:18 a.m. UTC | #1
On Wed, Jun 02, 2021 at 05:57:09PM +0800, Li Jun wrote:
> Like the state_machine_timer, we should also cancel possible pending

> send discover identity hrtimer when unregister tcpm port.

> 

> Fixes: c34e85fa69b9 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")

> Signed-off-by: Li Jun <jun.li@nxp.com>


Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>


> ---

>  drivers/usb/typec/tcpm/tcpm.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c

> index c7460df2119d..2899c9de6d20 100644

> --- a/drivers/usb/typec/tcpm/tcpm.c

> +++ b/drivers/usb/typec/tcpm/tcpm.c

> @@ -6328,6 +6328,7 @@ void tcpm_unregister_port(struct tcpm_port *port)

>  {

>  	int i;

>  

> +	hrtimer_cancel(&port->send_discover_timer);

>  	hrtimer_cancel(&port->enable_frs_timer);

>  	hrtimer_cancel(&port->vdm_state_machine_timer);

>  	hrtimer_cancel(&port->state_machine_timer);

> -- 

> 2.25.1


-- 
heikki
diff mbox series

Patch

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index c7460df2119d..2899c9de6d20 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -6328,6 +6328,7 @@  void tcpm_unregister_port(struct tcpm_port *port)
 {
 	int i;
 
+	hrtimer_cancel(&port->send_discover_timer);
 	hrtimer_cancel(&port->enable_frs_timer);
 	hrtimer_cancel(&port->vdm_state_machine_timer);
 	hrtimer_cancel(&port->state_machine_timer);