This is a note to let you know that I've just added the patch titled mfd: stpmic1: Fix swapped mask/unmask in irq chip to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mfd-stpmic1-fix-swapped-mask-unmask-in-irq-chip.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c79e387389d5add7cb967d2f7622c3bf5550927b Mon Sep 17 00:00:00 2001 From: Aidan MacDonald <aidanmacdonald.0x0@xxxxxxxxx> Date: Sat, 12 Nov 2022 15:18:32 +0000 Subject: mfd: stpmic1: Fix swapped mask/unmask in irq chip From: Aidan MacDonald <aidanmacdonald.0x0@xxxxxxxxx> commit c79e387389d5add7cb967d2f7622c3bf5550927b upstream. The usual behavior of mask registers is writing a '1' bit to disable (mask) an interrupt; similarly, writing a '1' bit to an unmask register enables (unmasks) an interrupt. Due to a longstanding issue in regmap-irq, mask and unmask registers were inverted when both kinds of registers were present on the same chip, ie. regmap-irq actually wrote '1's to the mask register to enable an IRQ and '1's to the unmask register to disable an IRQ. This was fixed by commit e8ffb12e7f06 ("regmap-irq: Fix inverted handling of unmask registers") but the fix is opt-in via mask_unmask_non_inverted = true because it requires manual changes for each affected driver. The new behavior will become the default once all drivers have been updated. The STPMIC1 has a normal mask register with separate set and clear registers. The driver intends to use the set & clear registers with regmap-irq and has compensated for regmap-irq's inverted behavior, and should currently be working properly. Thus, swap mask_base and unmask_base, and opt in to the new non-inverted behavior. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@xxxxxxxxx> Signed-off-by: Lee Jones <lee@xxxxxxxxxx> Link: https://lore.kernel.org/r/20221112151835.39059-16-aidanmacdonald.0x0@xxxxxxxxx Cc: Yoann Congal <yoann.congal@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mfd/stpmic1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/mfd/stpmic1.c +++ b/drivers/mfd/stpmic1.c @@ -108,8 +108,9 @@ static const struct regmap_irq stpmic1_i static const struct regmap_irq_chip stpmic1_regmap_irq_chip = { .name = "pmic_irq", .status_base = INT_PENDING_R1, - .mask_base = INT_CLEAR_MASK_R1, - .unmask_base = INT_SET_MASK_R1, + .mask_base = INT_SET_MASK_R1, + .unmask_base = INT_CLEAR_MASK_R1, + .mask_unmask_non_inverted = true, .ack_base = INT_CLEAR_R1, .num_regs = STPMIC1_PMIC_NUM_IRQ_REGS, .irqs = stpmic1_irqs, Patches currently in stable-queue which might be from aidanmacdonald.0x0@xxxxxxxxx are queue-6.1/mfd-stpmic1-fix-swapped-mask-unmask-in-irq-chip.patch