Skip to content

Commit 6966df4

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: Update protection IRQ helper docs
The documentation of IRQ notification helper had still references to first RFC implementation which called BUG() while trying to protect the hardware. Behaviour was improved as calling the BUG() was not a proper solution. Current implementation attempts to call poweroff if handling of potentially damaging error notification fails. Update the documentation to reflect the actual behaviour. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/0c9cc4bcf20c3da66fd5a85c97ee4288e5727538.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <[email protected]>
1 parent 7492b72 commit 6966df4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

include/linux/regulator/driver.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ struct regulator_irq_data {
499499
* best to shut-down regulator(s) or reboot the SOC if error
500500
* handling is repeatedly failing. If fatal_cnt is given the IRQ
501501
* handling is aborted if it fails for fatal_cnt times and die()
502-
* callback (if populated) or BUG() is called to try to prevent
502+
* callback (if populated) is called. If die() is not populated
503+
* poweroff for the system is attempted in order to prevent any
503504
* further damage.
504505
* @reread_ms: The time which is waited before attempting to re-read status
505506
* at the worker if IC reading fails. Immediate re-read is done
@@ -516,11 +517,12 @@ struct regulator_irq_data {
516517
* @data: Driver private data pointer which will be passed as such to
517518
* the renable, map_event and die callbacks in regulator_irq_data.
518519
* @die: Protection callback. If IC status reading or recovery actions
519-
* fail fatal_cnt times this callback or BUG() is called. This
520-
* callback should implement a final protection attempt like
521-
* disabling the regulator. If protection succeeded this may
522-
* return 0. If anything else is returned the core assumes final
523-
* protection failed and calls BUG() as a last resort.
520+
* fail fatal_cnt times this callback is called or system is
521+
* powered off. This callback should implement a final protection
522+
* attempt like disabling the regulator. If protection succeeded
523+
* die() may return 0. If anything else is returned the core
524+
* assumes final protection failed and attempts to perform a
525+
* poweroff as a last resort.
524526
* @map_event: Driver callback to map IRQ status into regulator devices with
525527
* events / errors. NOTE: callback MUST initialize both the
526528
* errors and notifs for all rdevs which it signals having

0 commit comments

Comments
 (0)