diff mbox series

[1/2] pinctrl: bcm2835: Fix permissions of persist_gpio_outputs

Message ID 20240603181938.76047-2-wahrenst@gmx.net (mailing list archive)
State New, archived
Headers show
Series pinctrl: bcm2835: persist_gpio_outputs follow-up | expand

Commit Message

Stefan Wahren June 3, 2024, 6:19 p.m. UTC
The commit 8ff05989b44e ("pinctrl: bcm2835: Make pin freeing behavior
configurable") unintentionally made the module parameter
persist_gpio_outputs changeable at runtime. So drop the write permission
in order to make the freeing behavior predictable for user applications.

Fixes: 8ff05989b44e ("pinctrl: bcm2835: Make pin freeing behavior configurable")
Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Closes: https://lore.kernel.org/linux-gpio/Zjk-C0nLmlynqLAE@surfacebook.localdomain/
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.34.1

Comments

Florian Fainelli June 4, 2024, 7:57 a.m. UTC | #1
On 6/3/2024 8:19 PM, Stefan Wahren wrote:
> The commit 8ff05989b44e ("pinctrl: bcm2835: Make pin freeing behavior
> configurable") unintentionally made the module parameter
> persist_gpio_outputs changeable at runtime. So drop the write permission
> in order to make the freeing behavior predictable for user applications.
> 
> Fixes: 8ff05989b44e ("pinctrl: bcm2835: Make pin freeing behavior configurable")
> Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Closes: https://lore.kernel.org/linux-gpio/Zjk-C0nLmlynqLAE@surfacebook.localdomain/
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff mbox series

Patch

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 7178a38475cc..27fd54795791 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -245,7 +245,7 @@  static const char * const irq_type_names[] = {
 };

 static bool persist_gpio_outputs;
-module_param(persist_gpio_outputs, bool, 0644);
+module_param(persist_gpio_outputs, bool, 0444);
 MODULE_PARM_DESC(persist_gpio_outputs, "Enable GPIO_OUT persistence when pin is freed");

 static inline u32 bcm2835_gpio_rd(struct bcm2835_pinctrl *pc, unsigned reg)