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.ba...@linux.intel.com>
---
 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 772e07e2ef16..0fd990603f77 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2526,14 +2526,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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to