From: Krzysztof Kozlowski <krzk@kernel.org>
To: Pavan Kondeti <pavan.kondeti@oss.qualcomm.com>
Cc: hrishabh.rajput@oss.qualcomm.com,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Neil Armstrong <neil.armstrong@linaro.org>
Subject: Re: [PATCH v2] watchdog: Add driver for Gunyah Watchdog
Date: Mon, 6 Oct 2025 22:03:59 +0900 [thread overview]
Message-ID: <b94d8ca3-af58-4a78-9a5a-12e3db0bf75f@kernel.org> (raw)
In-Reply-To: <a7633abf-0005-423b-b152-e8c70aa5c27a@quicinc.com>
On 06/10/2025 19:03, Pavan Kondeti wrote:
> On Mon, Oct 06, 2025 at 05:56:42PM +0900, Krzysztof Kozlowski wrote:
>> On 06/10/2025 16:37, Hrishabh Rajput via B4 Relay wrote:
>>> +
>>> +static int __init gunyah_wdt_init(void)
>>> +{
>>> + struct arm_smccc_res res;
>>> + struct watchdog_device *wdd;
>>> + struct device_node *np;
>>> + int ret;
>>> +
>>> + np = of_find_compatible_node(NULL, NULL, "qcom,kpss-wdt");
>>> + if (np) {
>>> + of_node_put(np);
>>> + return -ENODEV;
>>> + }
>>> +
>>> + np = of_find_compatible_node(NULL, NULL, "arm,sbsa-gwdt");
>>> + if (np) {
>>> + of_node_put(np);
>>> + return -ENODEV;
>>> + }
>>> +
>>> + ret = gunyah_wdt_call(GUNYAH_WDT_STATUS, 0, 0, &res);
>>> + if (ret)
>>> + return -ENODEV;
>>
>> No, your hypervisor driver (which you have) should start the module via
>> adding platform/aux/something devices. Now you are running this on every
>> machine, which is clearly wrong...
>>
>
> This is a good point. Thanks for bringing it up. We don't have a
> hypervisor glue driver (yet!) that can add an aux device. Based on v1
> feedback, we would like to be a standalone module that can self discover
> gunyah hypercall interface.
>
> Currently this driver depends on ARCH_QCOM || COMPILE_TEST. So,
> technically this can be built and loaded on all non-Qualcomm machines.
Not technically, but practically. We do not make single-platform kernels
anymore, it's not 2010. Entire arm64 is multiarch.
>
> We can make the STATUS SMCC before looking for the other watchdog
> devices and fail early.
>
> Our Gunyah glue driver [1] do make SMCC call to establish that we
> are actually a guest under Gunyah. Since our intention here is to
> support watchdog on as many as platform as possible, it is better not to
> tie this with glue driver and make it a stand alone and self discovery
> module.
I think you should have only one driver pinging for Gunyah, so glue
driver or this. Not both. If you add such SMC here, then how do you
determine the platform in the glue driver? Via DT? Then DT supersedes this.
>
> If this is not an acceptable solution (Please let us know), we can find other
> ways to limit it to only work on Qualcomm machines. For ex: Socinfo
> platform device is added from SMEM driver which make it only probed on
> Qualcomm machines. We can look into this.
To me socinfo feels even better. That way only, really only qcom devices
will execute this SMC.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-10-06 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 7:37 [PATCH v2] watchdog: Add driver for Gunyah Watchdog Hrishabh Rajput via B4 Relay
2025-10-06 8:56 ` Krzysztof Kozlowski
2025-10-06 10:03 ` Pavan Kondeti
2025-10-06 13:03 ` Krzysztof Kozlowski [this message]
2025-10-06 13:26 ` Pavan Kondeti
2025-10-06 13:47 ` Konrad Dybcio
2025-10-07 19:21 ` Hrishabh Rajput
2025-10-06 14:18 ` Guenter Roeck
2025-10-07 6:52 ` Hrishabh Rajput
2025-10-07 13:41 ` Guenter Roeck
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=b94d8ca3-af58-4a78-9a5a-12e3db0bf75f@kernel.org \
--to=krzk@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hrishabh.rajput@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=neil.armstrong@linaro.org \
--cc=pavan.kondeti@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=wim@linux-watchdog.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