Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2562561imu; Thu, 29 Nov 2018 06:57:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPwQy/2xv+pZM5qoIdPNQED1rtC3ekv59r5mejMRm4+v3+gzbFuzDN7m+R8TnQNDkD6eAW X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr1127112plb.0.1543503462660; Thu, 29 Nov 2018 06:57:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503462; cv=none; d=google.com; s=arc-20160816; b=SiAbRcL9gXuOL1/krFHHIKq8/lwPWAaVgn/pON6poc0QdSry5KqAjt2eTHAGkmuKlZ /6ya5FmSAdwIhdsmP7Z2nl1mQ63glVJz5MTQwIinfnoFCY3vNIyOgQblb8j37nbFluri +D3kc57f94S8vAXHm5CS3Uhp6chLM7NLh4u63gzyxBjNeksrJi3u8pyPFtltYUHWfW/6 qQLQRCxmFs5UkKLM2tmM39bD/vZvMutQ/vKqbXpWMEIrwcwdIWpjjNRpZD4PFRn09q0F K7SD/lxCdiT4OJL1YOIO1J5lGXBZL/SWGsWoswSl5tkHMQLST1Iw+R7YJJvGRlNyoVGz feTQ== 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=pGvrBekd41mblFiQe8HZS6lfwgUdtJx7oyclEXgQN4A=; b=SMJaK0hUyv6kOprHan/71LHqS37dS3KKu9/BWNcN2dNGD519BwvrpcOP+uNdT6lwJU 2lSSyw5VMBWMHNB49AdwFMwCHzzGIiPeisDU1+zjmQIVCTloheEA9b/+LiRjB+GeTA6p 0Zr279/odLsjNBs1sKagNL7MzK6Fpe2jYex4Wn6XKmJQ7lcKeoCndSdf/GF63h8oAry/ gelVLGfYNK02S7DpNrOE42DYhUN3XoRa3Wqrk78leyHARBqMJVpFhpQjXHTxBaganGf7 XAQQa6bnGfudmU7iNlpDsQTiNShrlMyZjQ4ILhD5SQHDD1fOkP7+dQg934uvpudF133G J2LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="nn5S/NfT"; 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 f95si2508308plb.60.2018.11.29.06.57.28; Thu, 29 Nov 2018 06:57:42 -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="nn5S/NfT"; 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 S1731564AbeK3B0j (ORCPT + 99 others); Thu, 29 Nov 2018 20:26:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:50784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730509AbeK3B0i (ORCPT ); Thu, 29 Nov 2018 20:26:38 -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 D2BE920868; Thu, 29 Nov 2018 14:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501267; bh=hSaiE+dQSKV7kIRS2TB1lTqdEroUIQgJWUp/Fj+gjO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nn5S/NfTwo4fhRtAVfslcVuE77R8FtDdDPKLeJEdA1Aa8o4DAk5NMPOB7byVo8OGo LpKo1erKnQkyXnKNn0oLksYndJ+9O81cz8JOXqB7xJmoT5CBsBFWr5kxgQ+aQ2bk2O Fp0KX3mCn5GQPlOt/it19j4o1i8tZE6+dpXnRBWU= 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.9 03/92] usb: xhci: fix timeout for transition from RExit to U0 Date: Thu, 29 Nov 2018 15:11:32 +0100 Message-Id: <20181129140106.775387034@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140106.520639693@linuxfoundation.org> References: <20181129140106.520639693@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.9-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 @@ -814,7 +814,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) { @@ -828,7 +828,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 @@ -1509,7 +1509,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) {