Skip to content

Commit 1fa07c3

Browse files
Peter Ujfalusigregkh
authored andcommitted
usb: musb: Add quirk to avoid skb reserve in gadget mode
For tusb6010 the DMA functionality only possible if the buffer is 32bit aligned (SYNC access to FIFO) since with ASYNC access the TX/RX offset registers will corrupt eventually. The MUSB_G_NO_SKB_RESERVE will set the quirk_avoids_skb_reserve flag in usb_gadget struct to provide correctly aligned buffer. Signed-off-by: Peter Ujfalusi <[email protected]> Tested-by: Tony Lindgren <[email protected]> Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9816c09 commit 1fa07c3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/usb/musb/musb_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,6 +2224,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
22242224
musb->io.ep_select = musb_flat_ep_select;
22252225
}
22262226

2227+
if (musb->io.quirks & MUSB_G_NO_SKB_RESERVE)
2228+
musb->g.quirk_avoids_skb_reserve = 1;
2229+
22272230
/* At least tusb6010 has its own offsets */
22282231
if (musb->ops->ep_offset)
22292232
musb->io.ep_offset = musb->ops->ep_offset;

drivers/usb/musb/musb_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ struct musb_io;
172172
*/
173173
struct musb_platform_ops {
174174

175+
#define MUSB_G_NO_SKB_RESERVE BIT(9)
175176
#define MUSB_DA8XX BIT(8)
176177
#define MUSB_PRESERVE_SESSION BIT(7)
177178
#define MUSB_DMA_UX500 BIT(6)

0 commit comments

Comments
 (0)