Re: [PATCH] ASoC: SDCA: Write init table on function status IRQ

From: Charles Keepax

Date: Tue Mar 24 2026 - 07:30:19 EST


On Tue, Mar 24, 2026 at 08:13:01AM -0300, Cássio Gabriel wrote:
> On Tue, Mar 24, 2026 at 09:20:38AM +0000, Charles Keepax wrote:
> > On Tue, Mar 24, 2026 at 12:03:59AM -0300, Cássio Gabriel wrote:
> > > The function status IRQ handler currently acknowledges
> > > SDCA_CTL_ENTITY_0_FUNCTION_NEEDS_INITIALIZATION but does
> > > not perform the function initialization writes. Since the
> > > handler clears the function status register afterwards,
> > > the request is lost.
> > >
> > > Use sdca_regmap_write_init() when the initialization status
> > > bit is reported and apply the writes through the device regmap
> > > stored in the IRQ data, matching the existing class-function
> > > boot and resume paths.
> >
> > Generally speaking the init writes should have happened as part
> > of the device boot. What are the circumstances where you are
> > encountering this?
>
> This was found by inspection rather than from a concrete hardware
> reproducer.
>
> What drew my attention was that the current class-function boot and
> resume paths already handle FUNCTION_NEEDS_INITIALIZATION by replaying
> the init table, while the function-status IRQ handler would just
> acknowledge and clear the same bit. My concern was that, if the bit can
> legitimately appear in the normal IRQ path, it would be dropped without
> taking the same initialization action.
>
> I do not currently have hardware evidence showing that this case is
> actually reachable, so I will drop the patch for now.

Cool, yeah I think the situation is a little more complex that it
looks (we should perhaps update the comment to say so), because
it seems likely if one gets a function needs init outside of
the normal boot proceedure that the part has reset whilst
operating. This may well require more handling and I would
be keen to work through it when we have some hardware that is
hitting the case to test on.

Thanks,
Charles