[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220730150001.e2tmrusybyherkra@viti.kaiser.cx>
Date: Sat, 30 Jul 2022 17:00:01 +0200
From: Martin Kaiser <martin@...ser.cx>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc: Kshitiz Varshney <kshitiz.varshney@....com>,
Horia Geanta <horia.geanta@....com>,
Pankaj Gupta <pankaj.gupta@....com>,
Varun Sethi <V.Sethi@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
Iuliana Prodan <iuliana.prodan@....com>,
Gaurav Jain <gaurav.jain@....com>,
Rahul Kumar Yadav <rahulkumar.yadav@....com>,
Vabhav Sharma <vabhav.sharma@....com>,
Sahil Malhotra <sahil.malhotra@....com>,
Matt Mackall <mpm@...enic.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Steffen Trumtrar <s.trumtrar@...gutronix.de>,
PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>,
linux-imx@....com, linux-crypto@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] Moving init_completion before request_irq
Hello Kshitiz & Ahmad,
Thus wrote Ahmad Fatoum (a.fatoum@...gutronix.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.
Powered by blists - more mailing lists