From: Lars-Peter Clausen <lars@metafoo.de>
To: Paul Cercueil <paul@crapouillou.net>, madhuparnabhowmik10@gmail.com
Cc: dan.j.williams@intel.com, vkoul@kernel.org,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
andrianov@ispras.ru, ldv-project@linuxtesting.org
Subject: Re: [PATCH] drivers/dma/dma-jz4780: Fix race condition between probe and irq handler
Date: Thu, 20 Aug 2020 20:23:35 +0200 [thread overview]
Message-ID: <e1961c04-e2aa-fe3a-fb84-bb3b33fae5dc@metafoo.de> (raw)
In-Reply-To: <ZM2DFQ.KQQJYLJ02WTD3@crapouillou.net>
On 8/20/20 1:59 PM, Paul Cercueil wrote:
> Hi,
>
> Le dim. 16 août 2020 à 12:52, madhuparnabhowmik10@gmail.com a écrit :
>> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>>
>> In probe IRQ is requested before zchan->id is initialized which can be
>> read in the irq handler. Hence, shift request irq and enable clock after
>> other initializations complete. Here, enable clock part is not part of
>> the race, it is just shifted down after request_irq to keep the error
>> path same as before.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> I don't think there is a race at all, the interrupt handler won't be
> called before the DMA is registered.
>
From a purely formal verification perspective there is a bug. The
interrupt could fire if i.e. the hardware is buggy or something. In
general it is a good idea to not request the IRQ until all the resources
that are used in the interrupt handler are properly set up. Even if you
know that in practice the interrupt will never fire this early.
next prev parent reply other threads:[~2020-08-20 18:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-16 7:22 [PATCH] drivers/dma/dma-jz4780: Fix race condition between probe and irq handler madhuparnabhowmik10
2020-08-20 11:59 ` Paul Cercueil
2020-08-20 17:52 ` Madhuparna Bhowmik
2020-08-20 18:23 ` Lars-Peter Clausen [this message]
2020-08-20 18:46 ` Paul Cercueil
2020-08-21 3:16 ` Madhuparna Bhowmik
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=e1961c04-e2aa-fe3a-fb84-bb3b33fae5dc@metafoo.de \
--to=lars@metafoo.de \
--cc=andrianov@ispras.ru \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madhuparnabhowmik10@gmail.com \
--cc=paul@crapouillou.net \
--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