From: Dmitry Osipenko <digetx@gmail.com>
To: Sowjanya Komatineni <skomatineni@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
Mantravadi Karthik <mkarthik@nvidia.com>,
Shardar Mohammed <smohammed@nvidia.com>,
Timo Alho <talho@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH V11 3/5] i2c: tegra: Add DMA support
Date: Wed, 6 Feb 2019 23:02:26 +0300 [thread overview]
Message-ID: <528ecd87-3f14-9e29-fb24-34802eeb0cb7@gmail.com> (raw)
In-Reply-To: <BYAPR12MB33987640AE0D0C76ADB42BF1C26F0@BYAPR12MB3398.namprd12.prod.outlook.com>
06.02.2019 22:56, Sowjanya Komatineni пишет:
>
>>>>> Oh, another important moment is that physically contiguous dma_buf
>>>>> allocation isn't guaranteed by the DMA API. This may become a
>>>>> problem for T186+ that can transfer up to 64K. We need to enforce
>>>>> the contiguous-allocation requirement by using
>>>>> dma_alloc_attrs(DMA_ATTR_FORCE_CONTIGUOUS) instead of the
>>>>> dma_alloc_coherent(), please see my other comment below.
>>>>
>>>> Actually I don't think that's necessary here.
>>>> DMA_ATTR_FORCE_CONTIGUOUS only seems relevant if you've got an IOMMU
>>>> attached to the device to make sure the physical memory is also contiguous.
>>>>
>>>> See this extract from Documentation/DMA-attributes.txt:
>>>>
>>>> | DMA_ATTR_FORCE_CONTIGUOUS
>>>> | -------------------------
>>>> |
>>>> | By default DMA-mapping subsystem is allowed to assemble the buffer
>>>> | allocated by dma_alloc_attrs() function from individual pages if it
>>>> | can be mapped as contiguous chunk into device dma address space. By
>>>> | specifying this attribute the allocated buffer is forced to be
>>>> | contiguous also in physical memory.
>>>>
>>>> We don't have an IOMMU attached to I2C or APBDMA, so this can't
>>>> happen and even if we had an IOMMU attached, all we care about is the
>>>> device's DMA address space, which means IOVA space, and that would
>>>> still be guaranteed to be contiguous, according to the above.
>>>
>>> Yes, but doesn't T186+ have IOMMU support for the DMA controller?
>>>
>>
>> Ah, sorry I probably skimmed way too quickly thorough the message. Hmm.. well, seems I was wrong.
>>
>> Sowjanya, after all looks like it should be fine to use the default dma_alloc_coherent() helper. Please put it back in v14.
>
> Latest V14 uses dma_alloc_coherent along with below fixes.
> - Fixed fifo trig level to do register write with constructed value from scratch as flush is done prior to that and no other bits other than trig level. So writing value direct is simpler
> - Fixed to account DVC offset for FIFO register during dma slave config source and destination addresses
> - Also in 5th patch in series, updated to use interface timing flag in hw feature as tegra114 and prior doesn’t support interface timing register so allowing programming of timing register only for later tegra chips. Tegra114 and prior uses fixed TLOW and THIGH which are part of hw feature already.
>
> Hopefully all fixes are in. Tested by forcing DMA only and PIO Only and also DMA/PIO back-to-back.
Thanks, I'll try it out tomorrow.
next prev parent reply other threads:[~2019-02-06 20:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 8:56 [PATCH V11 1/5] i2c: tegra: sort all the include headers alphabetically Sowjanya Komatineni
2019-02-05 8:56 ` [PATCH V11 2/5] i2c: tegra: add bus clear Master Support Sowjanya Komatineni
2019-02-05 8:56 ` [PATCH V11 3/5] i2c: tegra: Add DMA support Sowjanya Komatineni
2019-02-05 14:26 ` Dmitry Osipenko
2019-02-05 16:41 ` Sowjanya Komatineni
2019-02-05 16:54 ` Dmitry Osipenko
2019-02-06 14:53 ` Thierry Reding
2019-02-06 14:56 ` Dmitry Osipenko
2019-02-06 17:37 ` Dmitry Osipenko
2019-02-06 19:56 ` Sowjanya Komatineni
2019-02-06 20:02 ` Dmitry Osipenko [this message]
2019-02-07 7:16 ` Christoph Hellwig
2019-02-05 8:56 ` [PATCH V11 4/5] i2c: tegra: update transfer timeout Sowjanya Komatineni
2019-02-05 8:56 ` [PATCH V11 5/5] i2c: tegra: add i2c interface timing support Sowjanya Komatineni
2019-02-05 14:28 ` 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=528ecd87-3f14-9e29-fb24-34802eeb0cb7@gmail.com \
--to=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 \
--cc=thierry.reding@gmail.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