Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp521585yba; Mon, 1 Apr 2019 10:59:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqydnO/ScmrXtwZGBaiDHRD7xKv9IjF5y3igrUXvCEHJ29tdunFZ+T3oyx68RQqho/NqdKBu X-Received: by 2002:a63:e20b:: with SMTP id q11mr6026101pgh.263.1554141598260; Mon, 01 Apr 2019 10:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554141598; cv=none; d=google.com; s=arc-20160816; b=p7SzkznV+dCYExfN74sh0u9hzXgYmd7RR+xpRp/p7CI1oSKcNNdwkRBE3ZdbpEQjVX sGcs2nN0ctruhih5erF1FqFCpjI7SETAhv0NXpKN+D1BCUtOtYrFkgZqUmzbOy45Eeoo L5HcrHAtdu5GV38dOldx0bU5fPB8o5Eh6AR7P1755xByc2zWEL8cvXbQSgwZi5nIugwv RNXkR5d1dzC+Ajjd8/COSR3yBhAGLkA+aYifaD77N7tyi+hG+PgrW/dUQQe0lOlntq7q nCv3zE0Xx8vGZux4i40spiSbOERYVvTv7HXZje8q8HprFeBB0D9xYd+rgyzGdyIyzcLN SHsw== 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=tuAcflcUr3Ln3QtA9JbAmWylnCk2JhuroKp/w1EA9BM=; b=ioChN0nR+1NZu7uFvnz7Thnx3+i7SAtKRZ5bWSkMk5fZ3lqUrAMH8Dh2pUbqL93XvI lS8zDVv7BFU7WUwDVkZ6Fg8M+vM/0Y/T2yDzh+A9KDLqUFOEPJZTnMm/z9PuH4gPRdp5 7hcOMnnJYXqzVjjSD/l28++hjKZ0ODLswB9p88KOXwugLkeOfIVR59GwtEDV9DCl5VTu 9GsLbk6O3DmfjWe9cyuT2Mlz7TWsBa+HUugCfYVDiUw0PbJRLHwpGCEK8SfcuELj51rv 4OeL8mxmKyEVOgrD73k+GeC7xs1BSqT+/SM74OGYOPIKGJFmT+yp1x0PCUeAu+rbmopr MeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Pn+Koog6; 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 31si9328336plg.364.2019.04.01.10.59.42; Mon, 01 Apr 2019 10:59:58 -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=Pn+Koog6; 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 S1731505AbfDAR7L (ORCPT + 99 others); Mon, 1 Apr 2019 13:59:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:44846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731304AbfDARSD (ORCPT ); Mon, 1 Apr 2019 13:18:03 -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 88205206C0; Mon, 1 Apr 2019 17:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139083; bh=hk9qZc9ScoNa154aFYHFblnRewOJP7e6Bxz6USbBByg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pn+Koog6FzG9SiodsX4zc2k3wBju9sS45rdwuJtbDgXWyEhz3PiDzKBnE5wvBu0QV Thp0vQ4Lgfq/O4RhaF9Wcxj0gjmrqrTobIAc4V5KJDQKuwD1hY2D7ssz5k2ORLdSh7 /rJT92QDv1QAMeJOlEltJs95xCmZcMpJdhhL9EdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 4.19 107/134] xhci: Fix port resume done detection for SS ports with LPM enabled Date: Mon, 1 Apr 2019 19:02:23 +0200 Message-Id: <20190401170054.221630835@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170044.243719205@linuxfoundation.org> References: <20190401170044.243719205@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 4.19-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 @@ -1643,10 +1643,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,