Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210823075651.GA3717293@localhost.localdomain
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Matti Vaittinen and committed by
Mark Brown
ad3ead1e c049742f

+5 -4
+1 -1
drivers/regulator/irq_helpers.c
··· 184 184 * If retry_count exceeds the given safety limit we call IC specific die 185 185 * handler which can try disabling regulator(s). 186 186 * 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. 188 188 * 189 189 * We could try disabling all associated rdevs - but we might shoot 190 190 * ourselves in the head and leave the problematic regulator enabled. So
+4 -3
include/linux/regulator/driver.h
··· 527 527 * active events as core does not clean the map data. 528 528 * REGULATOR_FAILED_RETRY can be returned to indicate that the 529 529 * 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. 532 532 * @renable: Optional callback to check status (if HW supports that) before 533 533 * re-enabling IRQ. If implemented this should clear the error 534 534 * flags so that errors fetched by regulator_get_error_flags() ··· 537 537 * REGULATOR_FAILED_RETRY can be returned to 538 538 * indicate that the status reading from IC failed. If this is 539 539 * 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. 541 542 * Returning zero indicates that the problem in HW has been solved 542 543 * and IRQ will be re-enabled. Returning REGULATOR_ERROR_ON 543 544 * indicates the error condition is still active and keeps IRQ