Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2556219imu; Thu, 29 Nov 2018 06:51:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/UIzOuDgYya14zCS1hZuXJl5+wyrQW1cd7j7Q9siLEA5F5X81UtOgXBpyXuJXtbTXOymPMb X-Received: by 2002:a63:955a:: with SMTP id t26mr1475312pgn.449.1543503084547; Thu, 29 Nov 2018 06:51:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503084; cv=none; d=google.com; s=arc-20160816; b=JapcNCYBDCtZmjZA/J/+ULLtnPwOesyj5rnlCDFa27v4yTcMGkslLFsfV5EweFbMpv 0e5v487rVPrCqqiy8NJDtTrTpPDxczJ6nEAcK6LsDRa56z64ulZDwHWtyHWoX7+jVdxp T9WUeY1LfqiZfwJIpcak74HwczFdRxm1nqpucfES7755qrECD1ydeo0IQ+f6mvpAHvVo Ys+Jv8+G3fC+vRLi8vllx4UL+CGj2KopjhjBn7vNfTcfFW61Rvksp12XN78ZWN8V/1PE rC5VZYQtGriQw+0jorO2vmz1Rilrt7RmLDZgq+4sXBFnFh2xvferbQ3O/D6T2VdcN7eS jD4Q== 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=4u35d6Ca7zZqHDTLoB86UVjFAXqCdX4mb0M9IHVV/vY=; b=U43s9SEhsc2SNDhAUeqqDLDzsf8bLVyBB87dI6LBcQUT0QWF9g9q3mPREmQjNhyzuA rEGgDNfFqp5W7dUOWDjeeU/F4M3qnSixxj424B1BVZ0ie/LnAaLXT6AOE8+xHUPyTdzy GGNOmSHw69f+VM0t9WSUf9I/Fg68uIiEru8Xv6prMJLHny98texR64TcMQPdNAvO4Uke bBBI/yx1b/AfOAW+uzoc0hI1jmzzwBzukipsHOMzqjipUHa0mgQ4TobgDc1GXE4ergnN 4DWrhnWU27dGuygINSRx7Wxt2HsFmB4JnHLdmBIpWhFztLsWSV5iCrzQ5HbrXPPW+sVo kuOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j6QIAO6+; 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 b12si2198953plx.159.2018.11.29.06.51.09; Thu, 29 Nov 2018 06:51:24 -0800 (PST) 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=j6QIAO6+; 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 S1732902AbeK3Baq (ORCPT + 99 others); Thu, 29 Nov 2018 20:30:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:57950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731565AbeK3Bap (ORCPT ); Thu, 29 Nov 2018 20:30:45 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 288342133F; Thu, 29 Nov 2018 14:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501513; bh=u0Q1ayoPABneghGrH4jP8fv6P3JTegJuCx98nfWTu5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6QIAO6+WbqtPCajO4dhppLvpp8XRcZ7wphjtk/RZ8laLeS3/mmYNqF1wc6Y8eGdJ 6oahWWxpD0RuX/Nd6UUUpZz0abPQYXnCeAiT9DWypvVQi95v8bXd/TK84TQbUdqT5L xqHC3vEKlFj6bkXnL5Eo638sfj36B2khtWs8cIFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Mathias Nyman Subject: [PATCH 4.14 011/100] usb: xhci: fix timeout for transition from RExit to U0 Date: Thu, 29 Nov 2018 15:11:41 +0100 Message-Id: <20181129140059.920972828@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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: Aaron Ma commit a5baeaeabcca3244782a9b6382ebab6f8a58f583 upstream. This definition is used by msecs_to_jiffies in milliseconds. According to the comments, max rexit timeout should be 20ms. Align with the comments to properly calculate the delay. Verified on Sunrise Point-LP and Cannon Lake. Cc: stable@vger.kernel.org Signed-off-by: Aaron Ma Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 4 ++-- drivers/usb/host/xhci.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -941,7 +941,7 @@ static u32 xhci_get_port_status(struct u time_left = wait_for_completion_timeout( &bus_state->rexit_done[wIndex], msecs_to_jiffies( - XHCI_MAX_REXIT_TIMEOUT)); + XHCI_MAX_REXIT_TIMEOUT_MS)); spin_lock_irqsave(&xhci->lock, flags); if (time_left) { @@ -955,7 +955,7 @@ static u32 xhci_get_port_status(struct u } else { int port_status = readl(port_array[wIndex]); xhci_warn(xhci, "Port resume took longer than %i msec, port status = 0x%x\n", - XHCI_MAX_REXIT_TIMEOUT, + XHCI_MAX_REXIT_TIMEOUT_MS, port_status); status |= USB_PORT_STAT_SUSPEND; clear_bit(wIndex, &bus_state->rexit_ports); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1684,7 +1684,7 @@ struct xhci_bus_state { * It can take up to 20 ms to transition from RExit to U0 on the * Intel Lynx Point LP xHCI host. */ -#define XHCI_MAX_REXIT_TIMEOUT (20 * 1000) +#define XHCI_MAX_REXIT_TIMEOUT_MS 20 static inline unsigned int hcd_index(struct usb_hcd *hcd) {