Commit d1c5dd6f authored by Thomas Pugliese's avatar Thomas Pugliese Committed by Greg Kroah-Hartman

usb: wusbcore: add info to HWA debug prints

This patch adds a debug print in the transfer dequeue case where a
transfer result arrives for a transfer that has already been cleaned up.
It also adds the transfer ID to some debug prints and prints error codes
as signed integers in a couple of others.
Signed-off-by: default avatarThomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ecf3701c
...@@ -369,13 +369,13 @@ static unsigned __wa_xfer_is_done(struct wa_xfer *xfer) ...@@ -369,13 +369,13 @@ static unsigned __wa_xfer_is_done(struct wa_xfer *xfer)
break; break;
case WA_SEG_ERROR: case WA_SEG_ERROR:
xfer->result = seg->result; xfer->result = seg->result;
dev_dbg(dev, "xfer %p ID %08X#%u: ERROR result %zu(0x%08zX)\n", dev_dbg(dev, "xfer %p ID %08X#%u: ERROR result %zi(0x%08zX)\n",
xfer, wa_xfer_id(xfer), seg->index, seg->result, xfer, wa_xfer_id(xfer), seg->index, seg->result,
seg->result); seg->result);
goto out; goto out;
case WA_SEG_ABORTED: case WA_SEG_ABORTED:
xfer->result = seg->result; xfer->result = seg->result;
dev_dbg(dev, "xfer %p ID %08X#%u: ABORTED result %zu(0x%08zX)\n", dev_dbg(dev, "xfer %p ID %08X#%u: ABORTED result %zi(0x%08zX)\n",
xfer, wa_xfer_id(xfer), seg->index, seg->result, xfer, wa_xfer_id(xfer), seg->index, seg->result,
seg->result); seg->result);
goto out; goto out;
...@@ -2262,7 +2262,7 @@ static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer, ...@@ -2262,7 +2262,7 @@ static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer,
} }
if (usb_status & 0x80) { if (usb_status & 0x80) {
seg->result = wa_xfer_status_to_errno(usb_status); seg->result = wa_xfer_status_to_errno(usb_status);
dev_err(dev, "DTI: xfer %p#:%08X:%u failed (0x%02x)\n", dev_err(dev, "DTI: xfer %p 0x%08X:#%u failed (0x%02x)\n",
xfer, xfer->id, seg->index, usb_status); xfer, xfer->id, seg->index, usb_status);
seg->status = ((usb_status & 0x7F) == WA_XFER_STATUS_ABORTED) ? seg->status = ((usb_status & 0x7F) == WA_XFER_STATUS_ABORTED) ?
WA_SEG_ABORTED : WA_SEG_ERROR; WA_SEG_ABORTED : WA_SEG_ERROR;
...@@ -2556,8 +2556,10 @@ static void wa_buf_in_cb(struct urb *urb) ...@@ -2556,8 +2556,10 @@ static void wa_buf_in_cb(struct urb *urb)
} }
} else { } else {
rpipe = xfer->ep->hcpriv; rpipe = xfer->ep->hcpriv;
dev_dbg(dev, "xfer %p#%u: data in done (%zu bytes)\n", dev_dbg(dev,
xfer, seg->index, seg->result); "xfer %p 0x%08X#%u: data in done (%zu bytes)\n",
xfer, wa_xfer_id(xfer), seg->index,
seg->result);
rpipe_ready = rpipe_avail_inc(rpipe); rpipe_ready = rpipe_avail_inc(rpipe);
done = __wa_xfer_mark_seg_as_done(xfer, seg, done = __wa_xfer_mark_seg_as_done(xfer, seg,
WA_SEG_DONE); WA_SEG_DONE);
...@@ -2575,8 +2577,9 @@ static void wa_buf_in_cb(struct urb *urb) ...@@ -2575,8 +2577,9 @@ static void wa_buf_in_cb(struct urb *urb)
spin_lock_irqsave(&xfer->lock, flags); spin_lock_irqsave(&xfer->lock, flags);
rpipe = xfer->ep->hcpriv; rpipe = xfer->ep->hcpriv;
if (printk_ratelimit()) if (printk_ratelimit())
dev_err(dev, "xfer %p#%u: data in error %d\n", dev_err(dev, "xfer %p 0x%08X#%u: data in error %d\n",
xfer, seg->index, urb->status); xfer, wa_xfer_id(xfer), seg->index,
urb->status);
if (edc_inc(&wa->nep_edc, EDC_MAX_ERRORS, if (edc_inc(&wa->nep_edc, EDC_MAX_ERRORS,
EDC_ERROR_TIMEFRAME)){ EDC_ERROR_TIMEFRAME)){
dev_err(dev, "DTO: URB max acceptable errors " dev_err(dev, "DTO: URB max acceptable errors "
...@@ -2670,11 +2673,15 @@ static void wa_dti_cb(struct urb *urb) ...@@ -2670,11 +2673,15 @@ static void wa_dti_cb(struct urb *urb)
xfer_result->hdr.bNotifyType); xfer_result->hdr.bNotifyType);
break; break;
} }
xfer_id = le32_to_cpu(xfer_result->dwTransferID);
usb_status = xfer_result->bTransferStatus & 0x3f; usb_status = xfer_result->bTransferStatus & 0x3f;
if (usb_status == WA_XFER_STATUS_NOT_FOUND) if (usb_status == WA_XFER_STATUS_NOT_FOUND) {
/* taken care of already */ /* taken care of already */
dev_dbg(dev, "%s: xfer 0x%08X#%u not found.\n",
__func__, xfer_id,
xfer_result->bTransferSegment & 0x7f);
break; break;
xfer_id = le32_to_cpu(xfer_result->dwTransferID); }
xfer = wa_xfer_get_by_id(wa, xfer_id); xfer = wa_xfer_get_by_id(wa, xfer_id);
if (xfer == NULL) { if (xfer == NULL) {
/* FIXME: transaction not found. */ /* FIXME: transaction not found. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment