Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1673223pxj; Wed, 19 May 2021 11:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgVRmFtmkSw43ULs7lDbpreHXgnUnotBTr4ujjUd0uUa483F4d6wjtozLW/z+gpzjnL9Ps X-Received: by 2002:a17:906:4089:: with SMTP id u9mr451295ejj.18.1621447727190; Wed, 19 May 2021 11:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447727; cv=none; d=google.com; s=arc-20160816; b=qh4WsuMQTGFT1x91x7Z1lN8/wpQyfrU7LirS8QXL/wbQNE2gpUdbdgLBheyLjdRTF6 oFDSwoAK7qfNp/JAkFxOytsVD2qBWJ0vqqK7iq1SCDVK+OBfZU9NrWWS2d4yxdslafDw MiyjdhuDP89ZayHjBCQYyMSIKwFRwRhpBomc0mVw8LKiarQxMx3d3uriD9TLPwBWmyFp h1V7mJLYf/eo30KN9Ady5/JN5NkvmjGZhJekeL0dwPPmkFqnzcrXIdwJV1FRKXijiBlI /8aKbL0QApmD0c8xWkK9s2hTVY3hkPzqCrcFyzGzMewsDA8gBeUFblw//cpxIrC0FaCy 3HjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tx9LU5o9jAhb+IFA4JJT+cH3DFIRGJA++2PvkEKicgc=; b=Yr8FzuJLhdmp7vBi49muZcgkMC/QPzcgYBZ7ACS12WSH6rqHfL8hYePoY5k0Ayp6Qq UOFKhp5FBEC9dZFd1xSYSxFY8U7owgQTC8lRqJGljwqrzHYz3vnlaUnyc3rOblvpbFTT PKMOT/zJ9KVSg+MkQEUgZ21T3igDCphPAxUz+ruXD0F4KKU7o1UFjx9P9BB6WTXR3lg7 oMdRFXodfeownuIca2DYLWI43707eDRiqPzFO4SPV7zEpan8+muifuir6bCdyA2uflT/ 4FBpeFbednr6d3nXTUfm/2RVQ3r/xaaDZxosCuuf4021/4hTtCZp4IE9nevahJ59pWz2 QUIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si421382ejc.46.2021.05.19.11.08.23; Wed, 19 May 2021 11:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349252AbhERMhW (ORCPT + 99 others); Tue, 18 May 2021 08:37:22 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48118 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349241AbhERMhS (ORCPT ); Tue, 18 May 2021 08:37:18 -0400 Received: from mail-lj1-f197.google.com ([209.85.208.197]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1liyx5-0002c9-GW for linux-kernel@vger.kernel.org; Tue, 18 May 2021 12:35:59 +0000 Received: by mail-lj1-f197.google.com with SMTP id b13-20020a05651c032db02900cf5cc3941eso4493605ljp.0 for ; Tue, 18 May 2021 05:35:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tx9LU5o9jAhb+IFA4JJT+cH3DFIRGJA++2PvkEKicgc=; b=YQNBgicUZtIqSjUDqllpKuHewYGtm7XgtEHLi5cvM5L3s2Hp8RHIwCYdPl+kUdTD6d LvV+JwOe6EcVosh4NztQQ0fF6zTi8rsw89wxB2aKZO29AKor9u3EayT1Z2ocqR4BWpzR lJaBugVwC+dK56WxJso87EUBKn3xsq3MqvAFF25dqLNK6cNGRlGguKEeqwvEwKnJ1xe1 rT0BzXGSH3uCz0LA/YWL7zcDLuvrOOvs0fEzoAIItX3sMc0fBCENcn6MGq1AUYdKr9pq FcDSoKKtRUKx1fH9MqUmE9QT8vvakSHicQGKt36ZwEqUCYH7kfzYmlggq/tsqblC4pD4 rr6w== X-Gm-Message-State: AOAM530Le80FwHW13jcbolMHDRgnLSXq9X7TBW3QgUvUu9GAng+BGQg3 hRSZS9aGUzWb0v5vVePvt7rQOp9A8cqbVMzUFB5HowgboqF7vJ646eJEigrYAITFMgySiYSM4Aa iSVVzF71Q4uWyEjYLIEFx4P2DcgihiTxF0t0dYKsE7H+Uoz4tEOdZRE8Lew== X-Received: by 2002:a2e:6e13:: with SMTP id j19mr3932590ljc.116.1621341358976; Tue, 18 May 2021 05:35:58 -0700 (PDT) X-Received: by 2002:a2e:6e13:: with SMTP id j19mr3932572ljc.116.1621341358636; Tue, 18 May 2021 05:35:58 -0700 (PDT) MIME-Version: 1.0 References: <20210518111640.243559-1-kai.heng.feng@canonical.com> In-Reply-To: From: Kai-Heng Feng Date: Tue, 18 May 2021 20:35:45 +0800 Message-ID: Subject: Re: [PATCH] xhci: State explicitly when the controller is inaccessible To: Mathias Nyman Cc: Mathias Nyman , Greg Kroah-Hartman , "open list:USB XHCI DRIVER" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 8:19 PM Mathias Nyman wrote: > > On 18.5.2021 14.16, Kai-Heng Feng wrote: > > Sometimes the dmesg says "Controller not ready at resume" because CNR is > > flagged. But what actually happens is that the whole USBSTS becomes > > inaccessible, and the reason could be disabled PCI I/O space or faulty > > firmware/hardware. > > > > So state the reason explicitly to make the message more clear. > > > > Signed-off-by: Kai-Heng Feng > > --- > > drivers/usb/host/xhci.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > > index ca9385d22f68..0e6fbe1f4fcc 100644 > > --- a/drivers/usb/host/xhci.c > > +++ b/drivers/usb/host/xhci.c > > @@ -1117,8 +1117,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) > > retval = xhci_handshake(&xhci->op_regs->status, > > STS_CNR, 0, 10 * 1000 * 1000); > > if (retval) { > > - xhci_warn(xhci, "Controller not ready at resume %d\n", > > - retval); > > + xhci_warn(xhci, "Controller is %s at resume %d\n", > > + retval == -ENODEV ? "inaccessible" : > > + "not ready", retval); > > Old way did print out retval, and was greppable. > Not sure this is an improvement That's true. Maybe it's just me, but I can't directly mapped the value to -ENODEV at first glance. But in essence this is just a cosmetic change. Kai-Heng > > -Mathias