Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-15 Thread Vinod Koul
On Mon, Mar 14, 2016 at 12:46:41PM +0100, Maxime Ripard wrote: > On Fri, Mar 11, 2016 at 04:48:26PM +0530, Vinod Koul wrote: > > > > But this nees to be property for clients and not driver. Client can then > > > > program these > > > > > > Yes, totally. The question here is how the clients give th

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-14 Thread Maxime Ripard
On Fri, Mar 11, 2016 at 04:48:26PM +0530, Vinod Koul wrote: > > > But this nees to be property for clients and not driver. Client can then > > > program these > > > > Yes, totally. The question here is how the clients give that > > information to the driver. > > For this part am not worried. If w

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Vinod Koul
On Fri, Mar 11, 2016 at 11:26:31AM +0100, Boris Brezillon wrote: > On Fri, 11 Mar 2016 15:36:07 +0530 > Vinod Koul wrote: > > > On Fri, Mar 11, 2016 at 10:40:55AM +0100, Boris Brezillon wrote: > > > On Fri, 11 Mar 2016 11:54:52 +0530 > > > Vinod Koul wrote: > > > > > > > On Wed, Mar 09, 2016 at

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Vinod Koul
On Fri, Mar 11, 2016 at 11:55:49AM +0100, Maxime Ripard wrote: > On Fri, Mar 11, 2016 at 03:39:02PM +0530, Vinod Koul wrote: > > On Fri, Mar 11, 2016 at 10:45:52AM +0100, Boris Brezillon wrote: > > > On Fri, 11 Mar 2016 11:56:07 +0530 > > > Vinod Koul wrote: > > > > > > > On Wed, Mar 09, 2016 at

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Maxime Ripard
On Fri, Mar 11, 2016 at 03:39:02PM +0530, Vinod Koul wrote: > On Fri, Mar 11, 2016 at 10:45:52AM +0100, Boris Brezillon wrote: > > On Fri, 11 Mar 2016 11:56:07 +0530 > > Vinod Koul wrote: > > > > > On Wed, Mar 09, 2016 at 12:06:27PM +0100, Boris Brezillon wrote: > > > > On Tue, 8 Mar 2016 08:25:4

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Boris Brezillon
On Fri, 11 Mar 2016 15:36:07 +0530 Vinod Koul wrote: > On Fri, Mar 11, 2016 at 10:40:55AM +0100, Boris Brezillon wrote: > > On Fri, 11 Mar 2016 11:54:52 +0530 > > Vinod Koul wrote: > > > > > On Wed, Mar 09, 2016 at 11:14:34AM +0100, Boris Brezillon wrote: > > > > > > > > > + * struct sun4i_dma_

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Vinod Koul
On Fri, Mar 11, 2016 at 10:45:52AM +0100, Boris Brezillon wrote: > On Fri, 11 Mar 2016 11:56:07 +0530 > Vinod Koul wrote: > > > On Wed, Mar 09, 2016 at 12:06:27PM +0100, Boris Brezillon wrote: > > > On Tue, 8 Mar 2016 08:25:47 +0530 > > > Vinod Koul wrote: > > > > > > > > Why does dmaengine nee

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Vinod Koul
On Fri, Mar 11, 2016 at 10:40:55AM +0100, Boris Brezillon wrote: > On Fri, 11 Mar 2016 11:54:52 +0530 > Vinod Koul wrote: > > > On Wed, Mar 09, 2016 at 11:14:34AM +0100, Boris Brezillon wrote: > > > > > > > > + * struct sun4i_dma_chan_config - DMA channel config > > > > > > > > + * > > > > > > >

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Boris Brezillon
On Fri, 11 Mar 2016 11:56:07 +0530 Vinod Koul wrote: > On Wed, Mar 09, 2016 at 12:06:27PM +0100, Boris Brezillon wrote: > > On Tue, 8 Mar 2016 08:25:47 +0530 > > Vinod Koul wrote: > > > > > > Why does dmaengine need to wait? Can you explain that > > > > I don't have an answer for that one, but

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-11 Thread Boris Brezillon
On Fri, 11 Mar 2016 11:54:52 +0530 Vinod Koul wrote: > On Wed, Mar 09, 2016 at 11:14:34AM +0100, Boris Brezillon wrote: > > > > > > > + * struct sun4i_dma_chan_config - DMA channel config > > > > > > > + * > > > > > > > + * @para: contains information about block size and time before > > > > > >

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-10 Thread Vinod Koul
On Wed, Mar 09, 2016 at 12:06:27PM +0100, Boris Brezillon wrote: > On Tue, 8 Mar 2016 08:25:47 +0530 > Vinod Koul wrote: > > > > Why does dmaengine need to wait? Can you explain that > > I don't have an answer for that one, but when I set WAIT_CYCLES to 1 > for the NAND use case it does not work

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-10 Thread Vinod Koul
On Wed, Mar 09, 2016 at 11:14:34AM +0100, Boris Brezillon wrote: > > > > > > + * struct sun4i_dma_chan_config - DMA channel config > > > > > > + * > > > > > > + * @para: contains information about block size and time before > > > > > > checking > > > > > > + * DRQ line. This is device specific a

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-09 Thread Boris Brezillon
On Tue, 8 Mar 2016 08:25:47 +0530 Vinod Koul wrote: > > Why does dmaengine need to wait? Can you explain that I don't have an answer for that one, but when I set WAIT_CYCLES to 1 for the NAND use case it does not work. So I guess it is somehow related to how the DRQ line is controlled on the dev

Re: [linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-09 Thread Maxime Ripard
On Tue, Mar 08, 2016 at 03:35:38PM +0530, Vinod Koul wrote: > On Tue, Mar 08, 2016 at 09:42:31AM +0100, Hans de Goede wrote: > > > > > > I see 2 possible reasons why waiting till checking for drq can help: > > > > 1) A lot of devices have an internal fifo hooked up to a single mmio data > > regi

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-09 Thread Boris Brezillon
On Tue, 8 Mar 2016 08:25:47 +0530 Vinod Koul wrote: > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > > > Hi Vinod, > > > > > > On Mon, 7 Mar 2016 20:24:29 +0530 > > > Vinod Koul wrote: > > > > > > > On Mon,

Re: [linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-09 Thread LABBE Corentin
> > > > It doesn't really makes sense to us, but it does have a significant > > impact on the throughput. > > I wouldn't say significant impact, but tweaking those parameters has > some impact on the performances, and since it's not that complicated to > implement, I thought it was worth a try, b

Re: [linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Vinod Koul
On Tue, Mar 08, 2016 at 09:42:31AM +0100, Hans de Goede wrote: > > > I see 2 possible reasons why waiting till checking for drq can help: > > 1) A lot of devices have an internal fifo hooked up to a single mmio data > register which gets read using the general purpose dma-engine, it allows > thi

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Vinod Koul
On Tue, Mar 08, 2016 at 09:46:25AM +0100, Boris Brezillon wrote: > On Tue, 8 Mar 2016 08:51:31 +0100 > Maxime Ripard wrote: > > > On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > > > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > > > On Mon, Mar 07, 2016 at 04:08:

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Vinod Koul
On Tue, Mar 08, 2016 at 08:51:31AM +0100, Maxime Ripard wrote: > > > > > > + * struct sun4i_dma_chan_config - DMA channel config > > > > > > + * > > > > > > + * @para: contains information about block size and time before > > > > > > checking > > > > > > + * DRQ line. This is device specific and

Re: [linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Priit Laes
On Tue, 2016-03-08 at 09:46 +0100, Boris Brezillon wrote: > On Tue, 8 Mar 2016 08:51:31 +0100 > Maxime Ripard wrote: > > > On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > > > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > > > On Mon, Mar 07, 2016 at 04:08:57PM +0

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Boris Brezillon
On Tue, 8 Mar 2016 08:51:31 +0100 Maxime Ripard wrote: > On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > > > > Hi Vinod, > > > > > > > > On Mon,

Re: [linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-08 Thread Hans de Goede
Hi, On 08-03-16 08:51, Maxime Ripard wrote: On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: Hi Vinod, On Mon, 7 Mar 2016 20:24:29 +0530 Vinod Koul wrot

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Maxime Ripard
On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > > > Hi Vinod, > > > > > > On Mon, 7 Mar 2016 20:24:29 +0530 > > > Vinod Koul wrote: > > > > > > > On

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: Also just noticed the subsystem name on this is not correct, pls fix that in subsequent posting -- ~Vi

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > > Hi Vinod, > > > > On Mon, 7 Mar 2016 20:24:29 +0530 > > Vinod Koul wrote: > > > > > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > > > > +/* D

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Maxime Ripard
On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > Hi Vinod, > > On Mon, 7 Mar 2016 20:24:29 +0530 > Vinod Koul wrote: > > > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > > > +/* Dedicated DMA parameter register layout */ > > > +#define SUN4I_DDMA_PARA_DST_DA

Re: [linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Emilio López
Hi, El 07/03/16 a las 12:47, Boris Brezillon escribió: (...) >> Does SPI refer the Serial Peripheral Interface? >> >> If yes, then I would point out that current sun4i SPI driver doesn't >> actually use DMA [1] >> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2016-February/411 >> 722.ht

Re: [linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Hi Priit, On Mon, 07 Mar 2016 17:30:41 +0200 Priit Laes wrote: > On Mon, 2016-03-07 at 10:59 +0100, Boris Brezillon wrote: > > Some drivers might need to tweak the block size and wait cycles > > values > > to get better performances. > > Create and export the sun4i_dma_set_chan_config() to do th

Re: [linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Priit Laes
On Mon, 2016-03-07 at 10:59 +0100, Boris Brezillon wrote: > Some drivers might need to tweak the block size and wait cycles > values > to get better performances. > Create and export the sun4i_dma_set_chan_config() to do that. > > Signed-off-by: Boris Brezillon > --- > drivers/dma/sun4i-dma.c

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Hi Vinod, On Mon, 7 Mar 2016 20:24:29 +0530 Vinod Koul wrote: > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > > +/* Dedicated DMA parameter register layout */ > > +#define SUN4I_DDMA_PARA_DST_DATA_BLK_SIZE(n) (((n) - 1) << 24) > > +#define SUN4I_DDMA_PARA_DST_WAIT_CYCL

Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > +/* Dedicated DMA parameter register layout */ > +#define SUN4I_DDMA_PARA_DST_DATA_BLK_SIZE(n) (((n) - 1) << 24) > +#define SUN4I_DDMA_PARA_DST_WAIT_CYCLES(n) (((n) - 1) << 16) > +#define SUN4I_DDMA_PARA_SRC_DATA_BLK_SIZE(n) (((n)

[PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Some drivers might need to tweak the block size and wait cycles values to get better performances. Create and export the sun4i_dma_set_chan_config() to do that. Signed-off-by: Boris Brezillon --- drivers/dma/sun4i-dma.c | 44 ++- include/linux/dma/su