Skip to content

Commit

Permalink
usb: gadget: aspeed: Improve debugging when nuking
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
ozbenh authored and Felipe Balbi committed Aug 12, 2019
1 parent 8016759 commit cca1754
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/gadget/udc/aspeed-vhub/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cca1754

Please sign in to comment.