All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Haowen Bai <calvin.bai@ugreen.com>
Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] usb: pci-quirks: abort xHCI handoff if MMIO is inaccessible
Date: Sun, 13 Sep 2026 14:53:24 +0200	[thread overview]
Message-ID: <aqacxOz0jPWIfXGs@wunner.de> (raw)
In-Reply-To: <A8558181A93455E3+20260906162614.26940-1-calvin.bai@ugreen.com>

On Mon, Sep 07, 2026 at 12:26:14AM +0800, Haowen Bai wrote:
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -1026,15 +1026,22 @@ static void quirk_usb_disable_ehci(struct pci_dev *pdev)
>   * Returns 0 when the mask bits have the value done.
>   * Returns -ETIMEDOUT if this condition is not true after
>   * wait_usec microseconds have passed.
> + * Returns -ENODEV if the register reads as all-ones (hardware removed).
>   */
>  static int handshake(void __iomem *ptr, u32 mask, u32 done,
>  		int wait_usec, int delay_usec)
>  {
>  	u32	result;
> +	int	ret;
>  
> -	return readl_poll_timeout_atomic(ptr, result,
> -					 ((result & mask) == done),
> -					 delay_usec, wait_usec);
> +	ret = readl_poll_timeout_atomic(ptr, result,
> +					(result & mask) == done ||
> +					result == U32_MAX,
> +					delay_usec, wait_usec);
> +	if (result == U32_MAX)
> +		return -ENODEV;
> +
> +	return ret;

Nit:  Checking for PCI_POSSIBLE_ERROR(result) might be slightly clearer
than U32_MAX.

Thanks,

Lukas

      parent reply	other threads:[~2026-09-13 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06 16:26 [PATCH] usb: pci-quirks: abort xHCI handoff if MMIO is inaccessible Haowen Bai
2026-09-10 13:35 ` Mathias Nyman
2026-09-13 12:53 ` Lukas Wunner [this message]

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=aqacxOz0jPWIfXGs@wunner.de \
    --to=lukas@wunner.de \
    --cc=calvin.bai@ugreen.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stable@vger.kernel.org \
    /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.