linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
@ 2022-07-27  1:33 ` Saravana Kannan
  2022-07-27  2:01   ` Chanho Park
                     ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Saravana Kannan @ 2022-07-27  1:33 UTC (permalink / raw)
  To: Tomasz Figa, Krzysztof Kozlowski, Sylwester Nawrocki,
	Alim Akhtar, Linus Walleij
  Cc: Saravana Kannan, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-gpio, linux-kernel

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(-)

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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-27  1:33 ` [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them Saravana Kannan
@ 2022-07-27  2:01   ` Chanho Park
  2022-07-27  2:15     ` Saravana Kannan
  2022-07-27 13:54   ` Sam Protsenko
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Chanho Park @ 2022-07-27  2:01 UTC (permalink / raw)
  To: 'Saravana Kannan', 'Tomasz Figa',
	'Krzysztof Kozlowski', 'Sylwester Nawrocki',
	'Alim Akhtar', 'Linus Walleij'
  Cc: kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

> 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-27  2:01   ` Chanho Park
@ 2022-07-27  2:15     ` Saravana Kannan
  0 siblings, 0 replies; 10+ messages in thread
From: Saravana Kannan @ 2022-07-27  2:15 UTC (permalink / raw)
  To: Chanho Park
  Cc: Tomasz Figa, Krzysztof Kozlowski, Sylwester Nawrocki,
	Alim Akhtar, Linus Walleij, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-gpio, linux-kernel

On Tue, Jul 26, 2022 at 7:02 PM Chanho Park <chanho61.park@samsung.com> wrote:
>
> > 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>

Thank you!

-Saravana

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-27  1:33 ` [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them Saravana Kannan
  2022-07-27  2:01   ` Chanho Park
@ 2022-07-27 13:54   ` Sam Protsenko
  2022-07-28  8:32   ` Krzysztof Kozlowski
  2022-08-16  9:24   ` Krzysztof Kozlowski
  3 siblings, 0 replies; 10+ messages in thread
From: Sam Protsenko @ 2022-07-27 13:54 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Tomasz Figa, Krzysztof Kozlowski, Sylwester Nawrocki,
	Alim Akhtar, Linus Walleij, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-gpio, linux-kernel

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
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-27  1:33 ` [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them Saravana Kannan
  2022-07-27  2:01   ` Chanho Park
  2022-07-27 13:54   ` Sam Protsenko
@ 2022-07-28  8:32   ` Krzysztof Kozlowski
  2022-08-16  9:23     ` Krzysztof Kozlowski
  2022-08-25 12:08     ` Linus Walleij
  2022-08-16  9:24   ` Krzysztof Kozlowski
  3 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-28  8:32 UTC (permalink / raw)
  To: Saravana Kannan, Tomasz Figa, Sylwester Nawrocki, Alim Akhtar,
	Linus Walleij
  Cc: kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-28  8:32   ` Krzysztof Kozlowski
@ 2022-08-16  9:23     ` Krzysztof Kozlowski
  2022-08-25 12:08     ` Linus Walleij
  1 sibling, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-16  9:23 UTC (permalink / raw)
  To: Saravana Kannan, Tomasz Figa, Sylwester Nawrocki, Alim Akhtar,
	Linus Walleij
  Cc: kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-27  1:33 ` [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them Saravana Kannan
                     ` (2 preceding siblings ...)
  2022-07-28  8:32   ` Krzysztof Kozlowski
@ 2022-08-16  9:24   ` Krzysztof Kozlowski
  3 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-16  9:24 UTC (permalink / raw)
  To: tomasz.figa, linus.walleij, saravanak, alim.akhtar, s.nawrocki
  Cc: Krzysztof Kozlowski, linux-kernel, linux-arm-kernel, kernel-team,
	linux-samsung-soc, linux-gpio

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,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-07-28  8:32   ` Krzysztof Kozlowski
  2022-08-16  9:23     ` Krzysztof Kozlowski
@ 2022-08-25 12:08     ` Linus Walleij
  2022-08-25 12:11       ` Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Linus Walleij @ 2022-08-25 12:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Saravana Kannan, Tomasz Figa, Sylwester Nawrocki, Alim Akhtar,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-08-25 12:08     ` Linus Walleij
@ 2022-08-25 12:11       ` Krzysztof Kozlowski
  2022-08-25 17:05         ` Saravana Kannan
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-25 12:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Saravana Kannan, Tomasz Figa, Sylwester Nawrocki, Alim Akhtar,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them
  2022-08-25 12:11       ` Krzysztof Kozlowski
@ 2022-08-25 17:05         ` Saravana Kannan
  0 siblings, 0 replies; 10+ messages in thread
From: Saravana Kannan @ 2022-08-25 17:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Tomasz Figa, Sylwester Nawrocki, Alim Akhtar,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-gpio,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-25 17:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20220727013403epcas2p452b5f66597b4298b7a573393927ac96e@epcas2p4.samsung.com>
2022-07-27  1:33 ` [PATCH v1] pinctrl: samsung: Finish initializing the gpios before registering them Saravana Kannan
2022-07-27  2:01   ` Chanho Park
2022-07-27  2:15     ` Saravana Kannan
2022-07-27 13:54   ` Sam Protsenko
2022-07-28  8:32   ` Krzysztof Kozlowski
2022-08-16  9:23     ` Krzysztof Kozlowski
2022-08-25 12:08     ` Linus Walleij
2022-08-25 12:11       ` Krzysztof Kozlowski
2022-08-25 17:05         ` Saravana Kannan
2022-08-16  9:24   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).