All of lore.kernel.org
 help / color / mirror / Atom feed
* [04/20] usb: host: xhci: check HCD_HW_ACCESSIBLE earlier
@ 2018-04-16 12:29 Felipe Balbi
  0 siblings, 0 replies; only message in thread
From: Felipe Balbi @ 2018-04-16 12:29 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linux USB, Felipe Balbi

This is the last check that can be done earlier. No functional
changes.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
 drivers/usb/host/xhci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 284dc6c10189..dba4c61f5cf6 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1305,6 +1305,12 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
 		return -ESHUTDOWN;
 	}
 
+	if (!HCD_HW_ACCESSIBLE(hcd)) {
+		if (!in_interrupt())
+			xhci_dbg(xhci, "urb submitted during PCI suspend\n");
+		return -ESHUTDOWN;
+	}
+
 	slot_id = urb->dev->slot_id;
 	ep_index = xhci_get_endpoint_index(&urb->ep->desc);
 	ep_state = &xhci->devs[slot_id]->eps[ep_index].ep_state;
@@ -1321,12 +1327,6 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
 		}
 	}
 
-	if (!HCD_HW_ACCESSIBLE(hcd)) {
-		if (!in_interrupt())
-			xhci_dbg(xhci, "urb submitted during PCI suspend\n");
-		return -ESHUTDOWN;
-	}
-
 	if (usb_endpoint_xfer_isoc(&urb->ep->desc))
 		num_tds = urb->number_of_packets;
 	else if (usb_endpoint_is_bulk_out(&urb->ep->desc) &&

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-16 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 12:29 [04/20] usb: host: xhci: check HCD_HW_ACCESSIBLE earlier Felipe Balbi

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.