lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72c52d8a-b0f2-4767-9e8c-ce869d203d0b@gmail.com>
Date: Mon, 16 Dec 2024 13:11:09 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: "Sverdlin, Alexander" <alexander.sverdlin@...mens.com>,
 "brgl@...ev.pl" <brgl@...ev.pl>
Cc: "bartosz.golaszewski@...aro.org" <bartosz.golaszewski@...aro.org>,
 "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpio: omap: save two lines by using
 devm_clk_get_prepared()

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@...aro.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@...aro.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@...il.com>

if this fix goes to the tree "as is".

Thanks for the fix!

Yours,
	-- Matti.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ