From: Martin Kaiser <martin@kaiser.cx>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Kshitiz Varshney <kshitiz.varshney@nxp.com>,
Horia Geanta <horia.geanta@nxp.com>,
Pankaj Gupta <pankaj.gupta@nxp.com>,
Varun Sethi <V.Sethi@nxp.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
Iuliana Prodan <iuliana.prodan@nxp.com>,
Gaurav Jain <gaurav.jain@nxp.com>,
Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>,
Vabhav Sharma <vabhav.sharma@nxp.com>,
Sahil Malhotra <sahil.malhotra@nxp.com>,
Matt Mackall <mpm@selenic.com>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Steffen Trumtrar <s.trumtrar@pengutronix.de>,
PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>,
linux-imx@nxp.com, linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] Moving init_completion before request_irq
Date: Sat, 30 Jul 2022 17:00:01 +0200 [thread overview]
Message-ID: <20220730150001.e2tmrusybyherkra@viti.kaiser.cx> (raw)
In-Reply-To: <e78ff391-3141-bf0b-6fe1-4ff7204414fb@pengutronix.de>
Hello Kshitiz & Ahmad,
Thus wrote Ahmad Fatoum (a.fatoum@pengutronix.de):
> > + init_completion(&rngc->rng_op_done);
> > +
> > ret = devm_request_irq(&pdev->dev,
> > irq, imx_rngc_irq, 0, pdev->name, (void *)rngc);
> This should probably be moved below imx_rngc_irq_mask_clear(rngc).
> init_completion can stay where it is. That way:
I agree with Ahmad that this is the better approach.
We should clear pending irqs and disable interrupt sources on the
hardware level before we install our irq handler.
Best regards,
Martin
> - You initialize rngc fully before registering the IRQ handler
> - You don't handle pending IRQs that you want to dismiss anyway
> - If the IRQ happens to be because of a SEED_DONE due to a previous
> boot stage, you don't end up completing the completion prematurely.
prev parent reply other threads:[~2022-07-30 15:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-29 10:02 Kshitiz Varshney
2022-07-29 10:21 ` Ahmad Fatoum
2022-07-30 15:00 ` Martin Kaiser [this message]
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=20220730150001.e2tmrusybyherkra@viti.kaiser.cx \
--to=martin@kaiser.cx \
--cc=V.Sethi@nxp.com \
--cc=a.fatoum@pengutronix.de \
--cc=davem@davemloft.net \
--cc=festevam@gmail.com \
--cc=gaurav.jain@nxp.com \
--cc=herbert@gondor.apana.org.au \
--cc=horia.geanta@nxp.com \
--cc=iuliana.prodan@nxp.com \
--cc=kernel@pengutronix.de \
--cc=kshitiz.varshney@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=pankaj.gupta@nxp.com \
--cc=prasannatsmkumar@gmail.com \
--cc=rahulkumar.yadav@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=s.trumtrar@pengutronix.de \
--cc=sahil.malhotra@nxp.com \
--cc=shawnguo@kernel.org \
--cc=vabhav.sharma@nxp.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
all inboxes | Powered by JetHome®