If we get an interrupt while we don't have an allocated event_ring, that means we're enabling IRQs far too early. Instead of just printing an error message, let's make sure to add a scary-looking Stack Trace so people report these things and we fix them. Eventually, when we're happy that this doesn't happen, we should just remove this altogether. Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> --- drivers/usb/host/xhci-ring.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 4dd2e438467f..6e80d0af1a33 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2522,14 +2522,16 @@ static int handle_tx_event(struct xhci_hcd *xhci, static int xhci_handle_event(struct xhci_hcd *xhci) { union xhci_trb *event; + struct device *dev; int update_ptrs = 1; int ret; + dev = xhci_to_hcd(xhci)->self.controller; + /* Event ring hasn't been allocated yet. */ - if (!xhci->event_ring || !xhci->event_ring->dequeue) { - xhci_err(xhci, "ERROR event ring not ready\n"); + if (dev_WARN_ONCE(dev, !xhci->event_ring || !xhci->event_ring->dequeue, + "event ring not ready\n")) return -ENOMEM; - } event = xhci->event_ring->dequeue; /* Does the HC or OS own the TRB? */ -- 2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html