Loading drivers/usb/host/xhci-pci.c +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ static void xhci_pci_remove(struct pci_dev *dev) struct xhci_hcd *xhci; xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; if (xhci->shared_hcd) { usb_remove_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd); Loading drivers/usb/host/xhci-ring.c +3 −1 Original line number Diff line number Diff line Loading @@ -3940,7 +3940,9 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd, { int reserved_trbs = xhci->cmd_ring_reserved_trbs; int ret; if (xhci->xhc_state) { 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"); return -ESHUTDOWN; } Loading drivers/usb/host/xhci.c +6 −3 Original line number Diff line number Diff line Loading @@ -156,7 +156,9 @@ static int xhci_start(struct xhci_hcd *xhci) "waited %u microseconds.\n", XHCI_MAX_HALT_USEC); if (!ret) xhci->xhc_state &= ~XHCI_STATE_HALTED; /* clear state flags. Including dying, halted or removing */ xhci->xhc_state = 0; return ret; } Loading Loading @@ -2795,7 +2797,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) if (ret <= 0) return ret; xhci = hcd_to_xhci(hcd); if (xhci->xhc_state & XHCI_STATE_DYING) if ((xhci->xhc_state & XHCI_STATE_DYING) || (xhci->xhc_state & XHCI_STATE_REMOVING)) return -ENODEV; xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); Loading Loading @@ -3841,7 +3844,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, mutex_lock(&xhci->mutex); if (xhci->xhc_state) /* dying or halted */ if (xhci->xhc_state) /* dying, removing or halted */ goto out; if (!udev->slot_id) { Loading drivers/usb/host/xhci.h +1 −0 Original line number Diff line number Diff line Loading @@ -1533,6 +1533,7 @@ struct xhci_hcd { */ #define XHCI_STATE_DYING (1 << 0) #define XHCI_STATE_HALTED (1 << 1) #define XHCI_STATE_REMOVING (1 << 2) /* Statistics */ int error_bitmask; unsigned int quirks; Loading Loading
drivers/usb/host/xhci-pci.c +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ static void xhci_pci_remove(struct pci_dev *dev) struct xhci_hcd *xhci; xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; if (xhci->shared_hcd) { usb_remove_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd); Loading
drivers/usb/host/xhci-ring.c +3 −1 Original line number Diff line number Diff line Loading @@ -3940,7 +3940,9 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd, { int reserved_trbs = xhci->cmd_ring_reserved_trbs; int ret; if (xhci->xhc_state) { 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"); return -ESHUTDOWN; } Loading
drivers/usb/host/xhci.c +6 −3 Original line number Diff line number Diff line Loading @@ -156,7 +156,9 @@ static int xhci_start(struct xhci_hcd *xhci) "waited %u microseconds.\n", XHCI_MAX_HALT_USEC); if (!ret) xhci->xhc_state &= ~XHCI_STATE_HALTED; /* clear state flags. Including dying, halted or removing */ xhci->xhc_state = 0; return ret; } Loading Loading @@ -2795,7 +2797,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) if (ret <= 0) return ret; xhci = hcd_to_xhci(hcd); if (xhci->xhc_state & XHCI_STATE_DYING) if ((xhci->xhc_state & XHCI_STATE_DYING) || (xhci->xhc_state & XHCI_STATE_REMOVING)) return -ENODEV; xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); Loading Loading @@ -3841,7 +3844,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, mutex_lock(&xhci->mutex); if (xhci->xhc_state) /* dying or halted */ if (xhci->xhc_state) /* dying, removing or halted */ goto out; if (!udev->slot_id) { Loading
drivers/usb/host/xhci.h +1 −0 Original line number Diff line number Diff line Loading @@ -1533,6 +1533,7 @@ struct xhci_hcd { */ #define XHCI_STATE_DYING (1 << 0) #define XHCI_STATE_HALTED (1 << 1) #define XHCI_STATE_REMOVING (1 << 2) /* Statistics */ int error_bitmask; unsigned int quirks; Loading