Re: [RFC PATCH] USB: xhci: Enable HCE event reset function

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

 



On Wed, Nov 18, 2020 at 11:36:13AM +0800, Longfang Liu wrote:
> The HCE(Host Controller Error) event has been defined in
> the XHCI driver but has not been used. If we want to use
> the HCE event to reset the controller, can we implement
> it in the interrupt function as follows:
> 
> xhci_irq()
>     |----xhci_halt()
>     |----xhci_shutdown()
>     |----xhci_start()
>     |----xhci_run()
> 
> Signed-off-by: Longfang Liu <liulongfang@xxxxxxxxxx>
> ---
>  drivers/usb/host/xhci-ring.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

$ ./scripts/get_maintainer.pl --file drivers/usb/host/xhci-ring.c
Mathias Nyman <mathias.nyman@xxxxxxxxx> (supporter:USB XHCI DRIVER)
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> (supporter:USB SUBSYSTEM)
linux-usb@xxxxxxxxxxxxxxx (open list:USB XHCI DRIVER)
linux-kernel@xxxxxxxxxxxxxxx (open list)

Any reason to not include the maintainer of the xhci driver here?

> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index 2c255d0..87b3a40 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -2857,6 +2857,16 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
>  		goto out;
>  	}
>  
> +	if (status & STS_HCE) {
> +		xhci_warn(xhci, "WARNING: Host Controller Error\n");
> +		xhci_halt(xhci);
> +		xhci_shutdown(hcd);
> +		xhci_start(xhci);
> +		xhci_run(hcd);
> +		ret = IRQ_HANDLED;
> +		goto out;
> +	}
> +

Does this fix a real problem for you?  Are you sure we will not suddenly
start resetting devices that were working properly and sending this
error incorrectly?  How did you test this?

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux