Re: [PATCH 1/3] spi: tegra210-quad: use device_reset_optional() instead of device_reset()

From: Breno Leitao
Date: Fri Mar 28 2025 - 09:18:53 EST


On Tue, Mar 25, 2025 at 06:05:28PM +0100, Thierry Reding wrote:

> > I want to come back to how the driver should behave. We probably want to
> > distinguish what is the correct behaviour we expect from the driver,
> > they are (IMO):
> >
> > 1) The reset handlers are NOT optional and the device should fail to
> > probe.
> >
> > 2) The reset handlers ARE optional, and we should mark them as such.
> >
> > Can you shed some light on what is the right behaviour we want to
> > implement?
> >
> > From what I am hearing, we are more inclined towards 2). Is this
> > correct?
>
> Yes, I think 2) is what I'd be inclined towards. _RST is clearly not
> available for at least certain firmware releases, so they are de-facto
> optional.
>
> Even if they are ever implemented, it'd be wise to keep supporting the
> case where they are not available, so treating them as optional is the
> right way to go.

Thanks for the clarification, Thierry!

Do you know if this reset method also optional for device tree devices?

So, these are the options we have now, based on the clarification above:

1) Mark the device_reset() as optional for this device, as proposed in
this current patch.

2) Ignore that this is optional completely, and let that "device failed"
message to go be displayed every time the device is probed and restarted.

3) Create an "device_reset_optional_on_acpi_but_not_on_dt()" method if
this method is only optional on ACPI devices. Waiting on Thierry to
clarify this part.