From 766b9caccc82dddec89b19c444d2c9df6e9c350f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 Feb 2026 15:50:23 +0100 Subject: [PATCH] 6.1-stable patches added patches: gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch --- ...op-calling-pinctrl-for-set_direction.patch | 91 +++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 92 insertions(+) create mode 100644 queue-6.1/gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch diff --git a/queue-6.1/gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch b/queue-6.1/gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch new file mode 100644 index 0000000000..0ab93b765e --- /dev/null +++ b/queue-6.1/gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch @@ -0,0 +1,91 @@ +From 7ca497be00163610afb663867db24ac408752f13 Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Mon, 26 Jan 2026 12:12:26 +0000 +Subject: gpio: rockchip: Stop calling pinctrl for set_direction + +From: Robin Murphy + +commit 7ca497be00163610afb663867db24ac408752f13 upstream. + +Marking the whole controller as sleeping due to the pinctrl calls in the +.direction_{input,output} callbacks has the unfortunate side effect that +legitimate invocations of .get and .set, which cannot themselves sleep, +in atomic context now spew WARN()s from gpiolib. + +However, as Heiko points out, the driver doing this is a bit silly to +begin with, as the pinctrl .gpio_set_direction hook doesn't even care +about the direction, the hook is only used to claim the mux. And sure +enough, the .gpio_request_enable hook exists to serve this very purpose, +so switch to that and remove the problematic business entirely. + +Cc: stable@vger.kernel.org +Fixes: 20cf2aed89ac ("gpio: rockchip: mark the GPIO controller as sleeping") +Suggested-by: Heiko Stuebner +Signed-off-by: Robin Murphy +Reviewed-by: Heiko Stuebner +Link: https://lore.kernel.org/r/bddc0469f25843ca5ae0cf578ab3671435ae98a7.1769429546.git.robin.murphy@arm.com +Signed-off-by: Bartosz Golaszewski +[ Backport past pinctrl API change for the deleted calls ] +Signed-off-by: Robin Murphy +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpio/gpio-rockchip.c | 8 -------- + drivers/pinctrl/pinctrl-rockchip.c | 9 ++++----- + 2 files changed, 4 insertions(+), 13 deletions(-) + +--- a/drivers/gpio/gpio-rockchip.c ++++ b/drivers/gpio/gpio-rockchip.c +@@ -19,7 +19,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -157,12 +156,6 @@ static int rockchip_gpio_set_direction(s + unsigned long flags; + u32 data = input ? 0 : 1; + +- +- if (input) +- pinctrl_gpio_direction_input(bank->pin_base + offset); +- else +- pinctrl_gpio_direction_output(bank->pin_base + offset); +- + raw_spin_lock_irqsave(&bank->slock, flags); + rockchip_gpio_writel_bit(bank, offset, data, bank->gpio_regs->port_ddr); + raw_spin_unlock_irqrestore(&bank->slock, flags); +@@ -584,7 +577,6 @@ static int rockchip_gpiolib_register(str + gc->ngpio = bank->nr_pins; + gc->label = bank->name; + gc->parent = bank->dev; +- gc->can_sleep = true; + + ret = gpiochip_add_data(gc, bank); + if (ret) { +--- a/drivers/pinctrl/pinctrl-rockchip.c ++++ b/drivers/pinctrl/pinctrl-rockchip.c +@@ -2750,10 +2750,9 @@ static int rockchip_pmx_set(struct pinct + return 0; + } + +-static int rockchip_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, +- struct pinctrl_gpio_range *range, +- unsigned offset, +- bool input) ++static int rockchip_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, ++ struct pinctrl_gpio_range *range, ++ unsigned int offset) + { + struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); + struct rockchip_pin_bank *bank; +@@ -2767,7 +2766,7 @@ static const struct pinmux_ops rockchip_ + .get_function_name = rockchip_pmx_get_func_name, + .get_function_groups = rockchip_pmx_get_groups, + .set_mux = rockchip_pmx_set, +- .gpio_set_direction = rockchip_pmx_gpio_set_direction, ++ .gpio_request_enable = rockchip_pmx_gpio_request_enable, + }; + + /* diff --git a/queue-6.1/series b/queue-6.1/series index f96155b6b2..7b197b2d13 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -216,3 +216,4 @@ scripts-generate_rust_analyzer-add-compiler_builtins-core-dep.patch drm-amdgpu-soc21-fix-xclk-for-apus.patch drm-amdgpu-gfx10-fix-wptr-reset-in-kgq-init.patch drm-amdgpu-gfx11-fix-wptr-reset-in-kgq-init.patch +gpio-rockchip-stop-calling-pinctrl-for-set_direction.patch -- 2.47.3