Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp494894yba; Mon, 1 Apr 2019 10:26:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdLvkUyKME72epwwRjhn5whyK5U4/ghhND89Skto4pOBrrXryAXk2l0ZBvLodPufH8Ty+i X-Received: by 2002:a62:1795:: with SMTP id 143mr28693023pfx.104.1554139562012; Mon, 01 Apr 2019 10:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554139562; cv=none; d=google.com; s=arc-20160816; b=fpqQkiCN0ajnGPpQBrrIMaPlB0pFCHUgKVZV1Pm79488F8C78y5ZipY6j+Sgb8eRTJ DcHG0Svuy9x2CrZ8o6j14IVZhkZMpaE8Kno6lToVdshgOvF4XYo4Lu7MJpM+90Zu9KSQ 5Lz8FRHffdLMyQySMghAsT3aQwwfBBQmx8mSJN/HpWSSExC5KmqY8kFqtVDSvF/8Syhz sXIh7Rfn01cMeQrMojivCdyBZ1zdMdJqKrPEPu76JZrP1GY+dWg3rQ3KYd+8xzvdRYvP 8gfAUCGW5kWOcMBjR01SE05ne3zcB21FKj3OdKYOB49V6tXfKeSjYjM2iBOiWNLj5NsE iwLg== 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=xBkofqR061coEb0OV1EIOIqpkNEmrGQwIikx1KteTC4=; b=uBadkp72o0OGu+kFGrIrGfwWpq28lYZLyATKpf17+eiNru5PVoEAaAVt9b+rcbqFsU 1tTJ4Q2kbsnZIsI9h3/OQ3yjAtZHAAVjA+CBOpsZify2YsABh8snW+0yJZgMYJdxEBsH mvJIl5vwcjU38exqNQ40knnCk7NDRWecRCcZwnPujbdJztbJm1+sJti2eg45mBI16iJF hbaork/ESCYYC35p2E19sN8RFIaA35uHdE9Q09gYuW/gxfdaF64dRnoxHu0jYcAM67h8 UJgPIdTl55c9WcR4kLGVvLAWhylVtJ7OkbBaBdpxOk3ugDXZyFi4Alxs7XW7tkvuELTy B5yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Psyy67lF; 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 i6si9095346pgj.329.2019.04.01.10.25.46; Mon, 01 Apr 2019 10:26:01 -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=Psyy67lF; 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 S1732385AbfDARZP (ORCPT + 99 others); Mon, 1 Apr 2019 13:25:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:56312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732375AbfDARZL (ORCPT ); Mon, 1 Apr 2019 13:25:11 -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 B16EB2063F; Mon, 1 Apr 2019 17:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139511; bh=8ebogR0Z3ID+Se4Pt6H+47iKyXH7mk/ZCLZWecyzYL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Psyy67lFzNlLPw4lZ4t20xpmQzYgSB3Bei+oYKG4ILJaqnoZPDQTOElkALg1STEYn rzgRpP8EE0ePBAqgPD7FvEQpBHKx4rdw2i52yg4/P2CPqaZD1RSJzBCEeZ1tLsc2+k SifUop06rVeisp+u7NVkP3lq3FNZHboWXfKaidfg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 4.14 098/107] xhci: Fix port resume done detection for SS ports with LPM enabled Date: Mon, 1 Apr 2019 19:02:53 +0200 Message-Id: <20190401170054.605540289@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170045.246405031@linuxfoundation.org> References: <20190401170045.246405031@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.14-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 @@ -1715,10 +1715,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,