All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>, mathias.nyman@intel.com
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:USB XHCI DRIVER" <linux-usb@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xhci: State explicitly when the controller is inaccessible
Date: Tue, 18 May 2021 15:21:39 +0300	[thread overview]
Message-ID: <f5d2e440-e777-7ef1-db4b-0f50a8a5f6e1@linux.intel.com> (raw)
In-Reply-To: <20210518111640.243559-1-kai.heng.feng@canonical.com>

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 <kai.heng.feng@canonical.com>
> ---
>  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

-Mathias

  reply	other threads:[~2021-05-18 12:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 11:16 [PATCH] xhci: State explicitly when the controller is inaccessible Kai-Heng Feng
2021-05-18 12:21 ` Mathias Nyman [this message]
2021-05-18 12:35   ` Kai-Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5d2e440-e777-7ef1-db4b-0f50a8a5f6e1@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.