From: Dmitry Osipenko <digetx@gmail.com>
To: Jon Hunter <jonathanh@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Vinod Koul <vkoul@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Ben Dooks <ben.dooks@codethink.co.uk>
Cc: dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] dmaengine: tegra-apb: Error out if DMA_PREP_INTERRUPT flag is unset
Date: Thu, 30 May 2019 20:32:17 +0300 [thread overview]
Message-ID: <359abcbb-b3bd-ad32-9f35-15bb9b25f3b0@gmail.com> (raw)
In-Reply-To: <9b0e0d20-6386-a38a-1347-4264d249cb44@nvidia.com>
30.05.2019 15:01, Jon Hunter пишет:
>
> On 29/05/2019 22:43, Dmitry Osipenko wrote:
>> Apparently driver was never tested with DMA_PREP_INTERRUPT flag being
>> unset since it completely disables interrupt handling instead of skipping
>> the callbacks invocations, hence putting channel into unusable state.
>>
>> The flag is always set by all of kernel drivers that use APB DMA, so let's
>> error out in otherwise case for consistency. It won't be difficult to
>> support that case properly if ever will be needed.
>>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>> drivers/dma/tegra20-apb-dma.c | 12 ++++++++++--
>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
>> index cf462b1abc0b..2c84a660ba36 100644
>> --- a/drivers/dma/tegra20-apb-dma.c
>> +++ b/drivers/dma/tegra20-apb-dma.c
>> @@ -988,8 +988,12 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
>> csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
>> }
>>
>> - if (flags & DMA_PREP_INTERRUPT)
>> + if (flags & DMA_PREP_INTERRUPT) {
>> csr |= TEGRA_APBDMA_CSR_IE_EOC;
>> + } else {
>> + WARN_ON_ONCE(1);
>> + return NULL;
>> + }
>>
>> apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
>>
>> @@ -1131,8 +1135,12 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
>> csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
>> }
>>
>> - if (flags & DMA_PREP_INTERRUPT)
>> + if (flags & DMA_PREP_INTERRUPT) {
>> csr |= TEGRA_APBDMA_CSR_IE_EOC;
>> + } else {
>> + WARN_ON_ONCE(1);
>> + return NULL;
>> + }
>>
>> apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
>
> Looks good to me.
>
> Acked-by: Jon Hunter <jonathanh@nvidia.com>
>
> Cheers
> Jon
>
Thanks
next prev parent reply other threads:[~2019-05-30 17:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 21:43 [PATCH v1] dmaengine: tegra-apb: Error out if DMA_PREP_INTERRUPT flag is unset Dmitry Osipenko
2019-05-30 12:01 ` Jon Hunter
2019-05-30 17:32 ` Dmitry Osipenko [this message]
2019-06-04 12:16 ` Vinod Koul
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=359abcbb-b3bd-ad32-9f35-15bb9b25f3b0@gmail.com \
--to=digetx@gmail.com \
--cc=ben.dooks@codethink.co.uk \
--cc=dmaengine@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=vkoul@kernel.org \
/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).