linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: b-liu@ti.com, tony@atomide.com, gregkh@linuxfoundation.org,
	vinod.koul@intel.com
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	balbi@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 02/10] usb: musb: Add quirk to avoid skb reserve in gadget mode
Date: Wed, 10 May 2017 11:42:24 +0300	[thread overview]
Message-ID: <20170510084231.19302-3-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <20170510084231.19302-1-peter.ujfalusi@ti.com>

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 <peter.ujfalusi@ti.com>
---
 drivers/usb/musb/musb_core.c | 3 +++
 drivers/usb/musb/musb_core.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 870da18f5077..87cbd56cc761 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2224,6 +2224,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
 		musb->io.ep_select = musb_flat_ep_select;
 	}
 
+	if (musb->io.quirks & MUSB_G_NO_SKB_RESERVE)
+		musb->g.quirk_avoids_skb_reserve = 1;
+
 	/* At least tusb6010 has its own offsets */
 	if (musb->ops->ep_offset)
 		musb->io.ep_offset = musb->ops->ep_offset;
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 3e98d4268a64..9f22c5b8ce37 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -172,6 +172,7 @@ struct musb_io;
  */
 struct musb_platform_ops {
 
+#define MUSB_G_NO_SKB_RESERVE	BIT(9)
 #define MUSB_DA8XX		BIT(8)
 #define MUSB_PRESERVE_SESSION	BIT(7)
 #define MUSB_DMA_UX500		BIT(6)
-- 
2.12.2

  parent reply	other threads:[~2017-05-10  8:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10  8:42 [PATCH v2 00/10] usb: musb: tusb6010_omap: Convert to DMAengine Peter Ujfalusi
2017-05-10  8:42 ` [PATCH v2 01/10] dmaengine: omap-dma: port_window support correction for both direction Peter Ujfalusi
2017-05-10 16:28   ` Tony Lindgren
2017-05-10  8:42 ` Peter Ujfalusi [this message]
2017-05-10  8:42 ` [PATCH v2 03/10] usb: musb: tusb6010: Add MUSB_G_NO_SKB_RESERVE to quirks Peter Ujfalusi
2017-05-10  8:42 ` [PATCH v2 04/10] usb: musb: tusb6010_omap: Use one musb_ep_select call in tusb_omap_dma_program Peter Ujfalusi
2017-05-10  8:42 ` [PATCH v2 05/10] usb: musb: tusb6010_omap: Do not reset the other direction's packet size Peter Ujfalusi
     [not found]   ` <20170510084231.19302-6-peter.ujfalusi-l0cyMroinI0@public.gmane.org>
2017-05-10 16:28     ` Tony Lindgren
2017-05-10 17:07   ` Bin Liu
2017-05-10 23:16     ` Joe Perches
2017-05-11  6:19       ` Peter Ujfalusi
2017-05-11 14:12         ` Bin Liu
2017-05-12  6:53           ` Peter Ujfalusi
2017-05-12 12:07             ` Bin Liu
2017-05-10  8:42 ` [PATCH v2 06/10] usb: musb: tusb6010_omap: Create new struct for DMA data/parameters Peter Ujfalusi
     [not found] ` <20170510084231.19302-1-peter.ujfalusi-l0cyMroinI0@public.gmane.org>
2017-05-10  8:42   ` [PATCH v2 07/10] usb: musb: tusb6010_omap: Allocate DMA channels upfront Peter Ujfalusi
2017-05-10  8:42 ` [PATCH v2 08/10] usb: musb: tusb6010: Handle DMA TX completion in DMA callback as well Peter Ujfalusi
2017-05-10  8:42 ` [PATCH v2 09/10] ARM: OMAP2+: DMA: Add slave map entries for 24xx external request lines Peter Ujfalusi
2017-05-10 16:30   ` Tony Lindgren
2017-05-10  8:51 ` [PATCH v2 10/10] usb: musb: tusb6010_omap: Convert to DMAengine API Peter Ujfalusi
2017-05-10 16:32 ` [PATCH v2 00/10] usb: musb: tusb6010_omap: Convert to DMAengine Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170510084231.19302-3-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=b-liu@ti.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).