regulator (max5970): Fix IRQ handler

Message ID 20240130150257.3643657-1-naresh.solanki@9elements.com
State New
Headers
Series regulator (max5970): Fix IRQ handler |

Commit Message

Naresh Solanki Jan. 30, 2024, 3:02 p.m. UTC
  From: Patrick Rudolph <patrick.rudolph@9elements.com>

The max5970 datasheet gives the impression that IRQ status bits must
be cleared by writing a one to set bits, as those are marked with 'R/C',
however tests showed that a zero must be written.

Fixes an IRQ storm as the interrupt handler actually clears the IRQ
status bits.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
---
 drivers/regulator/max5970-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a
  

Comments

Mark Brown Jan. 30, 2024, 7:38 p.m. UTC | #1
On Tue, 30 Jan 2024 20:32:56 +0530, Naresh Solanki wrote:
> The max5970 datasheet gives the impression that IRQ status bits must
> be cleared by writing a one to set bits, as those are marked with 'R/C',
> however tests showed that a zero must be written.
> 
> Fixes an IRQ storm as the interrupt handler actually clears the IRQ
> status bits.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator (max5970): Fix IRQ handler
      commit: a3fa9838e8140584a6f338e8516f2b05d3bea812

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
  

Patch

diff --git a/drivers/regulator/max5970-regulator.c b/drivers/regulator/max5970-regulator.c
index bc88a40a88d4..830a1c4cd705 100644
--- a/drivers/regulator/max5970-regulator.c
+++ b/drivers/regulator/max5970-regulator.c
@@ -392,7 +392,7 @@  static int max597x_regmap_read_clear(struct regmap *map, unsigned int reg,
 		return ret;
 
 	if (*val)
-		return regmap_write(map, reg, *val);
+		return regmap_write(map, reg, 0);
 
 	return 0;
 }