linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: linux@roeck-us.net, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, jun.li@nxp.com, linux-imx@nxp.com
Subject: Re: [PATCH] usb: typec: tcpm: fix tcpm unregister port but leave a pending timer
Date: Thu, 18 Nov 2021 15:18:29 +0200	[thread overview]
Message-ID: <YZZSpffDfPd/CJDX@kuha.fi.intel.com> (raw)
In-Reply-To: <20211118092352.259748-1-xu.yang_2@nxp.com>

Hi,

On Thu, Nov 18, 2021 at 05:23:52PM +0800, Xu Yang wrote:
> @@ -6428,6 +6432,9 @@ void tcpm_unregister_port(struct tcpm_port *port)
>  {
>  	int i;

You need to take the port lock here, no?

        mutex_lock(&port->lock);

> +	kthread_destroy_worker(port->wq);
> +	port->wq = NULL;

        mutex_unlock(&port->lock);

>  	hrtimer_cancel(&port->send_discover_timer);
>  	hrtimer_cancel(&port->enable_frs_timer);
>  	hrtimer_cancel(&port->vdm_state_machine_timer);
> @@ -6439,7 +6446,6 @@ void tcpm_unregister_port(struct tcpm_port *port)
>  	typec_unregister_port(port->typec_port);
>  	usb_role_switch_put(port->role_sw);
>  	tcpm_debugfs_exit(port);
> -	kthread_destroy_worker(port->wq);
>  }
>  EXPORT_SYMBOL_GPL(tcpm_unregister_port);

thanks,

-- 
heikki

  reply	other threads:[~2021-11-18 13:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  9:23 [PATCH] usb: typec: tcpm: fix tcpm unregister port but leave a pending timer Xu Yang
2021-11-18 13:18 ` Heikki Krogerus [this message]
2021-11-18 14:38   ` Guenter Roeck
2021-11-18 15:00   ` [EXT] " Xu Yang
2021-11-19  9:25     ` Heikki Krogerus
2021-11-22  5:14 Xu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZZSpffDfPd/CJDX@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).