From: Thierry Reding <thierry.reding@gmail.com>
To: Sowjanya Komatineni <skomatineni@nvidia.com>
Cc: jonathanh@nvidia.com, mkarthik@nvidia.com, smohammed@nvidia.com,
talho@nvidia.com, digetx@gmail.com, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH V14 3/5] i2c: tegra: Add DMA support
Date: Thu, 7 Feb 2019 12:01:53 +0100 [thread overview]
Message-ID: <20190207110153.GA18518@ulmo> (raw)
In-Reply-To: <1549480569-24860-3-git-send-email-skomatineni@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 3787 bytes --]
On Wed, Feb 06, 2019 at 11:16:07AM -0800, Sowjanya Komatineni wrote:
> 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 mode needs full intervention of CPU to fill or empty FIFO's
> and also need to service multiple data requests interrupt for the
> same transaction. This adds delay between data bytes of the same
> transfer when CPU is fully loaded and some slave devices has
> internal timeout for no bus activity and stops transaction to
> avoid bus hang. DMA mode is helpful in such cases.
>
> DMA mode is also helpful for Large transfers during downloading or
> uploading FW over I2C to some external devices.
>
> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
> ---
> [V14] : Switched back to use dma_alloc_coherent as it guarentees contiguous device
> dma address space.
> Fixed FIFO Trigger level programming to construct value from scratch.
> Previous versions does register read-modify-write without masking.
> T20 has DVC offsets different to I2C. This version has fix to account DVC
> offset during dma slave configuration.
> [V13] : T20 has DVC used for some power controls. This version has fix for using
> proper DVC register offsets for DMA programming incase when used in DMA
> mode.
> [V12] : Replaced dma_alloc_coherent with dma_alloc_attrs to force the allocated
> buffer to be contiguous also in physical memory as Tegra194 supports max
> 64K and dma_alloc_coherent doesnt guarentee contiguous memory.
> Changed return code from EIO to EINVAL incase of failure to obtain dma
> descriptor.
> Fixed coding style check issues.
> [V11] : Replaced deprecated dmaengine_terminate_all with dmaengine_termine_async
> from non-atomic context and dmaengine_terminate_sync from atomic context.
> Fixed to program fifo trigger levels properly when transfer falls back to
> pio mode in case of dma slave configuration failure and other minor fixes.
> [V10] : APBDMA is replaced with GPCDMA on Tegra186 and Tegra194 designs.
> Added apbdma hw support flag to now allow Tegra186 and later use
> APBDMA driver.
> Added explicit flow control enable for DMA slave config and error handling.
> Moved releasing DMA resources to seperate function to reuse in
> multiple places.
> Updated to register tegra_i2c_driver from module level rather than subsys
> level.
> Other minor feedback
> [V9] : Rebased to 5.0-rc4
> Removed dependency of APB DMA in Kconfig and added conditional check
> in I2C driver to decide on using DMA mode.
> Changed back the allocation of dma buffer during i2c probe.
> Fixed FIFO triggers depending on DMA Vs PIO.
> [V8] : Moved back dma init to i2c probe, removed ALL_PACKETS_XFER_COMPLETE
> interrupt and using PACKETS_XFER_COMPLETE interrupt only and some
> other fixes
> Updated Kconfig for APB_DMA dependency
> [V7] : Same as V6
> [V6] : Updated for proper buffer allocation/freeing, channel release.
> Updated to use exact xfer size for syncing dma buffer.
> [V5] : Same as V4
> [V4] : Updated to allocate DMA buffer only when DMA mode.
> Updated to fall back to PIO mode when DMA channel request or
> buffer allocation fails.
> [V3] : Updated without additional buffer allocation.
> [V2] : Updated based on V1 review feedback along with code cleanup for
> proper implementation of DMA.
>
>
> drivers/i2c/busses/i2c-tegra.c | 411 ++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 367 insertions(+), 44 deletions(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-02-07 11:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-06 19:16 [PATCH V14 1/5] i2c: tegra: sort all the include headers alphabetically Sowjanya Komatineni
2019-02-06 19:16 ` [PATCH V14 2/5] i2c: tegra: add bus clear Master Support Sowjanya Komatineni
2019-02-07 18:26 ` Dmitry Osipenko
2019-02-06 19:16 ` [PATCH V14 3/5] i2c: tegra: Add DMA support Sowjanya Komatineni
2019-02-07 11:01 ` Thierry Reding [this message]
2019-02-07 13:57 ` Dmitry Osipenko
2019-02-07 15:23 ` Sowjanya Komatineni
2019-02-07 16:01 ` Dmitry Osipenko
2019-02-07 16:06 ` Thierry Reding
2019-02-07 16:08 ` Sowjanya Komatineni
2019-02-07 16:17 ` Dmitry Osipenko
2019-02-07 18:02 ` Sowjanya Komatineni
2019-02-07 18:22 ` Dmitry Osipenko
2019-02-07 14:52 ` Dmitry Osipenko
2019-02-07 15:11 ` Sowjanya Komatineni
2019-02-07 15:17 ` Dmitry Osipenko
2019-02-07 15:17 ` Sowjanya Komatineni
2019-02-07 15:56 ` Dmitry Osipenko
2019-02-07 16:02 ` Thierry Reding
2019-02-07 18:24 ` Dmitry Osipenko
2019-02-07 18:50 ` Dmitry Osipenko
2019-02-07 18:56 ` Sowjanya Komatineni
2019-02-07 19:03 ` Dmitry Osipenko
2019-02-07 19:14 ` Sowjanya Komatineni
2019-02-07 18:55 ` Dmitry Osipenko
2019-02-07 19:14 ` Dmitry Osipenko
2019-02-07 20:22 ` Dmitry Osipenko
2019-02-07 20:46 ` Dmitry Osipenko
2019-02-06 19:16 ` [PATCH V14 4/5] i2c: tegra: update transfer timeout Sowjanya Komatineni
2019-02-06 19:16 ` [PATCH V14 5/5] i2c: tegra: add i2c interface timing support Sowjanya Komatineni
2019-02-07 14:34 ` Dmitry Osipenko
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=20190207110153.GA18518@ulmo \
--to=thierry.reding@gmail.com \
--cc=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mkarthik@nvidia.com \
--cc=skomatineni@nvidia.com \
--cc=smohammed@nvidia.com \
--cc=talho@nvidia.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).