Skip to contentSkip to conversation

pinctrl: samsung: Finish initializing the gpios before registering them

PATCH Applied Saravana Kannan 5 participants 10 messages Jul 27, 2022 – Aug 25, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: samsung: Finish initializing the gpios before registering them

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/samsung/pinctrl-samsung.c +4 -4
index 26d309d2516d..a302b38a63a8 100644
@@ -1168,15 +1168,15 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_put_banks;
 
-	ret = samsung_gpiolib_register(pdev, drvdata);
-	if (ret)
-		goto err_unregister;
-
 	if (ctrl->eint_gpio_init)
 		ctrl->eint_gpio_init(drvdata);
 	if (ctrl->eint_wkup_init)
 		ctrl->eint_wkup_init(drvdata);
 
+	ret = samsung_gpiolib_register(pdev, drvdata);
+	if (ret)
+		goto err_unregister;
+
 	platform_set_drvdata(pdev, drvdata);
 
 	return 0;
Signature · 1 line
2.37.1.359.gd136c6c3e2-goog
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines

Subject: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Make sense for me and I tested this on my Exynos Auto v9 SADK board.

Best Regards,
Chanho Park

#2 lore raw
Quoted 8 lines · Chanho Park
Quoted 8 lines

Subject: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Quoted 6 lines
Quoted 1 line

Make sense for me and I tested this on my Exynos Auto v9 SADK board.

Thank you!

-Saravana

Reviewed-by on v1 1/1
#3 lore raw
In reply to Saravana Kannan
Quoted 8 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

---

Quoted 30 lines
 drivers/pinctrl/samsung/pinctrl-samsung.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/samsung/pinctrl-samsung.c +4 -5
index 26d309d2516d..a302b38a63a8 100644
@@ -1168,15 +1168,15 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
        if (ret)
                goto err_put_banks;
 
-       ret = samsung_gpiolib_register(pdev, drvdata);
-       if (ret)
-               goto err_unregister;
-
        if (ctrl->eint_gpio_init)
                ctrl->eint_gpio_init(drvdata);
        if (ctrl->eint_wkup_init)
                ctrl->eint_wkup_init(drvdata);
 
+       ret = samsung_gpiolib_register(pdev, drvdata);
+       if (ret)
+               goto err_unregister;
+
        platform_set_drvdata(pdev, drvdata);
 
        return 0;
--

2.37.1.359.gd136c6c3e2-goog

Reviewed-by on v1 1/1
#4 lore raw
In reply to Saravana Kannan
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Looks good.

Linus,
It's too late for me to pick it up, so make you could grab it directly?

Otherwise it will wait for merge window to finish.

Best regards,
Krzysztof

#5 lore raw
Quoted 8 lines · Krzysztof Kozlowski
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Quoted 8 lines

Looks good.

Linus,
It's too late for me to pick it up, so make you could grab it directly?

Otherwise it will wait for merge window to finish.

Applied.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw
In reply to Krzysztof Kozlowski
Quoted 9 lines · Krzysztof Kozlowski
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Quoted 8 lines

Looks good.

Linus,
It's too late for me to pick it up, so make you could grab it directly?

Otherwise it will wait for merge window to finish.

I sadly missed this during the merge window, as the commit message didn't make it look like a fix or something urgent. (I don't know if it is?) Just send me the patch as fix or for -next, I let you decide.

Yours,
Linus Walleij

#7 lore raw
Quoted 16 lines · Linus Walleij
Quoted 14 lines · Krzysztof Kozlowski
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Looks good.

Linus,
It's too late for me to pick it up, so make you could grab it directly?

Quoted 7 lines
Quoted 3 lines

Otherwise it will wait for merge window to finish.

I sadly missed this during the merge window, as the commit message didn't make it look like a fix or something urgent. (I don't know if it is?) Just send me the patch as fix or for -next, I let you decide.

I understood, so I already picked it up after merge window. I'll send you this in a pull.

Best regards,
Krzysztof

#8 lore raw
Quoted 18 lines · Krzysztof Kozlowski
Quoted 16 lines · Linus Walleij
Quoted 14 lines · Krzysztof Kozlowski
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Looks good.

Linus,
It's too late for me to pick it up, so make you could grab it directly?

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

Otherwise it will wait for merge window to finish.

I sadly missed this during the merge window, as the commit message didn't make it look like a fix or something urgent. (I don't know if it is?) Just send me the patch as fix or for -next, I let you decide.

It wasn't anything urgent. I found this issue when I was refactoring fw_devlink, but that series hasn't landed yet. So it's okay if it's landing only in 6.0.

-Saravana

Quoted 6 lines

I understood, so I already picked it up after merge window. I'll send you this in a pull.

Best regards,
Krzysztof

#9 lore raw
In reply to Saravana Kannan
Quoted 6 lines · Saravana Kannan

As soon as a gpio is registered, it should be usable by a consumer. So, do all the initialization before registering the gpios. Without this change, a consumer can request a GPIO IRQ and have the gpio to IRQ mapping fail.

Applied, thanks!

[1/1] pinctrl: samsung: Finish initializing the gpios before registering them

      https://git.kernel.org/pinctrl/samsung/c/152a81a0b1204e9c7f4af0004b5ed7a8d67dd037

Best regards,

Signature · 6 lines
Krzysztof Kozlowski <[email protected]>

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel