From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com,
mpe@ellerman.id.au
Cc: npiggin@gmail.com, chleroy@kernel.org, shivangu@linux.ibm.com,
hbathini@linux.ibm.com, mahesh@linux.ibm.com,
adityag@linux.ibm.com, venkat88@linux.ibm.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2 2/3] powerpc/pseries: Handle and log pseries-wdt registration failures
Date: Mon, 13 Jul 2026 10:14:54 +0530 [thread overview]
Message-ID: <6b75342a-73e3-424f-9c03-de1695877287@linux.ibm.com> (raw)
In-Reply-To: <qzl7v7eh.ritesh.list@gmail.com>
On 13/07/26 09:59, Ritesh Harjani (IBM) wrote:
> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>
>> The pseries watchdog initialization registers the pseries-wdt platform
>> device using platform_device_register_simple(), but currently ignores
>> its return value.
>>
>> Check the returned pointer for errors, log a descriptive error message
>> when registration fails, and propagate the failure code to the caller.
>> This avoids silently ignoring platform device registration failures.
>>
> Fair enough.
>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>> arch/powerpc/platforms/pseries/setup.c | 14 ++++++++++++--
>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
>> index 1223dc961242..bbb2813f8ede 100644
>> --- a/arch/powerpc/platforms/pseries/setup.c
>> +++ b/arch/powerpc/platforms/pseries/setup.c
>> @@ -191,8 +191,18 @@ static void __init fwnmi_init(void)
>> */
>> static __init int pseries_wdt_init(void)
>> {
>> - if (firmware_has_feature(FW_FEATURE_WATCHDOG))
>> - platform_device_register_simple("pseries-wdt", 0, NULL, 0);
>> + struct platform_device *pseries_wdt_dev;
> minor nit: we should rename this to pdev, since it is already under
> pseries_wdt_init(). That is generally how all platform drivers use it
> unless it requires more than one platform device.
>
> But either ways the patch looks good to me:
>
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Thanks for the review. I will rename the variable in next version.
- Sourabh Jain
>
>> +
>> + if (!firmware_has_feature(FW_FEATURE_WATCHDOG))
>> + return 0;
>> +
>> + pseries_wdt_dev = platform_device_register_simple("pseries-wdt", 0, NULL, 0);
>> +
>> + if (IS_ERR(pseries_wdt_dev)) {
>> + pr_err("Failed to register pseries-wdt platform device\n");
>> + return PTR_ERR(pseries_wdt_dev);
>> + }
>> +
>> return 0;
>> }
>> machine_subsys_initcall(pseries, pseries_wdt_init);
>> --
>> 2.52.0
next prev parent reply other threads:[~2026-07-13 4:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 3:59 [PATCH v2 0/3] powerpc/crash: protect kdump from active watchdogs Sourabh Jain
2026-07-13 3:59 ` [PATCH v2 1/3] powerpc/pseries: Move H_WATCHDOG definitions to a common header Sourabh Jain
2026-07-13 4:18 ` Ritesh Harjani
2026-07-13 4:29 ` Sourabh Jain
2026-07-13 3:59 ` [PATCH v2 2/3] powerpc/pseries: Handle and log pseries-wdt registration failures Sourabh Jain
2026-07-13 4:29 ` Ritesh Harjani
2026-07-13 4:44 ` Sourabh Jain [this message]
2026-07-13 3:59 ` [PATCH v2 3/3] powerpc/crash: stop watchdogs before booting kdump kernel Sourabh Jain
2026-07-13 5:10 ` Ritesh Harjani
2026-07-13 13:37 ` Sourabh Jain
2026-07-13 5:21 ` [PATCH v2 0/3] powerpc/crash: protect kdump from active watchdogs Ritesh Harjani
2026-07-13 5:59 ` Sourabh Jain
2026-07-13 6:40 ` Ritesh Harjani
2026-07-13 11:30 ` Sourabh Jain
2026-07-13 11:39 ` Ritesh Harjani
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=6b75342a-73e3-424f-9c03-de1695877287@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=hbathini@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=shivangu@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=venkat88@linux.ibm.com \
/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