From: Matti Vaittinen <mazziesaccount@gmail.com>
To: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>,
"brgl@bgdev.pl" <brgl@bgdev.pl>
Cc: "bartosz.golaszewski@linaro.org" <bartosz.golaszewski@linaro.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/2] gpio: omap: save two lines by using devm_clk_get_prepared()
Date: Mon, 16 Dec 2024 13:11:09 +0200 [thread overview]
Message-ID: <72c52d8a-b0f2-4767-9e8c-ce869d203d0b@gmail.com> (raw)
In-Reply-To: <828da89cff6dd2c49df9af6131aa3b43675abc87.camel@siemens.com>
On 16/12/2024 10:57, Sverdlin, Alexander wrote:
> Hi Matti!
>
> On Fri, 2024-12-13 at 15:55 +0200, Matti Vaittinen wrote:
>
>>>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>>>
>>>>> We can drop the else branch if we get the clock already prepared using
>>>>> the relevant helper.
>>>>>
>>>>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>>> ---
>>>>
>>>> Booting a beaglebone black with the linux-next from Today fails
>>>> (next-20241213). Enabling earlycon + debug yields below splat to be
>>>> printed to the console:
>>>>
>
> No problem! Thanks for the logs! I think I know what happened: I suppose
> it's "prepared" counter underflow on probe deferral of GPIO driver
> (there are "probe of 44e07000.gpio returned 517" visible).
Ah. Indeed. The deferral is visible in the logs.
>
> If you'd still have a chance to test 6.13.0-rc2-next-20241213,
> I believe this was missing in the
> "gpio: omap: save two lines by using devm_clk_get_prepared()":
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 76d5d87e9681..0c30013d2b48 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1473,8 +1473,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
> if (ret) {
> pm_runtime_put_sync(dev);
> pm_runtime_disable(dev);
> - if (bank->dbck_flag)
> - clk_unprepare(bank->dbck);
> return ret;
> }
>
> @@ -1495,8 +1493,6 @@ static void omap_gpio_remove(struct platform_device *pdev)
> cpu_pm_unregister_notifier(&bank->nb);
> gpiochip_remove(&bank->chip);
> pm_runtime_disable(&pdev->dev);
> - if (bank->dbck_flag)
> - clk_unprepare(bank->dbck);
> }
>
> static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
>
This fixes the boot as you assumed.
I suppose this should be baked in the Bartosz's original patch assumed
it was dropped from the GPIO tree.
Furthermore, this seems to be a fix to a hidden problem on original
code. If the original code failed in the clk_prepare() and then deferred
probe(), this same problem should have appeared, right?
Maybe consider using Fixes - tag even if this and the original change
got squashed. Feel free to add a:
Tested-By: Matti Vaittinen <mazziesaccount@gmail.com>
if this fix goes to the tree "as is".
Thanks for the fix!
Yours,
-- Matti.
next prev parent reply other threads:[~2024-12-16 11:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 16:41 [PATCH 1/2] gpio: omap: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
2024-12-03 16:41 ` [PATCH 2/2] gpio: omap: save two lines by using devm_clk_get_prepared() Bartosz Golaszewski
2024-12-03 18:19 ` Sverdlin, Alexander
2024-12-13 12:16 ` Matti Vaittinen
2024-12-13 12:29 ` Sverdlin, Alexander
2024-12-13 13:17 ` Bartosz Golaszewski
2024-12-13 13:55 ` Matti Vaittinen
2024-12-16 8:57 ` Sverdlin, Alexander
2024-12-16 11:11 ` Matti Vaittinen [this message]
2024-12-16 11:14 ` Matti Vaittinen
2024-12-16 11:27 ` Sverdlin, Alexander
2024-12-03 18:18 ` [PATCH 1/2] gpio: omap: allow building the module with COMPILE_TEST=y Sverdlin, Alexander
2024-12-03 18:41 ` Andrew Davis
2024-12-03 20:36 ` Bartosz Golaszewski
2024-12-03 21:54 ` Andrew Davis
2024-12-05 10:27 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72c52d8a-b0f2-4767-9e8c-ce869d203d0b@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=alexander.sverdlin@siemens.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox