linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Akhil R <akhilrajeev@nvidia.com>,
	dmaengine@vger.kernel.org, ldewangan@nvidia.com,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	p.zabel@pengutronix.de, thierry.reding@gmail.com,
	vkoul@kernel.org
Subject: Re: [PATCH] dmaengine: tegra: Use platform_get_irq() to get IRQ resource
Date: Mon, 16 May 2022 09:42:07 +0100	[thread overview]
Message-ID: <9539ac65-0e3e-9a2b-c21e-5602d6fbbe3e@nvidia.com> (raw)
In-Reply-To: <7673dbb7-6a85-6ab6-f1a4-a6f4724c0b90@nvidia.com>

Vinod,

On 05/05/2022 10:18, Jon Hunter wrote:
> 
> On 05/05/2022 10:14, Akhil R wrote:
>> Use platform_irq_get() instead platform_get_resource() for IRQ resource
>> to fix the probe failure. platform_get_resource() fails to fetch the IRQ
>> resource as it might not be ready at that time.
>>
>> platform_irq_get() is also the recommended way to get interrupt as it
>> directly gives the IRQ number and no conversion from resource is
>> required.
>>
>> Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver")
>> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
>> Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
>> ---
>>   drivers/dma/tegra186-gpc-dma.c | 12 ++++--------
>>   1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/dma/tegra186-gpc-dma.c 
>> b/drivers/dma/tegra186-gpc-dma.c
>> index 97fe0e9e9b83..3951db527dec 100644
>> --- a/drivers/dma/tegra186-gpc-dma.c
>> +++ b/drivers/dma/tegra186-gpc-dma.c
>> @@ -1328,7 +1328,6 @@ static int tegra_dma_probe(struct 
>> platform_device *pdev)
>>       struct iommu_fwspec *iommu_spec;
>>       unsigned int stream_id, i;
>>       struct tegra_dma *tdma;
>> -    struct resource    *res;
>>       int ret;
>>       cdata = of_device_get_match_data(&pdev->dev);
>> @@ -1367,16 +1366,13 @@ static int tegra_dma_probe(struct 
>> platform_device *pdev)
>>       for (i = 0; i < cdata->nr_channels; i++) {
>>           struct tegra_dma_channel *tdc = &tdma->channels[i];
>> +        tdc->irq = platform_get_irq(pdev, i);
>> +        if (tdc->irq < 0)
>> +            return tdc->irq;
>> +
>>           tdc->chan_base_offset = TEGRA_GPCDMA_CHANNEL_BASE_ADD_OFFSET +
>>                       i * cdata->channel_reg_size;
>> -        res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
>> -        if (!res) {
>> -            dev_err(&pdev->dev, "No irq resource for chan %d\n", i);
>> -            return -EINVAL;
>> -        }
>> -        tdc->irq = res->start;
>>           snprintf(tdc->name, sizeof(tdc->name), "gpcdma.%d", i);
>> -
>>           tdc->tdma = tdma;
>>           tdc->id = i;
>>           tdc->slave_id = -1;
> 
> 
> Thanks!
> 
> Reviewed-by: Jon Hunter <jonathanh@nvidia.com>


OK to pick this up for -next/5.19? This is preventing the GPC DMA driver 
from working.

Jon

-- 
nvpublic

  reply	other threads:[~2022-05-16  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  9:14 [PATCH] dmaengine: tegra: Use platform_get_irq() to get IRQ resource Akhil R
2022-05-05  9:18 ` Jon Hunter
2022-05-16  8:42   ` Jon Hunter [this message]
2022-05-05 13:38 ` Thierry Reding
2022-05-16 11:29 ` 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=9539ac65-0e3e-9a2b-c21e-5602d6fbbe3e@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=akhilrajeev@nvidia.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --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).