Skip to content

Commit ad3ead1

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: Documentation fix for regulator error notification helper
The helper to send IRQ notification for regulator errors had still old description mentioning calling BUG() as a last resort when error status reading has kept failing for more times than a given threshold. The impementation calling BUG() did never end-up in-tree but was replaced by hopefully more sophisticated handler trying to power-off the system. Fix the documentation to reflect actual behaviour. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c049742 commit ad3ead1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/regulator/irq_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static irqreturn_t regulator_notifier_isr(int irq, void *data)
184184
* If retry_count exceeds the given safety limit we call IC specific die
185185
* handler which can try disabling regulator(s).
186186
*
187-
* If no die handler is given we will just bug() as a last resort.
187+
* If no die handler is given we will just power-off as a last resort.
188188
*
189189
* We could try disabling all associated rdevs - but we might shoot
190190
* ourselves in the head and leave the problematic regulator enabled. So

include/linux/regulator/driver.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ struct regulator_irq_data {
527527
* active events as core does not clean the map data.
528528
* REGULATOR_FAILED_RETRY can be returned to indicate that the
529529
* status reading from IC failed. If this is repeated for
530-
* fatal_cnt times the core will call die() callback or BUG()
531-
* as a last resort to protect the HW.
530+
* fatal_cnt times the core will call die() callback or power-off
531+
* the system as a last resort to protect the HW.
532532
* @renable: Optional callback to check status (if HW supports that) before
533533
* re-enabling IRQ. If implemented this should clear the error
534534
* flags so that errors fetched by regulator_get_error_flags()
@@ -537,7 +537,8 @@ struct regulator_irq_data {
537537
* REGULATOR_FAILED_RETRY can be returned to
538538
* indicate that the status reading from IC failed. If this is
539539
* repeated for 'fatal_cnt' times the core will call die()
540-
* callback or BUG() as a last resort to protect the HW.
540+
* callback or if die() is not populated then attempt to power-off
541+
* the system as a last resort to protect the HW.
541542
* Returning zero indicates that the problem in HW has been solved
542543
* and IRQ will be re-enabled. Returning REGULATOR_ERROR_ON
543544
* indicates the error condition is still active and keeps IRQ

0 commit comments

Comments
 (0)