Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2518746imu; Thu, 29 Nov 2018 06:19:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/VeClRn8jH5ftgpqRObobq8yc3YN0lFnKdfFKi0FsXQJPdo+9V6ykc/uy5xcCfsZaBkPQJp X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr1703798plp.180.1543501153039; Thu, 29 Nov 2018 06:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501153; cv=none; d=google.com; s=arc-20160816; b=ZQd7iXpsrNd36N0d0xQOWSmShj2V97WgaqAgGPD9CAi5EjW/rJOemN82RtU3gp15fn ZroBOK0OYEhC6CwnxxprlZtWlLACKDt/PzCaNmfJnt1QIF5hKy89SJppO5tEI1Tx2BJO wrphTgd9Aglb/rsP0PKm5nD6TsMYoVCn6K7GGdivYFK675gLCv/jZ6ZsK1jKGFmf3vnu dC14OiPHL0H5w998UsfqRzBR7jXWd6RmafDAbd3uQUtMdyxw6MhoxHU+QqRAFtOdwUQb c8qLf/lG70Idt2vh7dlhymBKfnfJeswBycKP1qeLE/0xZ02wep2/cBN1rjSVRSK+qWro y89Q== 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=9r7SOdHbHqUaGkIqlU8Ds7ZffMsviRRcoOmQapV1Hlo=; b=paOwZtfUO+3r+T1ndmPcs85M8HMfCSHiBZqlEyaOhtvhTOPtpTvOU98T5jZqL3Moxy 8Vhlh2hFB49aJjbWzsHqlSjIuQzx09rwQ9fOeJpi0MzQvfnGfx7Keao27cX0hLZtQScj IK/ZGMJ8hCSm4FFCcW/FecbtDme+j+X0MbQORbcnfpOvilZBO9TvobXkRZSVCMnx31XN SlmUG3pTVgU1SAdvaAh9OJbyLjJ+R8nt3xhot0JFU1gQ1sV/uOX7Dp1avd3cdjpU+HeI p8MOIJ3dOwDDui4qxqoDbgXaPo5JtfmZu6LFmM/5OfP1h24TeJt8l4j7HPX0ZlAIjFX3 MX6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=knBsaTQv; 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 205si2167417pfa.199.2018.11.29.06.18.57; Thu, 29 Nov 2018 06:19:13 -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=knBsaTQv; 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 S1730373AbeK3BWz (ORCPT + 99 others); Thu, 29 Nov 2018 20:22:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:44774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728439AbeK3BWy (ORCPT ); Thu, 29 Nov 2018 20:22:54 -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 88679205C9; Thu, 29 Nov 2018 14:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501044; bh=UujKH/KTcdDHbuZKSaBW3wq6gurLZGl/9UPQdOw5kOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=knBsaTQvTr/2i4v9d1XIK1/vS9/LNc3/EQlIhaA4MVeJKE+x3AOOdPUNxsf5YC3KS 7oL5GhfvkbTEdsszEoK3MuR/q4nlB3sAP1mClXsI5lRXzY8sERTzdaHHZuPXPe64hJ QSfSo4uK5CE4j9oDq2VJtho82Y8prKEu23vRTmrg= 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.4 02/86] usb: xhci: fix timeout for transition from RExit to U0 Date: Thu, 29 Nov 2018 15:11:27 +0100 Message-Id: <20181129140110.078417925@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140109.832117862@linuxfoundation.org> References: <20181129140109.832117862@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.4-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 @@ -790,7 +790,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) { @@ -804,7 +804,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 @@ -1490,7 +1490,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) {