linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@iki.fi>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	vkoul@kernel.org, dan.j.williams@intel.com,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH] dmaengine: ti: omap-dma: Configure LCH_TYPE for OMAP1
Date: Sun, 25 Nov 2018 18:58:31 +0200	[thread overview]
Message-ID: <20181125165830.GC3416@darkstar.musicnaut.iki.fi> (raw)
In-Reply-To: <20181125111105.GT6920@n2100.armlinux.org.uk>

Hi,

On Sun, Nov 25, 2018 at 11:11:05AM +0000, Russell King - ARM Linux wrote:
> I think we're better off leaving omap-udc well alone, and if it's
> now broken with DMA, then that's unfortunate - it would require
> someone with the hardware to diagnose the problem and fix it.  I
> think trying to convert it to dmaengine would be risking way more
> problems than its worth.

Well, there's also an option to use dmaengine only for 16xx at the
beginning.

My current guess is that 15xx DMA has been broken at least since
65111084c63d ("USB: more omap_udc updates (dma and omap1710)").

There are two changes in that patch that broke it:

"use 16 bit DMA access" ==> CPC off-by-one becomes now off-by-two...?

"allow burst/pack for memory access" ==> no idea why

Below changes get traffic going with DMA & g_ether...

A.

diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c
index fcf13ef33b31..8094a0380057 100644
--- a/drivers/usb/gadget/udc/omap_udc.c
+++ b/drivers/usb/gadget/udc/omap_udc.c
@@ -498,7 +498,7 @@ static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start)
 
 	end |= start & (0xffff << 16);
 	if (cpu_is_omap15xx())
-		end++;
+		end += 2;
 	if (end < start)
 		end += 0x10000;
 	return end - start;
@@ -730,10 +730,12 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 			ep->ep.name, dma_error, ep, &ep->lch);
 		if (status == 0) {
 			omap_writew(reg, UDC_TXDMA_CFG);
-			/* EMIFF or SDRC */
-			omap_set_dma_src_burst_mode(ep->lch,
-						OMAP_DMA_DATA_BURST_4);
-			omap_set_dma_src_data_pack(ep->lch, 1);
+			if (!cpu_is_omap15xx()) {
+				/* EMIFF or SDRC */
+				omap_set_dma_src_burst_mode(ep->lch,
+							OMAP_DMA_DATA_BURST_4);
+				omap_set_dma_src_data_pack(ep->lch, 1);
+			}
 			/* TIPB */
 			omap_set_dma_dest_params(ep->lch,
 				OMAP_DMA_PORT_TIPB,
@@ -753,10 +755,12 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
 				OMAP_DMA_AMODE_CONSTANT,
 				UDC_DATA_DMA,
 				0, 0);
-			/* EMIFF or SDRC */
-			omap_set_dma_dest_burst_mode(ep->lch,
-						OMAP_DMA_DATA_BURST_4);
-			omap_set_dma_dest_data_pack(ep->lch, 1);
+			if (!cpu_is_omap15xx()) {
+				/* EMIFF or SDRC */
+				omap_set_dma_dest_burst_mode(ep->lch,
+							OMAP_DMA_DATA_BURST_4);
+				omap_set_dma_dest_data_pack(ep->lch, 1);
+			}
 		}
 	}
 	if (status)

  parent reply	other threads:[~2018-11-25 16:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 10:40 [PATCH] dmaengine: ti: omap-dma: Configure LCH_TYPE for OMAP1 Peter Ujfalusi
2018-11-19 18:46 ` Aaro Koskinen
2018-11-20  7:28   ` Peter Ujfalusi
2018-11-20 21:04     ` Aaro Koskinen
2018-11-22  8:31       ` Peter Ujfalusi
2018-11-22 22:01         ` Aaro Koskinen
2018-11-23 11:45           ` Peter Ujfalusi
2018-11-24  0:17             ` Aaro Koskinen
2018-11-24 17:48               ` Russell King - ARM Linux
2018-11-24 19:06                 ` Aaro Koskinen
2018-11-24 19:29                   ` Russell King - ARM Linux
2018-11-22 10:29       ` Russell King - ARM Linux
2018-11-22 15:12         ` Russell King - ARM Linux
2018-11-22 22:24           ` Aaro Koskinen
2018-11-23  0:25             ` Russell King - ARM Linux
2018-11-23  1:23               ` Aaro Koskinen
2018-11-23 11:54               ` Peter Ujfalusi
2018-11-23 12:35           ` Peter Ujfalusi
2018-11-23 15:43             ` Russell King - ARM Linux
2018-11-23 16:16               ` Russell King - ARM Linux
2018-11-23 23:27                 ` Russell King - ARM Linux
2018-11-23 18:52             ` Aaro Koskinen
2018-11-24 20:09               ` Russell King - ARM Linux
2018-11-25  1:07                 ` Tony Lindgren
2018-11-25  1:11                   ` Tony Lindgren
2018-11-25 11:11                   ` Russell King - ARM Linux
2018-11-25 11:57                     ` Russell King - ARM Linux
2018-11-25 16:58                     ` Aaro Koskinen [this message]
2018-11-25 17:14                       ` Tony Lindgren
2018-12-17 23:47                         ` Aaro Koskinen
2018-12-18 15:55                           ` Tony Lindgren
2018-12-17 19:16           ` Aaro Koskinen
2018-12-18 10:11             ` Peter Ujfalusi
2018-11-23 11:49         ` Peter Ujfalusi

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=20181125165830.GC3416@darkstar.musicnaut.iki.fi \
    --to=aaro.koskinen@iki.fi \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=peter.ujfalusi@ti.com \
    --cc=tony@atomide.com \
    --cc=vkoul@kernel.org \
    /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).