From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31B00C433B4 for ; Tue, 11 May 2021 16:39:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA42261919 for ; Tue, 11 May 2021 16:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231459AbhEKQkP (ORCPT ); Tue, 11 May 2021 12:40:15 -0400 Received: from netrider.rowland.org ([192.131.102.5]:35313 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S230435AbhEKQkO (ORCPT ); Tue, 11 May 2021 12:40:14 -0400 Received: (qmail 903532 invoked by uid 1000); 11 May 2021 12:39:07 -0400 Date: Tue, 11 May 2021 12:39:07 -0400 From: Alan Stern To: Chunfeng Yun Cc: Greg Kroah-Hartman , Matthias Brugger , Thinh Nguyen , "Gustavo A . R . Silva" , Bixuan Cui , Eugeniu Rosca , Oliver Neukum , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Tianping Fang , Eddie Hung , Ikjoon Jang Subject: Re: [PATCH] usb: core: hub: fix race condition about TRSMRCY of resume Message-ID: <20210511163907.GB901897@rowland.harvard.edu> References: <20210511101522.34193-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511101522.34193-1-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Chunfeng Yun This should also say: CC: > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D272AC433ED for ; Tue, 11 May 2021 16:56:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58043616ED for ; Tue, 11 May 2021 16:55:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58043616ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HRwWRsBAxckHh28yEM0HkpxnOFqlm011IkUNR0i0PBM=; b=SoVjvlXfpektwejGL7NRULXCH FBXEMqtY9R2zmImy8pF2iUUSV6ASdJbnLD+8QGKUuJl76SAaKQAjiz12BhjiPMMY2a2FOMQLePnco hPysXJtIdXoh0xrgB042hejBHJAurPXZZJo/uBRzT6L3bAAfRmpzvxgNgw1KasubtDJE5G8HKt9/r kYYZK+F8VZqsnFkzEsdxtNHgJzsTPoC91PoYCERqOxzA5umPZVRr5vKdC0zGS5QOfLecjqCGNvWmR nLExE/nn2+1t843exgdUytSv8NDvfzGUZXgO3q+10jMU7SWrGhXgwKhPxEUZfYi3g8ZGC0UbngYKx ldu56jSRQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgVfa-000ptF-Kg; Tue, 11 May 2021 16:55:42 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgVW4-000npL-BP for linux-mediatek@desiato.infradead.org; Tue, 11 May 2021 16:45:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SJ3MbO1yvX0ZTNillbrfw38Ym88fvu4TdFvFicMqacY=; b=CKTvzloMMIYCD0LBDfttwKDaG4 Vm9vpM4qvGtU7OQr7/9Klq3qBOcs7TSdMNJ14He8jtKec20UtiOvpJGH0P9jdTk4JqKi45lIjXGWK HOO5Rmv42obUxO5JWE+MD42py79OsUHOjckhXgOEPuU0kqBiepsHlVLO9I5AoRvPjijok7E3rMwcl XCxBUtlbhEJPS49R4AQtrZVk0D36JBIZXMwDzHy7JFcm8nCIK5LPMqKSnGzAFvMsCiS2zMdPp1C70 k8mq6gSBFIXQJR58fT6YWf68KEOEB36qA7N1a0SWAkNpK24vdq8k4Ob119swafkzgX/tb8i4ZFB1P 43/tnLIg==; Received: from netrider.rowland.org ([192.131.102.5]) by bombadil.infradead.org with smtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgVW1-009mNH-9M for linux-mediatek@lists.infradead.org; Tue, 11 May 2021 16:45:50 +0000 Received: (qmail 903532 invoked by uid 1000); 11 May 2021 12:39:07 -0400 Date: Tue, 11 May 2021 12:39:07 -0400 From: Alan Stern To: Chunfeng Yun Cc: Greg Kroah-Hartman , Matthias Brugger , Thinh Nguyen , "Gustavo A . R . Silva" , Bixuan Cui , Eugeniu Rosca , Oliver Neukum , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Tianping Fang , Eddie Hung , Ikjoon Jang Subject: Re: [PATCH] usb: core: hub: fix race condition about TRSMRCY of resume Message-ID: <20210511163907.GB901897@rowland.harvard.edu> References: <20210511101522.34193-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210511101522.34193-1-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_094549_481827_203604B8 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Chunfeng Yun This should also say: CC: > --- > 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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04DE2C433B4 for ; Tue, 11 May 2021 16:52:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87AE561260 for ; Tue, 11 May 2021 16:52:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87AE561260 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P5kimoQLl5cIwz7V6FxoXyNoDcyrDdmStuRBn34Sf74=; b=HsJd0RkplPpO8c7icO+BwY1AN ld5HV/w5Gr3qwAW7gH0IDNvNNQ+jHPIScoZVucU7ZhDgfGgh427BRw6RRRvEeReLsnC2x/L7Jw/02 H24L1jjL+Ezlg0VkwCiUHIByHMiNccFV1/hjle8mzQ3suU7IxKKEcZbv2hE5/ZYCbEoLE3eT2UbfV JdgXkOKOKCeuXjE9V7aMtyT3JnHV7Px1GPTIFbXQRh6DeQpEuaxc6XZKn6LbYMvZ2btaEpPSCjhKI 2OhXKZmct20rdFwKMB/3IRifV+Ui8SY0SS1Os2Gky/QYPh+q2de2qdMmFs186310vlZuS/UEN6n1O HzAzONwVQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgVaI-000ovv-4W; Tue, 11 May 2021 16:50:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgVPr-000mDT-8V for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 16:39:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SJ3MbO1yvX0ZTNillbrfw38Ym88fvu4TdFvFicMqacY=; b=CKTvzloMMIYCD0LBDfttwKDaG4 Vm9vpM4qvGtU7OQr7/9Klq3qBOcs7TSdMNJ14He8jtKec20UtiOvpJGH0P9jdTk4JqKi45lIjXGWK HOO5Rmv42obUxO5JWE+MD42py79OsUHOjckhXgOEPuU0kqBiepsHlVLO9I5AoRvPjijok7E3rMwcl XCxBUtlbhEJPS49R4AQtrZVk0D36JBIZXMwDzHy7JFcm8nCIK5LPMqKSnGzAFvMsCiS2zMdPp1C70 k8mq6gSBFIXQJR58fT6YWf68KEOEB36qA7N1a0SWAkNpK24vdq8k4Ob119swafkzgX/tb8i4ZFB1P 43/tnLIg==; Received: from netrider.rowland.org ([192.131.102.5]) by bombadil.infradead.org with smtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgVPn-009m1l-UZ for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 16:39:25 +0000 Received: (qmail 903532 invoked by uid 1000); 11 May 2021 12:39:07 -0400 Date: Tue, 11 May 2021 12:39:07 -0400 From: Alan Stern To: Chunfeng Yun Cc: Greg Kroah-Hartman , Matthias Brugger , Thinh Nguyen , "Gustavo A . R . Silva" , Bixuan Cui , Eugeniu Rosca , Oliver Neukum , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Tianping Fang , Eddie Hung , Ikjoon Jang Subject: Re: [PATCH] usb: core: hub: fix race condition about TRSMRCY of resume Message-ID: <20210511163907.GB901897@rowland.harvard.edu> References: <20210511101522.34193-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210511101522.34193-1-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_093924_170754_400E97DF X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Chunfeng Yun This should also say: CC: > --- > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel