2022-07-27 02:13:03

by Saravana Kannan

[permalink] [raw]
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 <[email protected]>
---
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


2022-07-27 14:14:53

by Sam Protsenko

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

On Wed, 27 Jul 2022 at 04:33, Saravana Kannan <[email protected]> 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 <[email protected]>
> ---

Reviewed-by: Sam Protsenko <[email protected]>

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

2022-07-28 08:49:14

by Krzysztof Kozlowski

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

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 <[email protected]>

Looks good.

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

Reviewed-by: Krzysztof Kozlowski <[email protected]>

Otherwise it will wait for merge window to finish.


Best regards,
Krzysztof

2022-08-16 10:18:40

by Krzysztof Kozlowski

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

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 <[email protected]>
>
> Looks good.
>
> Linus,
> It's too late for me to pick it up, so make you could grab it directly?
>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>
> Otherwise it will wait for merge window to finish.

Applied.

Best regards,
Krzysztof

2022-08-16 10:18:57

by Krzysztof Kozlowski

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

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 <[email protected]>

2022-08-25 12:23:36

by Krzysztof Kozlowski

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

On 25/08/2022 15:08, Linus Walleij wrote:
> On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski
> <[email protected]> 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 <[email protected]>
>>
>> Looks good.
>>
>> Linus,
>> It's too late for me to pick it up, so make you could grab it directly?
>>
>> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>>
>> 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

2022-08-25 12:29:28

by Linus Walleij

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

On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski
<[email protected]> 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 <[email protected]>
>
> Looks good.
>
> Linus,
> It's too late for me to pick it up, so make you could grab it directly?
>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>
> 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

2022-08-25 17:07:20

by Saravana Kannan

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

On Thu, Aug 25, 2022 at 5:11 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> On 25/08/2022 15:08, Linus Walleij wrote:
> > On Thu, Jul 28, 2022 at 10:32 AM Krzysztof Kozlowski
> > <[email protected]> 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 <[email protected]>
> >>
> >> Looks good.
> >>
> >> Linus,
> >> It's too late for me to pick it up, so make you could grab it directly?
> >>
> >> Reviewed-by: Krzysztof Kozlowski <[email protected]>
> >>
> >> 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