Message ID | 20220727013349.3056826-1-saravanak@google.com |
---|---|
State | New |
Headers | show |
Series | [v1] pinctrl: samsung: Finish initializing the gpios before registering them | expand |
> 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. > > Signed-off-by: Saravana Kannan <saravanak@google.com> Make sense for me and I tested this on my Exynos Auto v9 SADK board. Reviewed-by: Chanho Park <chanho61.park@samsung.com> Tested-by: Chanho Park <chanho61.park@samsung.com> Best Regards, Chanho Park
On Wed, 27 Jul 2022 at 04:33, Saravana Kannan <saravanak@google.com> wrote: > > 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. > > Signed-off-by: Saravana Kannan <saravanak@google.com> > --- Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> > drivers/pinctrl/samsung/pinctrl-samsung.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c > index 26d309d2516d..a302b38a63a8 100644 > --- a/drivers/pinctrl/samsung/pinctrl-samsung.c > +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c > @@ -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 >
On 27/07/2022 03:33, Saravana Kannan wrote: > 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. > > Signed-off-by: Saravana Kannan <saravanak@google.com> Looks good. Linus, It's too late for me to pick it up, so make you could grab it directly? Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Otherwise it will wait for merge window to finish. Best regards, Krzysztof
On 28/07/2022 11:32, Krzysztof Kozlowski wrote: > On 27/07/2022 03:33, Saravana Kannan wrote: >> 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. >> >> Signed-off-by: Saravana Kannan <saravanak@google.com> > > Looks good. > > Linus, > It's too late for me to pick it up, so make you could grab it directly? > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > Otherwise it will wait for merge window to finish. Applied. Best regards, Krzysztof
On Tue, 26 Jul 2022 18:33:48 -0700, Saravana Kannan wrote: > 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,
On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 27/07/2022 03:33, Saravana Kannan wrote: > > 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. > > > > Signed-off-by: Saravana Kannan <saravanak@google.com> > > Looks good. > > Linus, > It's too late for me to pick it up, so make you could grab it directly? > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > 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
On 25/08/2022 15:08, Linus Walleij wrote: > On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> On 27/07/2022 03:33, Saravana Kannan wrote: > >>> 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. >>> >>> Signed-off-by: Saravana Kannan <saravanak@google.com> >> >> Looks good. >> >> Linus, >> It's too late for me to pick it up, so make you could grab it directly? >> >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> >> 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
On Thu, Aug 25, 2022 at 5:11 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 25/08/2022 15:08, Linus Walleij wrote: > > On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> On 27/07/2022 03:33, Saravana Kannan wrote: > > > >>> 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. > >>> > >>> Signed-off-by: Saravana Kannan <saravanak@google.com> > >> > >> Looks good. > >> > >> Linus, > >> It's too late for me to pick it up, so make you could grab it directly? > >> > >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > >> > >> 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 > > I understood, so I already picked it up after merge window. I'll send > you this in a pull. > > Best regards, > Krzysztof
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 26d309d2516d..a302b38a63a8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -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;
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. Signed-off-by: Saravana Kannan <saravanak@google.com> --- drivers/pinctrl/samsung/pinctrl-samsung.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)