All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: musb: ux500: set dma config for both src and dst
@ 2011-08-02 15:33 Per Forlin
  2011-08-03  8:55 ` Mian Yousaf Kaukab
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Per Forlin @ 2011-08-02 15:33 UTC (permalink / raw)
  To: Felipe Balbi, Mian Yousaf KAUKAB, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, linaro-dev, users, Per Forlin

From: Per Forlin <per.forlin@linaro.org>

The dma driver requires both src and dst to be set.
This fix is needed in order to run gadget mass storage.
Patch is verified on snowball.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/usb/musb/ux500_dma.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index cecace4..2313475 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -133,15 +133,13 @@ static bool ux500_configure_channel(struct dma_channel *channel,
 					DMA_SLAVE_BUSWIDTH_4_BYTES;
 
 	slave_conf.direction = direction;
-	if (direction == DMA_FROM_DEVICE) {
-		slave_conf.src_addr = usb_fifo_addr;
-		slave_conf.src_addr_width = addr_width;
-		slave_conf.src_maxburst = 16;
-	} else {
-		slave_conf.dst_addr = usb_fifo_addr;
-		slave_conf.dst_addr_width = addr_width;
-		slave_conf.dst_maxburst = 16;
-	}
+	slave_conf.src_addr = usb_fifo_addr;
+	slave_conf.src_addr_width = addr_width;
+	slave_conf.src_maxburst = 16;
+	slave_conf.dst_addr = usb_fifo_addr;
+	slave_conf.dst_addr_width = addr_width;
+	slave_conf.dst_maxburst = 16;
+
 	dma_chan->device->device_control(dma_chan, DMA_SLAVE_CONFIG,
 					     (unsigned long) &slave_conf);
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-02 15:33 [PATCH] usb: musb: ux500: set dma config for both src and dst Per Forlin
@ 2011-08-03  8:55 ` Mian Yousaf Kaukab
  2011-08-03 10:20 ` Linus Walleij
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Mian Yousaf Kaukab @ 2011-08-03  8:55 UTC (permalink / raw)
  To: Per FORLIN, Felipe Balbi
  Cc: Greg Kroah-Hartman, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org,
	users@igloocommunity.org, Per Forlin

On 08/02/2011 05:33 PM, Per FORLIN wrote:
> From: Per Forlin<per.forlin@linaro.org>
>
> The dma driver requires both src and dst to be set.
> This fix is needed in order to run gadget mass storage.
> Patch is verified on snowball.
>
> Signed-off-by: Per Forlin<per.forlin@linaro.org>
> ---
>   drivers/usb/musb/ux500_dma.c |   16 +++++++---------
>   1 files changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
> index cecace4..2313475 100644
> --- a/drivers/usb/musb/ux500_dma.c
> +++ b/drivers/usb/musb/ux500_dma.c
> @@ -133,15 +133,13 @@ static bool ux500_configure_channel(struct dma_channel *channel,
>   					DMA_SLAVE_BUSWIDTH_4_BYTES;
>
>   	slave_conf.direction = direction;
> -	if (direction == DMA_FROM_DEVICE) {
> -		slave_conf.src_addr = usb_fifo_addr;
> -		slave_conf.src_addr_width = addr_width;
> -		slave_conf.src_maxburst = 16;
> -	} else {
> -		slave_conf.dst_addr = usb_fifo_addr;
> -		slave_conf.dst_addr_width = addr_width;
> -		slave_conf.dst_maxburst = 16;
> -	}
> +	slave_conf.src_addr = usb_fifo_addr;
> +	slave_conf.src_addr_width = addr_width;
> +	slave_conf.src_maxburst = 16;
> +	slave_conf.dst_addr = usb_fifo_addr;
> +	slave_conf.dst_addr_width = addr_width;
> +	slave_conf.dst_maxburst = 16;
> +
>   	dma_chan->device->device_control(dma_chan, DMA_SLAVE_CONFIG,
>   					     (unsigned long)&slave_conf);
>
>    

Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

Thanks,

-- 
Mian Yousaf Kaukab


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-02 15:33 [PATCH] usb: musb: ux500: set dma config for both src and dst Per Forlin
  2011-08-03  8:55 ` Mian Yousaf Kaukab
@ 2011-08-03 10:20 ` Linus Walleij
  2011-08-03 10:36 ` Felipe Balbi
  2011-08-03 13:31 ` Felipe Balbi
  3 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2011-08-03 10:20 UTC (permalink / raw)
  To: Per Forlin
  Cc: Felipe Balbi, Mian Yousaf KAUKAB, Greg Kroah-Hartman, linux-usb,
	linux-kernel, linaro-dev, users, Per Forlin

On Tue, Aug 2, 2011 at 5:33 PM, Per Forlin <per.forlin@stericsson.com> wrote:

> From: Per Forlin <per.forlin@linaro.org>
>
> The dma driver requires both src and dst to be set.
> This fix is needed in order to run gadget mass storage.
> Patch is verified on snowball.
>
> Signed-off-by: Per Forlin <per.forlin@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-02 15:33 [PATCH] usb: musb: ux500: set dma config for both src and dst Per Forlin
  2011-08-03  8:55 ` Mian Yousaf Kaukab
  2011-08-03 10:20 ` Linus Walleij
@ 2011-08-03 10:36 ` Felipe Balbi
  2011-08-03 13:31 ` Felipe Balbi
  3 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-08-03 10:36 UTC (permalink / raw)
  To: Per Forlin
  Cc: Felipe Balbi, Mian Yousaf KAUKAB, Greg Kroah-Hartman, linux-usb,
	linux-kernel, linaro-dev, users, Per Forlin

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

On Tue, Aug 02, 2011 at 05:33:39PM +0200, Per Forlin wrote:
> From: Per Forlin <per.forlin@linaro.org>
> 
> The dma driver requires both src and dst to be set.
> This fix is needed in order to run gadget mass storage.
> Patch is verified on snowball.
> 
> Signed-off-by: Per Forlin <per.forlin@linaro.org>

applied, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-02 15:33 [PATCH] usb: musb: ux500: set dma config for both src and dst Per Forlin
                   ` (2 preceding siblings ...)
  2011-08-03 10:36 ` Felipe Balbi
@ 2011-08-03 13:31 ` Felipe Balbi
  2011-08-03 13:53   ` Per Forlin
  3 siblings, 1 reply; 7+ messages in thread
From: Felipe Balbi @ 2011-08-03 13:31 UTC (permalink / raw)
  To: Per Forlin
  Cc: Felipe Balbi, Mian Yousaf KAUKAB, Greg Kroah-Hartman, linux-usb,
	linux-kernel, linaro-dev, users, Per Forlin

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On Tue, Aug 02, 2011 at 05:33:39PM +0200, Per Forlin wrote:
> From: Per Forlin <per.forlin@linaro.org>
> 
> The dma driver requires both src and dst to be set.
> This fix is needed in order to run gadget mass storage.
> Patch is verified on snowball.
> 
> Signed-off-by: Per Forlin <per.forlin@linaro.org>

should this go for stable too ??

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-03 13:31 ` Felipe Balbi
@ 2011-08-03 13:53   ` Per Forlin
  2011-08-03 13:56     ` Felipe Balbi
  0 siblings, 1 reply; 7+ messages in thread
From: Per Forlin @ 2011-08-03 13:53 UTC (permalink / raw)
  To: balbi
  Cc: Per Forlin, Mian Yousaf KAUKAB, Greg Kroah-Hartman, linux-usb,
	linux-kernel, linaro-dev, users

On 3 August 2011 15:31, Felipe Balbi <balbi@ti.com> wrote:
> On Tue, Aug 02, 2011 at 05:33:39PM +0200, Per Forlin wrote:
>> From: Per Forlin <per.forlin@linaro.org>
>>
>> The dma driver requires both src and dst to be set.
>> This fix is needed in order to run gadget mass storage.
>> Patch is verified on snowball.
>>
>> Signed-off-by: Per Forlin <per.forlin@linaro.org>
>
> should this go for stable too ??
>
Short answer no.

Reason:
I ran into this bug when applying upcoming dma driver patches. Adding
this patch now will makes sure the musb driver works when the dma
driver is updated..
Up until now the dma driver only use the peripheral end point
configuration and set it for both src and dst. Upcoming patches (not
sure if they are submitted yet) will allow src and dst to be different
therefore the client must set both.


> --
> balbi
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb: musb: ux500: set dma config for both src and dst
  2011-08-03 13:53   ` Per Forlin
@ 2011-08-03 13:56     ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-08-03 13:56 UTC (permalink / raw)
  To: Per Forlin
  Cc: balbi, Per Forlin, Mian Yousaf KAUKAB, Greg Kroah-Hartman,
	linux-usb, linux-kernel, linaro-dev, users

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

On Wed, Aug 03, 2011 at 03:53:10PM +0200, Per Forlin wrote:
> On 3 August 2011 15:31, Felipe Balbi <balbi@ti.com> wrote:
> > On Tue, Aug 02, 2011 at 05:33:39PM +0200, Per Forlin wrote:
> >> From: Per Forlin <per.forlin@linaro.org>
> >>
> >> The dma driver requires both src and dst to be set.
> >> This fix is needed in order to run gadget mass storage.
> >> Patch is verified on snowball.
> >>
> >> Signed-off-by: Per Forlin <per.forlin@linaro.org>
> >
> > should this go for stable too ??
> >
> Short answer no.
> 
> Reason:
> I ran into this bug when applying upcoming dma driver patches. Adding
> this patch now will makes sure the musb driver works when the dma
> driver is updated..
> Up until now the dma driver only use the peripheral end point
> configuration and set it for both src and dst. Upcoming patches (not
> sure if they are submitted yet) will allow src and dst to be different
> therefore the client must set both.

ok, good ;-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-03 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02 15:33 [PATCH] usb: musb: ux500: set dma config for both src and dst Per Forlin
2011-08-03  8:55 ` Mian Yousaf Kaukab
2011-08-03 10:20 ` Linus Walleij
2011-08-03 10:36 ` Felipe Balbi
2011-08-03 13:31 ` Felipe Balbi
2011-08-03 13:53   ` Per Forlin
2011-08-03 13:56     ` Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.