]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 14:41:34 +0000 (16:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 14:41:34 +0000 (16:41 +0200)
added patches:
pinctrl-armada-37xx-set-gpio-output-value-before-setting-direction.patch
pinctrl-armada-37xx-use-correct-output_val-register-for-gpios-31.patch

queue-5.4/pinctrl-armada-37xx-set-gpio-output-value-before-setting-direction.patch [new file with mode: 0644]
queue-5.4/pinctrl-armada-37xx-use-correct-output_val-register-for-gpios-31.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/pinctrl-armada-37xx-set-gpio-output-value-before-setting-direction.patch b/queue-5.4/pinctrl-armada-37xx-set-gpio-output-value-before-setting-direction.patch
new file mode 100644 (file)
index 0000000..0116f91
--- /dev/null
@@ -0,0 +1,62 @@
+From e6ebd4942981f8ad37189bbb36a3c8495e21ef4c Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <j4g8y7@gmail.com>
+Date: Wed, 14 May 2025 21:18:33 +0200
+Subject: pinctrl: armada-37xx: set GPIO output value before setting direction
+
+From: Gabor Juhos <j4g8y7@gmail.com>
+
+commit e6ebd4942981f8ad37189bbb36a3c8495e21ef4c upstream.
+
+Changing the direction before updating the output value in the
+OUTPUT_VAL register may result in a glitch on the output line
+if the previous value in the OUTPUT_VAL register is different
+from the one we want to set.
+
+In order to avoid that, update the output value before changing
+the direction.
+
+Cc: stable@vger.kernel.org
+Fixes: 6702abb3bf23 ("pinctrl: armada-37xx: Fix direction_output() callback behavior")
+Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
+Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-2-07e9ac1ab737@gmail.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |   15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
++++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+@@ -409,23 +409,22 @@ static int armada_37xx_gpio_direction_ou
+                                            unsigned int offset, int value)
+ {
+       struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
+-      unsigned int val_offset = offset;
+-      unsigned int reg = OUTPUT_EN;
++      unsigned int en_offset = offset;
++      unsigned int reg = OUTPUT_VAL;
+       unsigned int mask, val, ret;
+       armada_37xx_update_reg(&reg, &offset);
+       mask = BIT(offset);
++      val = value ? mask : 0;
+-      ret = regmap_update_bits(info->regmap, reg, mask, mask);
+-
++      ret = regmap_update_bits(info->regmap, reg, mask, val);
+       if (ret)
+               return ret;
+-      reg = OUTPUT_VAL;
+-      armada_37xx_update_reg(&reg, &val_offset);
++      reg = OUTPUT_EN;
++      armada_37xx_update_reg(&reg, &en_offset);
+-      val = value ? mask : 0;
+-      regmap_update_bits(info->regmap, reg, mask, val);
++      regmap_update_bits(info->regmap, reg, mask, mask);
+       return 0;
+ }
diff --git a/queue-5.4/pinctrl-armada-37xx-use-correct-output_val-register-for-gpios-31.patch b/queue-5.4/pinctrl-armada-37xx-use-correct-output_val-register-for-gpios-31.patch
new file mode 100644 (file)
index 0000000..1aab0fc
--- /dev/null
@@ -0,0 +1,48 @@
+From 947c93eb29c2a581c0b0b6d5f21af3c2b7ff6d25 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <j4g8y7@gmail.com>
+Date: Wed, 14 May 2025 21:18:32 +0200
+Subject: pinctrl: armada-37xx: use correct OUTPUT_VAL register for GPIOs > 31
+
+From: Gabor Juhos <j4g8y7@gmail.com>
+
+commit 947c93eb29c2a581c0b0b6d5f21af3c2b7ff6d25 upstream.
+
+The controller has two consecutive OUTPUT_VAL registers and both
+holds output value for 32 GPIOs. Due to a missing adjustment, the
+current code always uses the first register while setting the
+output value whereas it should use the second one for GPIOs > 31.
+
+Add the missing armada_37xx_update_reg() call to adjust the register
+according to the 'offset' parameter of the function to fix the issue.
+
+Cc: stable@vger.kernel.org
+Fixes: 6702abb3bf23 ("pinctrl: armada-37xx: Fix direction_output() callback behavior")
+Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
+Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-1-07e9ac1ab737@gmail.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
++++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+@@ -409,6 +409,7 @@ static int armada_37xx_gpio_direction_ou
+                                            unsigned int offset, int value)
+ {
+       struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
++      unsigned int val_offset = offset;
+       unsigned int reg = OUTPUT_EN;
+       unsigned int mask, val, ret;
+@@ -421,6 +422,8 @@ static int armada_37xx_gpio_direction_ou
+               return ret;
+       reg = OUTPUT_VAL;
++      armada_37xx_update_reg(&reg, &val_offset);
++
+       val = value ? mask : 0;
+       regmap_update_bits(info->regmap, reg, mask, val);
index 6502ba340f12e2cd134aeed68f483a61532a6f36..ba911dee267716f4a296f4732169cbb586e06670 100644 (file)
@@ -1 +1,3 @@
 tracing-fix-compilation-warning-on-arm32.patch
+pinctrl-armada-37xx-use-correct-output_val-register-for-gpios-31.patch
+pinctrl-armada-37xx-set-gpio-output-value-before-setting-direction.patch