linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"Gustavo A . R . Silva" <gustavoars@kernel.org>,
	Bixuan Cui <cuibixuan@huawei.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>,
	Oliver Neukum <oneukum@suse.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Tianping Fang <tianping.fang@mediatek.com>,
	Eddie Hung <eddie.hung@mediatek.com>,
	Ikjoon Jang <ikjn@chromium.org>
Subject: Re: [PATCH] usb: core: hub: fix race condition about TRSMRCY of resume
Date: Tue, 11 May 2021 12:39:07 -0400	[thread overview]
Message-ID: <20210511163907.GB901897@rowland.harvard.edu> (raw)
In-Reply-To: <20210511101522.34193-1-chunfeng.yun@mediatek.com>

On Tue, May 11, 2021 at 06:15:22PM +0800, Chunfeng Yun wrote:
> This may happen if the port becomes resume status exactly
> when usb_port_resume() gets port status, it still need provide
> a TRSMCRY time before access the device.
> 
> Reported-by: Tianping Fang <tianping.fang@mediatek.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

This should also say:

CC: <stable@vger.kernel.org>

> ---
>  drivers/usb/core/hub.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index b2bc4b7c4289..fc7d6cdacf16 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -3642,9 +3642,6 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
>  		 * sequence.
>  		 */
>  		status = hub_port_status(hub, port1, &portstatus, &portchange);
> -
> -		/* TRSMRCY = 10 msec */
> -		msleep(10);
>  	}
>  
>   SuspendCleared:
> @@ -3659,6 +3656,9 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
>  				usb_clear_port_feature(hub->hdev, port1,
>  						USB_PORT_FEAT_C_SUSPEND);
>  		}
> +
> +		/* TRSMRCY = 10 msec */
> +		msleep(10);
>  	}
>  
>  	if (udev->persist_enabled)

Acked-by: Alan Stern <stern@rowland.harvard.edu>

  parent reply	other threads:[~2021-05-11 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 10:15 [PATCH] usb: core: hub: fix race condition about TRSMRCY of resume Chunfeng Yun
2021-05-11 11:27 ` Greg Kroah-Hartman
2021-05-12  2:02   ` Chunfeng Yun
2021-05-11 16:39 ` Alan Stern [this message]
2021-05-12  2:03   ` Chunfeng Yun

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=20210511163907.GB901897@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=cuibixuan@huawei.com \
    --cc=eddie.hung@mediatek.com \
    --cc=erosca@de.adit-jv.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=ikjn@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=oneukum@suse.com \
    --cc=tianping.fang@mediatek.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).