From patchwork Mon Jun 11 21:10:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Gupta X-Patchwork-Id: 10458853 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 1B5C2601A0 for ; Mon, 11 Jun 2018 21:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E172859A for ; Mon, 11 Jun 2018 21:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBAA7285CB; Mon, 11 Jun 2018 21:10:40 +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 970B82859A for ; Mon, 11 Jun 2018 21:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934324AbeFKVKi (ORCPT ); Mon, 11 Jun 2018 17:10:38 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34237 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934322AbeFKVKf (ORCPT ); Mon, 11 Jun 2018 17:10:35 -0400 Received: by mail-pf0-f196.google.com with SMTP id a63-v6so10894378pfl.1 for ; Mon, 11 Jun 2018 14:10:35 -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=8nqyND6DKXZOocJ4tcQ+6GwhuL8zEli2MD/F15otJmo=; b=RfiVldKGtBhK57SKKRSHx8VrLVQ8ucEI9IzUeBtPSlp5h6UFxqB59Ll74vvdu4bkvr vNt1we87QTkgrxqPZbfB99JFkCFBUNJaSSITlbrsqv0pHAgwKdqyt+S8ev08Re8C74jA u49y4oWvZ86Omamz49N/QRjrcCHZH72J9oa/2WpHVXIs9BQYaFFydxqQ8TSXx5+h16zw u4jm4A43LKzoJma3o/5WkMbr/dJ6qI/HpUCQvzESdnjzD73jV8ci/mWKVyh7ErpDDpQg Umvzic8b9OSQojNUTW4N5XDFKjya4nbDqZOUwCtIMqcnQp6G88G85LomGVpz5cil4jXR uKbg== 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=8nqyND6DKXZOocJ4tcQ+6GwhuL8zEli2MD/F15otJmo=; b=DxG4rCmWgGVG00TkfN+TXsVp6pDtigdn7gcQfpIoFagZDkSOQ5xKT4njLZ0Pnj25gp w0z+IYOFgEyJgk2cFVx/VatKZISsjZS0hl6EPdS/U2ka58wblzDSsrFyJiI+zZ39N985 Ecm6Y/cribWLtsE40U03wk90tt1na5ufZx/+lF8qJ7f9VgyIU8+tdKkmGwZQ2QGRUxJO 3hC3Wm8uA3PqDNA7jBZeE84kj2EQ0QOeKF/X8+tcXVBeETeJJnuLFhO2uBVcKqx0i5LR 4Z/ONctxrX4J+T3e8SF8dyCmsz1QabGE1ECcoefFz/c++2edDkhdcPq8g/NDSXxWEL7Z URLA== X-Gm-Message-State: APt69E0lVzhFtWg/jOjrJBNWiXx8LZNE+ViCycnHhbxVXC8ua1Fj2Pbk 6KKwTjHOt8w7Uu/UWL8Mg/mqfQ== X-Google-Smtp-Source: ADUXVKIAfgaX0ek/t0nBKtlacye32VBPomIqfFd4jI1lMTPn1ayofHWeEML9qFKHSjxf2MF//v8oOw== X-Received: by 2002:a62:8d5:: with SMTP id 82-v6mr810095pfi.154.1528751434565; Mon, 11 Jun 2018 14:10:34 -0700 (PDT) Received: from ajayg.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id z26-v6sm2582084pfd.60.2018.06.11.14.10.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 14:10:33 -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 v3] usb: xhci: increase CRS timeout value Date: Mon, 11 Jun 2018 14:10:23 -0700 Message-Id: <1528751423-12463-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 100ms Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah --- Changes from v2->v3 Updated commit message for timeout value to 100ms Changes from v1->v2 Updated timeout value from 55 to 100ms and added a comment. 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;