RE: [PATCH v7 2/3] hw_random: cctrng: introduce Arm CryptoCell driver

From: Hadar Gat
Date: Wed Apr 22 2020 - 06:37:43 EST


> > > > > > +static int cctrng_probe(struct platform_device *pdev) {
>
> > > > > > + /* register the driver isr function */
> > > > > > + rc = devm_request_irq(dev, irq, cc_isr, IRQF_SHARED,
> > > > > > + "cctrng", drvdata);
> > > > >
> > > > > Shoudn't this be done after clearing the pending interrupts below?
> > > >
> > > > I'm not sure what do you mean in your question...
> > > > I assume you're suggesting that the registration of the driver ISR
> > > > function
> > > should be done only after clearing the pending interrupts?!
> > >
> > > Indeed.
> > >
> > > > Anyway, any pending interrupt that might exist is irrelevant to
> > > > the current cctrng driver which just started (we're in the probe
> > > > function)
> > >
> > > If there is a pending interrupt, your interrupt handler (which
> > > returns IRQ_NONE in this case) will be called repeatedly, until the
> > > driver gets to clearing the pending interrupts below, or until the
> > > interrupt core decides to give up, and disable it for good.
> >
> > Ok, I get your point now.
> > But note that when the cctrng HW boots, the default is that all interrupts
> are masked, hence the interrupt handler will not be called.
>
> Is that also the case when booting into a new kernel using kexec?

Well.. no. â
A fix is needed here to consider also the case of kexec.
I'll fix that in another patch.
Thanks!