Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp484377yba; Mon, 1 Apr 2019 10:13:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAlZG8Rmqe+GZIqSILym/SG8aXB4fH+14asMoAO8MgafLWUHj5028ASMEFKfAkrYyWxst1 X-Received: by 2002:a17:902:2aa6:: with SMTP id j35mr64902876plb.56.1554138795463; Mon, 01 Apr 2019 10:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554138795; cv=none; d=google.com; s=arc-20160816; b=VIsMP6g3bo8y/H45LfPhhNCyqVGyygrxkrR02GqdEBnlDgQeMUyfMgUjiq3S2SAkK/ MaUBh34EfN+4Il2jAB3t/9IC/Ij9AF99UXca5mdPWySTexMa2Gtb938uLKzJ0K/PpUB9 YKmC2XtXdG8DCjZjR7zMQ0zDwTauHHadhsiVk5JObm9f/wzl2og/sUE8XL0+yQaNzpdA FLZ9l2oCA24FWxK/gQopaiMeayGFyNbqXAUHFqNxyi9UqqO5ihahAySlkK6vGByxFhyv NVhLnmtdbhMKNP1ppRhIwX53Chb71G0KoDTx1Av9oUg2VPsAPFMUl3KAjtrFT3itRSu6 qtxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=InfApvaxAX9N/Gl588V1DLyV59EZeO+JXQlBdM+FIBQ=; b=q4mNZrph368YELepggPZKsRy9me57kCB0PTUOBXUm1+uhWoG0PrbJuPOJx2bXigi31 WY2NYYJbQNOegf4aOQvKIbjp6GcARsuZ5L+cUJzL+PtXRnOlasYK/hQxr/rDSl0It4ei 6ZliTQmNuXL+8idlrSMKB0BZSQVTznmkyy0Ov+ep+cZNiZiCznnH/xohblXaqjNNACSw Y5T3EXcMSKl+nxzqjveTC8OFagwasVe4nOeXG1hyrBQ84WKsYzTit2qVlUP5ms431oA1 hbY9ZVoFhvkRogXdgUaEfmMixdFHJl8OVvfo4kHprdcu8gxnxaodJMnYkDz6GitQ0TkO gFqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lGMyHKDQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cv8si9956141plb.326.2019.04.01.10.12.59; Mon, 01 Apr 2019 10:13:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lGMyHKDQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729954AbfDARKY (ORCPT + 99 others); Mon, 1 Apr 2019 13:10:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:58006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729623AbfDARKX (ORCPT ); Mon, 1 Apr 2019 13:10:23 -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 94EB021934; Mon, 1 Apr 2019 17:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554138623; bh=hZEF/XpQxB8c103hka6bCROhwDi4CdbJXnz98wFuARE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGMyHKDQwVVDwDerj9/S38XoFGKi0gY3AjfC3L94LnKiVnVyXYIY4Y3/B+xVEmOen Vet9kjCuXWcafETRq/TaXBRBVYIfDXTArBjn0KD07V7iqjH/89VHCqMIeRtsvCz4Qm YnJng12xXmwb9GhfjmlRUsmGtuXaYWEHh9z0UOTY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 5.0 119/146] xhci: Fix port resume done detection for SS ports with LPM enabled Date: Mon, 1 Apr 2019 19:02:11 +0200 Message-Id: <20190401170058.423961572@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170048.449559024@linuxfoundation.org> References: <20190401170048.449559024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Nyman commit 6cbcf596934c8e16d6288c7cc62dfb7ad8eadf15 upstream. 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(-) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1647,10 +1647,13 @@ static void handle_port_status(struct xh } } - 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,