Skip to content

Commit

Permalink
staging: octeon-usb: fail and warn if DMA counters are wrong
Browse files Browse the repository at this point in the history
Fail and WARN if DMA counters are wrong.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Aaro Koskinen authored and Greg Kroah-Hartman committed Mar 24, 2015
1 parent eb04114 commit f3b8edc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/staging/octeon-usb/octeon-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,17 @@ static int cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel)
(pipe->transfer_dir == CVMX_USB_DIRECTION_OUT))
pipe->flags |= CVMX_USB_PIPE_FLAGS_NEED_PING;

if (unlikely(WARN_ON_ONCE(bytes_this_transfer < 0))) {
/*
* In some rare cases the DMA engine seems to get stuck and
* keeps substracting same byte count over and over again. In
* such case we just need to fail every transaction.
*/
cvmx_usb_perform_complete(usb, pipe, transaction,
CVMX_USB_COMPLETE_ERROR);
return 0;
}

if (usbc_hcint.s.stall) {
/*
* STALL as a response means this transaction cannot be
Expand Down

0 comments on commit f3b8edc

Please sign in to comment.