[PATCH 3/6] iio: adc: versal-sysmon: disable interrupts on shutdown
Andy Shevchenko
andriy.shevchenko at intel.com
Tue Nov 3 02:10:41 PST 2026
On Mon, Nov 02, 2026 at 05:51:09PM +0530, Amit Kumar Mahapatra wrote:
> Interrupt teardown is registered with devm_add_action_or_reset(), so
> sysmon_disable_interrupts() runs when the driver is unbound but not when
> the system shuts down: device_shutdown() invokes only the driver's
> .shutdown callback, which this driver does not implement.
>
> The device is therefore left with its alarm interrupts enabled in
> hardware once Linux has stopped servicing them.
>
> Add a .shutdown callback performing the same teardown, so the device is
> quiesced before control is handed on. The helper lives in the core
> module, so it is exported for the platform front-end. It skips a
> device described without an interrupt, which never set up interrupt
> handling.
>
> Disabling the interrupts at shutdown is safe to have and not a must have
> requirement for shutdown.
...
> + struct iio_dev *indio_dev = dev_get_drvdata(dev);
> + struct sysmon *sysmon = iio_priv(indio_dev);
Side Q to Jonathan: How do you see having a helper that unites these two?
Something like void *iio_priv_from_drvdata(struct device *dev)
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list