On Tue, Oct 24, 2023 at 02:26:24PM +0100, Mark Brown wrote: > On Tue, Oct 24, 2023 at 03:08:42PM +0200, Oleksij Rempel wrote: > > > Add interrupt support for under-voltage notification. This functionality > > can be used on systems capable to detect under-voltage state and having > > enough capacity to let the SoC do some emergency preparation. > > > > This change enforce default policy to shutdown system as soon as > > interrupt is triggered. > > ... > > > +static irqreturn_t reg_fixed_under_voltage_irq_handler(int irq, void *data) > > +{ > > + hw_protection_shutdown("Critical voltage drop reached", > > + FV_DEF_EMERG_SHUTDWN_TMO); > > + > > + return IRQ_HANDLED; > > +} > > We need a bit more policy here - the regulator could be critical to > system function but it could also be well isolated and just affecting > whatever device it's directly supplying in a way that the system can > tolerate and might even want to (eg, for something like a SD card or USB > port where end users are plugging in external hardware). Hm, how about devicetree property to indicate system critical nature of the regulator. For example "system-critical-regulator" or "system-critical-undervoltage-interrupt" ? Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |