pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux()
Subsystems (3)
PATCH 1/1 pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux()
We need to unlock and enable IRQs before we return on this error path.
--- drivers/pinctrl/sh-pfc/pinctrl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pinctrl.c +4 -2
@@ -361,8 +361,10 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,* This driver cannot manage both gpio and mux when the gpio * pin is already enabled. So, this function fails. */ -if (cfg->gpio_enabled) -return -EBUSY ; +if (cfg->gpio_enabled) { + ret = -EBUSY ; + goto done; + } ret =sh_pfc_config_mux (pfc, grp->mux[i],PINMUX_TYPE_FUNCTION );if (ret <0 )
Signature · 1 line
2.20.1
Quoted 1 line · Dan Carpenter
We need to unlock and enable IRQs before we return on this error path.
Wow, how could we have missed that?!?
Thanks!
Quoted 2 lines
Fixes 8a0cc47ccc7c ("pinctrl: sh-pfc: Rollback to mux if required when the gpio is freed")Signed-off-by Dan Carpenter <[email protected]>
Linus: As we're already past rc6, I don't plan to send another pull
request for v5.4.
Hence can you please take this one directly? Thanks!
Quoted 5 lines
drivers/pinctrl/sh-pfc/pinctrl.c +0
-0@@ -361,8 +361,10 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,* This driver cannot manage both gpio and mux when the gpio * pin is already enabled. So, this function fails.
drivers/pinctrl/sh-pfc/pinctrl.c static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector, · line 370
Quoted 10 lines
drivers/pinctrl/sh-pfc/pinctrl.c +4
-2*/ -if (cfg->gpio_enabled) -return -EBUSY ; +if (cfg->gpio_enabled) { + ret = -EBUSY ; + goto done; + } ret =sh_pfc_config_mux (pfc, grp->mux[i],PINMUX_TYPE_FUNCTION );if (ret <0 )
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Dan,
Quoted 6 lines
From: Dan Carpenter, Sent: Tuesday, August 27, 2019 6:39 PM
We need to unlock and enable IRQs before we return on this error path.
Fixes 8a0cc47ccc7c ("pinctrl: sh-pfc: Rollback to mux if required when the gpio is freed")Signed-off-by Dan Carpenter <[email protected]>
Thank you for the patch!
Best regards,
Yoshihiro Shimoda
Quoted 4 lines · Dan Carpenter
We need to unlock and enable IRQs before we return on this error path.
Fixes 8a0cc47ccc7c ("pinctrl: sh-pfc: Rollback to mux if required when the gpio is freed")Signed-off-by Dan Carpenter <[email protected]>
Applied for v5.4 with the ACKs.
Yours,
Linus Walleij