Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 19:27, Dmitry Osipenko пишет: > 31.01.2019 19:01, Thierry Reding пишет: >> On Thu, Jan 31, 2019 at 06:02:45PM +0300, Dmitry Osipenko wrote: >>> 31.01.2019 17:43, Thierry Reding пишет: On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: > 31.01.2019 15:06, Thierry Re

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 21:08, Dmitry Osipenko пишет: > 31.01.2019 19:55, Dmitry Osipenko пишет: > +config I2C_TEGRA_DMA_SUPPORT > + bool "NVIDIA Tegra internal I2C controller DMA support" > + depends on I2C_TEGRA > + depends on TEGRA20_APB_DMA && ARCH_TEGRA_2x_SOC > + depends on TEGRA20_APB_DMA

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 19:55, Dmitry Osipenko пишет: > config I2C_TEGRA > tristate "NVIDIA Tegra internal I2C controller" > depends on ARCH_TEGRA > select TEGRA20_APB_DMA if (I2C_TEGRA_DMA_SUPPORT && ARCH_TEGRA_2x_SOC) > select TEGRA20_APB_DMA if (I2C_TEGRA_DMA_SUPPORT && ARCH_TEGRA_3x_

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 18:02, Dmitry Osipenko пишет: > 31.01.2019 17:43, Thierry Reding пишет: >> On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: >>> 31.01.2019 15:06, Thierry Reding пишет: On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: > 30.01.2019 19:01, Sowjanya K

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 19:01, Thierry Reding пишет: > On Thu, Jan 31, 2019 at 06:02:45PM +0300, Dmitry Osipenko wrote: >> 31.01.2019 17:43, Thierry Reding пишет: >>> On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: 31.01.2019 15:06, Thierry Reding пишет: > On Thu, Jan 31, 2019 at 03:05

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 19:27, Dmitry Osipenko пишет: > 31.01.2019 19:01, Thierry Reding пишет: >> On Thu, Jan 31, 2019 at 06:02:45PM +0300, Dmitry Osipenko wrote: >>> 31.01.2019 17:43, Thierry Reding пишет: On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: > 31.01.2019 15:06, Thierry Re

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Thierry Reding
On Thu, Jan 31, 2019 at 06:02:45PM +0300, Dmitry Osipenko wrote: > 31.01.2019 17:43, Thierry Reding пишет: > > On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: > >> 31.01.2019 15:06, Thierry Reding пишет: > >>> On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: >

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 17:43, Thierry Reding пишет: > On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: >> 31.01.2019 15:06, Thierry Reding пишет: >>> On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: 30.01.2019 19:01, Sowjanya Komatineni пишет: >>> [...] > diff --git a/d

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Thierry Reding
On Thu, Jan 31, 2019 at 05:06:18PM +0300, Dmitry Osipenko wrote: > 31.01.2019 15:06, Thierry Reding пишет: > > On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: > >> 30.01.2019 19:01, Sowjanya Komatineni пишет: > > [...] > >>> diff --git a/drivers/i2c/busses/i2c-tegra.c > >>> b/driv

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Dmitry Osipenko
31.01.2019 15:06, Thierry Reding пишет: > On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: >> 30.01.2019 19:01, Sowjanya Komatineni пишет: > [...] >>> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c > [...] >>> + return -EIO; >>> + } >>> + >>

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-31 Thread Thierry Reding
On Thu, Jan 31, 2019 at 03:05:48AM +0300, Dmitry Osipenko wrote: > 30.01.2019 19:01, Sowjanya Komatineni пишет: [...] > > diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c [...] > > + return -EIO; > > + } > > + > > + dma_desc->callback = tegra_i2c_dma_comple

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Dmitry Osipenko
В Thu, 31 Jan 2019 03:34:59 + Sowjanya Komatineni пишет: > > I2C_INT_ALL_PACKETS_XFER_COMPLETE shall be masked for the PIO mode > > I2C_INT_PACKET_XFER_COMPLETE shall be masked for the DMA mode, if > > I'm not missing something. > for packets with repeated start or continue xfer, > PACKET_XF

RE: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Sowjanya Komatineni
> I2C_INT_ALL_PACKETS_XFER_COMPLETE shall be masked for the PIO mode > I2C_INT_PACKET_XFER_COMPLETE shall be masked for the DMA mode, if I'm not > missing something. > for packets with repeated start or continue xfer, PACKET_XFER_COMPLETE will be triggers for packets with stop bit, both PACKET_XF

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Dmitry Osipenko
31.01.2019 5:24, Sowjanya Komatineni пишет: > time_left = wait_for_completion_timeout(&i2c_dev->msg_complete, > TEGRA_I2C_TIMEOUT); > tegra_i2c_mask_irq(i2c_dev, int_mask); > > if (time_left == 0) { > dev_err(i2c_de

RE: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Sowjanya Komatineni
> >>> time_left = wait_for_completion_timeout(&i2c_dev->msg_complete, > >>> TEGRA_I2C_TIMEOUT); > >>> tegra_i2c_mask_irq(i2c_dev, int_mask); > >>> > >>> if (time_left == 0) { > >>> dev_err(i2c_dev->dev, "i2c transfer timed out\n"); > >>> +

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Dmitry Osipenko
31.01.2019 4:19, Sowjanya Komatineni пишет: >>> + dma_sync_single_for_device(i2c_dev->dev, >>> + i2c_dev->dma_phys, >>> + xfer_size, >>> + DMA_FRO

RE: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Sowjanya Komatineni
> > + dma_sync_single_for_device(i2c_dev->dev, > > + i2c_dev->dma_phys, > > + xfer_size, > > + DMA_FROM_DEVICE); > > + ret = teg

Re: [PATCH V7 3/5] i2c: tegra: Add DMA Support

2019-01-30 Thread Dmitry Osipenko
30.01.2019 19:01, Sowjanya Komatineni пишет: > This patch adds DMA support for Tegra I2C. > > Tegra I2C TX and RX FIFO depth is 8 words. PIO mode is used for > transfer size of the max FIFO depth and DMA mode is used for > transfer size higher than max FIFO depth to save CPU overhead. > > PIO mod