[PATCH] iio: adc: meson_saradc: Better handle BL30 not releaseing the hardware

Martin Blumenstingl martin.blumenstingl at googlemail.com
Sat Feb 18 07:50:33 PST 2023


Hi Uwe,

On Thu, Feb 16, 2023 at 3:07 PM Uwe Kleine-König
<u.kleine-koenig at pengutronix.de> wrote:
>
> meson_sar_adc_lock() might return an error if BL30 doesn't release its
> lock on the hardware. Just returning early from .remove() is wrong
> however as this keeps the clocks and regulators on which is never
> cleaned up later.
>
> So only skip hardware accesses with an error message if
> meson_sar_adc_lock() fails, but disable clocks and regulator and return
> zero to suppress another error message by the driver core.
The clocks and regulators are shared with the BL30 firmware.
In practice I have not seen meson_sar_adc_lock() fail yet.

I think it's enough to print an error message if locking fails, then
continue as if nothing happened. Unlocking obviously has to be skipped
as well in this case.
There's not much we can do to recover from this and I consider the
BL30 firmware to be hanging (or broken) if it doesn't release the
lock.


Best regards,
Martin



More information about the linux-arm-kernel mailing list