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: <8e74c3b4-a4fd-407b-aef7-ccdc94490f11@linaro.org>
Date: Mon, 31 Mar 2025 10:28:22 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Krzysztof Kozlowski <krzk@...nel.org>, wim@...ux-watchdog.org
Cc: linux@...ck-us.net, linux-watchdog@...r.kernel.org,
 linux-kernel@...r.kernel.org, S32@....com,
 Ghennadi Procopciuc <ghennadi.procopciuc@....com>,
 Thomas Fossati <thomas.fossati@...aro.org>
Subject: Re: [PATCH 2/2] watchdog: Add the Software Watchdog Timer for the NXP
 S32 platform

On 29/03/2025 05:55, Krzysztof Kozlowski wrote:
> On 28/03/2025 16:15, Daniel Lezcano wrote:
>> +
>> +struct s32g_wdt_device {
>> +	int rate;
>> +	void __iomem *base;
>> +	struct watchdog_device wdog;
>> +};
>> +
>> +static bool nowayout = WATCHDOG_NOWAYOUT;
>> +module_param(nowayout, bool, 0);
>> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
>> +		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>> +
>> +static unsigned int timeout_param = S32G_WDT_DEFAULT_TIMEOUT;
>> +module_param(timeout_param, uint, 0);
>> +MODULE_PARM_DESC(timeout_param, "Watchdog timeout in seconds (default="
>> +		 __MODULE_STRING(S32G_WDT_DEFAULT_TIMEOUT) ")");
> 
> Timeout is provided by DT.

Yes, but we may want to change the default timeout when loading the driver.

[ ... ]

>> +static int s32g_wdt_ping(struct watchdog_device *wdog)
>> +{
>> +	struct s32g_wdt_device *wdev = wdd_to_s32g_wdt(wdog);
>> +
>> +	__raw_writel(S32G_WDT_SEQ1, S32G_SWT_SR(wdev->base));
>> +	__raw_writel(S32G_WDT_SEQ2, S32G_SWT_SR(wdev->base));
> 
> I am confused why you do not use standard writel or don't have any
> barriers here. I think this is very error prone and in general
> discouraged practice (was for example raised by Arnd multiple times on
> the lists).

Yes, that's a good point. I'll sort it out with Arnd

>> +static int s32g_wdt_start(struct watchdog_device *wdog)
>> +{
>> +	struct s32g_wdt_device *wdev = wdd_to_s32g_wdt(wdog);
>> +	unsigned long val;
>> +
>> +	val = __raw_readl(S32G_SWT_CR(wdev->base));
>> +
>> +	val |= S32G_SWT_CR_WEN;
>> +
>> +	__raw_writel(val, S32G_SWT_CR(wdev->base));
>> +
>> +	return 0;
>> +}
>> +
> 
> ...

[ ... ]

>> +static struct platform_driver s32g_wdt_driver = {
>> +	.probe = s32g_wdt_probe,
>> +	.driver = {
>> +		.name = DRIVER_NAME,
>> +		.owner = THIS_MODULE,
> 
> Drop, that's some ancient downstream code.
> 
>> +		.of_match_table = s32g_wdt_dt_ids,
>> +	},
>> +};
>> +
>> +module_platform_driver(s32g_wdt_driver);
>> +
>> +MODULE_AUTHOR("NXP");
>> +MODULE_DESCRIPTION("Watchdog driver for S32G SoC");
>> +MODULE_LICENSE("GPL");
>> +MODULE_ALIAS("platform:" DRIVER_NAME);
> 
> Drop, not needed. Fix your table module device Id instead... or start
> from other recent driver as a skeleton to avoid repeating the same
> issues we already fixed.

Ok, thanks for spotting it



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ