usb: gadget: aspeed: Improve debugging when nuking
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 26 Jul 2019 05:05:37 +0000 (15:05 +1000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 12 Aug 2019 05:54:49 +0000 (08:54 +0300)
When nuking requests, it's useful to display how many were
actually nuked. It has proven handy when debugging issues
where EP0 went in a wrong state.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/aspeed-vhub/core.c

index db3628b..9e698de 100644 (file)
@@ -65,14 +65,16 @@ void ast_vhub_done(struct ast_vhub_ep *ep, struct ast_vhub_req *req,
 void ast_vhub_nuke(struct ast_vhub_ep *ep, int status)
 {
        struct ast_vhub_req *req;
-
-       EPDBG(ep, "Nuking\n");
+       int count = 0;
 
        /* Beware, lock will be dropped & req-acquired by done() */
        while (!list_empty(&ep->queue)) {
                req = list_first_entry(&ep->queue, struct ast_vhub_req, queue);
                ast_vhub_done(ep, req, status);
+               count++;
        }
+       if (count)
+               EPDBG(ep, "Nuked %d request(s)\n", count);
 }
 
 struct usb_request *ast_vhub_alloc_request(struct usb_ep *u_ep,