.. | .. |
---|
360 | 360 | qh = first_qh(head); |
---|
361 | 361 | break; |
---|
362 | 362 | } |
---|
363 | | - /* else: fall through */ |
---|
| 363 | + fallthrough; |
---|
364 | 364 | |
---|
365 | 365 | case USB_ENDPOINT_XFER_ISOC: |
---|
366 | 366 | case USB_ENDPOINT_XFER_INT: |
---|
.. | .. |
---|
1019 | 1019 | musb->ep0_stage = MUSB_EP0_OUT; |
---|
1020 | 1020 | more = true; |
---|
1021 | 1021 | } |
---|
1022 | | - /* FALLTHROUGH */ |
---|
| 1022 | + fallthrough; |
---|
1023 | 1023 | case MUSB_EP0_OUT: |
---|
1024 | 1024 | fifo_count = min_t(size_t, qh->maxpacket, |
---|
1025 | 1025 | urb->transfer_buffer_length - |
---|
.. | .. |
---|
1257 | 1257 | MUSB_TXCSR_H_WZC_BITS |
---|
1258 | 1258 | | MUSB_TXCSR_TXPKTRDY); |
---|
1259 | 1259 | } |
---|
1260 | | - return; |
---|
| 1260 | + return; |
---|
1261 | 1261 | } |
---|
1262 | 1262 | |
---|
1263 | 1263 | done: |
---|
.. | .. |
---|
1774 | 1774 | status = -EPIPE; |
---|
1775 | 1775 | |
---|
1776 | 1776 | } else if (rx_csr & MUSB_RXCSR_H_ERROR) { |
---|
1777 | | - musb_dbg(musb, "end %d RX proto error", epnum); |
---|
| 1777 | + dev_err(musb->controller, "ep%d RX three-strikes error", epnum); |
---|
1778 | 1778 | |
---|
1779 | | - status = -EPROTO; |
---|
| 1779 | + /* |
---|
| 1780 | + * The three-strikes error could only happen when the USB |
---|
| 1781 | + * device is not accessible, for example detached or powered |
---|
| 1782 | + * off. So return the fatal error -ESHUTDOWN so hopefully the |
---|
| 1783 | + * USB device drivers won't immediately resubmit the same URB. |
---|
| 1784 | + */ |
---|
| 1785 | + status = -ESHUTDOWN; |
---|
1780 | 1786 | musb_writeb(epio, MUSB_RXINTERVAL, 0); |
---|
1781 | 1787 | |
---|
1782 | 1788 | rx_csr &= ~MUSB_RXCSR_H_ERROR; |
---|
.. | .. |
---|
2216 | 2222 | interval = max_t(u8, epd->bInterval, 1); |
---|
2217 | 2223 | break; |
---|
2218 | 2224 | } |
---|
2219 | | - /* FALLTHROUGH */ |
---|
| 2225 | + fallthrough; |
---|
2220 | 2226 | case USB_ENDPOINT_XFER_ISOC: |
---|
2221 | 2227 | /* ISO always uses logarithmic encoding */ |
---|
2222 | 2228 | interval = min_t(u8, epd->bInterval, 16); |
---|
.. | .. |
---|
2543 | 2549 | struct musb_temp_buffer { |
---|
2544 | 2550 | void *kmalloc_ptr; |
---|
2545 | 2551 | void *old_xfer_buffer; |
---|
2546 | | - u8 data[0]; |
---|
| 2552 | + u8 data[]; |
---|
2547 | 2553 | }; |
---|
2548 | 2554 | |
---|
2549 | 2555 | static void musb_free_temp_buffer(struct urb *urb) |
---|
.. | .. |
---|
2656 | 2662 | .description = "musb-hcd", |
---|
2657 | 2663 | .product_desc = "MUSB HDRC host driver", |
---|
2658 | 2664 | .hcd_priv_size = sizeof(struct musb *), |
---|
2659 | | - .flags = HCD_USB2 | HCD_MEMORY, |
---|
| 2665 | + .flags = HCD_USB2 | HCD_DMA | HCD_MEMORY, |
---|
2660 | 2666 | |
---|
2661 | 2667 | /* not using irq handler or reset hooks from usbcore, since |
---|
2662 | 2668 | * those must be shared with peripheral code for OTG configs |
---|