Re: [PATCH v2] usb: xhci: print xhci->xhc_state when queue_command failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 25, 2025 at 02:01:18PM +0800, Su Hui wrote:
> When encounters some errors like these:
> xhci_hcd 0000:4a:00.2: xHCI dying or halted, can't queue_command
> xhci_hcd 0000:4a:00.2: FIXME: allocate a command ring segment
> usb usb5-port6: couldn't allocate usb_device
> 
> It's hard to know whether xhc_state is dying or halted. So it's better
> to print xhc_state's value which can help locate the resaon of the bug.
> 
> Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
> ---
> v2:
>  - Print xhci->xhc_state with hex style.
> 
>  drivers/usb/host/xhci-ring.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index 94c9c9271658..131e7530ec4a 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -4372,7 +4372,8 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
>  
>  	if ((xhci->xhc_state & XHCI_STATE_DYING) ||
>  		(xhci->xhc_state & XHCI_STATE_HALTED)) {
> -		xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n");
> +		xhci_dbg(xhci, "xHCI dying or halted, can't queue_command. state: 0x%x\n",
> +			 xhci->xhc_state);
>  		return -ESHUTDOWN;
>  	}
>  
> -- 
> 2.30.2
> 

Simple enough, let me take this now as I want to close my tree...

thanks,

greg k-h




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux