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=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 658C9C43381 for ; Fri, 22 Mar 2019 18:20:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 372C221925 for ; Fri, 22 Mar 2019 18:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553278859; bh=bWQGa3gNSqfq3GqfGh+pHHqTM9cZ0P93K04WHFfMvt0=; h=Subject:To:From:Date:List-ID:From; b=OEjMSit/A4KoqyOZ1E9nHpxBeUZ9z5Toc+coFIeHayDAp57+uhj5mDeQqTuVgcBOs Fumrlnwljml/C978IR0cjMv2mXanWFy6ZZr3/P7c2f1Z2WV5Qj2tLpWip2nPG0BszU 0m8GkNnKjrTcoPKAeWmcVTyBinP/wR3Rg+tMrwgE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbfCVSU6 (ORCPT ); Fri, 22 Mar 2019 14:20:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfCVSU6 (ORCPT ); Fri, 22 Mar 2019 14:20:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B12F218FE; Fri, 22 Mar 2019 18:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553278857; bh=bWQGa3gNSqfq3GqfGh+pHHqTM9cZ0P93K04WHFfMvt0=; h=Subject:To:From:Date:From; b=1Hq9ojxdmG8egyi6bNklOTTUEkAjc91C551mw6sJ2xkiB1EoeApxjGidADw4JJjSb gW24HwJI3J6gPEtPR0+8QAC5OF1IlcecPVWImHC0RG+hYNTOT42P38BnqcqKoLQ6xf neIEG/hM5Z0yiKPlBOhu2DLmTfoLP8yuUX4JYelQ= Subject: patch "xhci: Fix port resume done detection for SS ports with LPM enabled" added to usb-linus To: mathias.nyman@linux.intel.com, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Fri, 22 Mar 2019 19:20:54 +0100 Message-ID: <1553278854176161@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled xhci: Fix port resume done detection for SS ports with LPM enabled to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 6cbcf596934c8e16d6288c7cc62dfb7ad8eadf15 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Fri, 22 Mar 2019 17:50:15 +0200 Subject: xhci: Fix port resume done detection for SS ports with LPM enabled A suspended SS port in U3 link state will go to U0 when resumed, but can almost immediately after that enter U1 or U2 link power save states before host controller driver reads the port status. Host controller driver only checks for U0 state, and might miss the finished resume, leaving flags unclear and skip notifying usb code of the wake. Add U1 and U2 to the possible link states when checking for finished port resume. Cc: stable Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 40fa25c4d041..9215a28dad40 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1647,10 +1647,13 @@ static void handle_port_status(struct xhci_hcd *xhci, } } - if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_U0 && - DEV_SUPERSPEED_ANY(portsc)) { + if ((portsc & PORT_PLC) && + DEV_SUPERSPEED_ANY(portsc) && + ((portsc & PORT_PLS_MASK) == XDEV_U0 || + (portsc & PORT_PLS_MASK) == XDEV_U1 || + (portsc & PORT_PLS_MASK) == XDEV_U2)) { xhci_dbg(xhci, "resume SS port %d finished\n", port_id); - /* We've just brought the device into U0 through either the + /* We've just brought the device into U0/1/2 through either the * Resume state after a device remote wakeup, or through the * U3Exit state after a host-initiated resume. If it's a device * initiated remote wake, don't pass up the link state change, -- 2.21.0