From patchwork Mon Jun 11 21:05:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Gupta X-Patchwork-Id: 10458837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B8976020F for ; Mon, 11 Jun 2018 21:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F17EA285CB for ; Mon, 11 Jun 2018 21:06:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E354E285DA; Mon, 11 Jun 2018 21:06:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 914F6285CB for ; Mon, 11 Jun 2018 21:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933382AbeFKVG1 (ORCPT ); Mon, 11 Jun 2018 17:06:27 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:43686 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933204AbeFKVG0 (ORCPT ); Mon, 11 Jun 2018 17:06:26 -0400 Received: by mail-pl0-f68.google.com with SMTP id c41-v6so13019135plj.10 for ; Mon, 11 Jun 2018 14:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cyKJKcxphrq/oSguHzAne9tvV3WVe9BvjkVBdn4FRBE=; b=cex4AK6gu7V9sqQxqAB7XRK7EF0PiacULOxbOckUWkdj/xZzwEdBwfiNLFHMEKFGsl PgMdFJQZ45PoHyiKDmS24SB6PhrlcKxzePDmPCd5g7+cSaxZwUs5HV9ZTKb4JORj1Yp9 F8fWarNMStgsYp75NvyM/K0Mz0tuPbMV/xcdDAnzMUuA5TW33YijZAufu9P/Luv+H46c 79hOEcmX2s/AOcCaKTluS/I2LGe9f9DR/BcvPkbvFrDgOZR0eJynTy8nqls8jh5x8YPn QxP7NRi6hiov2j8TWF+tLenJ80p6ltjddyw5W7glC9yst/o1kyrO4E1zzT3sOF16P8Le KOcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cyKJKcxphrq/oSguHzAne9tvV3WVe9BvjkVBdn4FRBE=; b=byNGILjM5iOgeOuWKvUgqlCtKINXV2zj6g8PTGf0DrmjVlZdVrDJzx1tyHyeGjqDJg 4fOrFV7rbLAo1Q74Cuaw1tWgh584F9CfpSGa2ECTSaXYAVrJrVbd6Zdt66lImhwv4r0x gl6j/+1WEA2gpYPGk5IwhD9UFvrmGFZEDMNLoJ6LKoYciHNGuQTmEDH2t4rgFCtfkgJL KPfH5V39fV6gqdNCyW98mxoIXJhJMeTHKcfbG2xGdDBJ/AOle4tg5qPIzCzmQL+euDO3 58zODBwWVmv9D96spPrLEgRa+B7rhTD441PVkqdHaGJCrztxHJo2rEE0w9v2e4n4NJOO 3WLw== X-Gm-Message-State: APt69E2EgYuGY+9GSzW4siBMXd+tvn36sbU1qZiNp3NbyRZzG8iFX3/W TDwsyj3pHee+yqvSn4mW83Kpcw== X-Google-Smtp-Source: ADUXVKL0lRHR+ywTklhVgD9NbVhONix8x2w2bOqS1/y5nU2IfYvK0Ne/HxqQ6f01PrqBsyDuan51Wg== X-Received: by 2002:a17:902:42e4:: with SMTP id h91-v6mr791807pld.27.1528751185783; Mon, 11 Jun 2018 14:06:25 -0700 (PDT) Received: from ajayg.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id r3-v6sm35386444pfl.162.2018.06.11.14.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 14:06:24 -0700 (PDT) From: Ajay Gupta To: linux-usb@vger.kernel.org Cc: felipe.balbi@linux.intel.com, oneukum@suse.com, mathias.nyman@linux.intel.com, Ajay Gupta , Nagaraj Annaiah Subject: [PATCH v2] usb: xhci: increase CRS timeout value Date: Mon, 11 Jun 2018 14:05:33 -0700 Message-Id: <1528751133-12402-1-git-send-email-ajaykuee@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some controllers take almost 55ms to complete controller restore state (CRS). There is no timeout limit mentioned in xhci specification so fixing the issue by increasing the timeout limit to 55ms Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah --- drivers/usb/host/xhci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8c8da2d..fa7bd71 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1043,8 +1043,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) command = readl(&xhci->op_regs->command); command |= CMD_CRS; writel(command, &xhci->op_regs->command); + /* Some controllers take upto 55+ ms to complete + * the controller restore so setting the timeout to + * 100ms. Xhci specification doesn't mention any + * timeout value. + */ if (xhci_handshake(&xhci->op_regs->status, - STS_RESTORE, 0, 10 * 1000)) { + STS_RESTORE, 0, 100 * 1000)) { xhci_warn(xhci, "WARN: xHC restore state timeout\n"); spin_unlock_irq(&xhci->lock); return -ETIMEDOUT;