Re: [PATCH v5 1/2] firmware: qcom: scm: Register gunyah watchdog device
From: Dmitry Baryshkov
Date: Tue Nov 11 2025 - 10:06:00 EST
On Tue, Nov 11, 2025 at 07:30:59PM +0530, Hrishabh Rajput wrote:
>
> On 11/11/2025 5:52 PM, Dmitry Baryshkov wrote:
> > On Tue, Nov 11, 2025 at 11:41:51AM +0100, Krzysztof Kozlowski wrote:
> > > On 11/11/2025 11:34, Dmitry Baryshkov wrote:
> > > > On Tue, Nov 11, 2025 at 10:51:43AM +0530, Pavan Kondeti wrote:
> > > > > On Mon, Nov 10, 2025 at 09:43:53AM +0530, Pavan Kondeti wrote:
> > > > > > On Sat, Nov 08, 2025 at 07:26:46PM +0200, Dmitry Baryshkov wrote:
> > > > > > > > +static void qcom_scm_gunyah_wdt_free(void *data)
> > > > > > > > +{
> > > > > > > > + struct platform_device *gunyah_wdt_dev = data;
> > > > > > > > +
> > > > > > > > + platform_device_unregister(gunyah_wdt_dev);
> > > > > > > > +}
> > > > > > > > +
> > > > > > > > +static void qcom_scm_gunyah_wdt_init(struct qcom_scm *scm)
> > > > > > > > +{
> > > > > > > > + struct platform_device *gunyah_wdt_dev;
> > > > > > > > + struct device_node *np;
> > > > > > > > + bool of_wdt_available;
> > > > > > > > + int i;
> > > > > > > > + uuid_t gunyah_uuid = UUID_INIT(0xc1d58fcd, 0xa453, 0x5fdb, 0x92, 0x65,
> > > > > > > static const?
> > > > > > >
> > > > > > > > + 0xce, 0x36, 0x67, 0x3d, 0x5f, 0x14);
> > > > > > > > + static const char * const of_wdt_compatible[] = {
> > > > > > > > + "qcom,kpss-wdt",
> > > > > > > > + "arm,sbsa-gwdt",
> > > > > > > > + };
> > > > > > > > +
> > > > > > > > + /* Bail out if we are not running under Gunyah */
> > > > > > > > + if (!arm_smccc_hypervisor_has_uuid(&gunyah_uuid))
> > > > > > > > + return;
> > > > > > > This rquires 'select HAVE_ARM_SMCCC_DISCOVERY'
> > > > > > >
> > > > > > Probably `depends on HAVE_ARM_SMCCC_DISCOVERY` is correct here.
> > > > > >
> > > > > Dmitry / Bjorn,
> > > > >
> > > > > We are debating on this internally on how to resolve this dependency
> > > > >
> > > > > - QCOM_SCM depends on HAVE_ARM_SMCCC_DISCOVERY which means restricting
> > > > > QCOM_SCM compilation than what it is today.
> > > > >
> > > > > - Adding #ifdefry around arm_smccc_hypervisor_has_uuid usage in qcom scm driver
> > > > >
> > > > > - Adding stub for `arm_smccc_hypervisor_has_uuid()` which is not done
> > > > > for any of the functions defined in drivers/firmware/smccc/smccc.c
> > > > >
> > > > > We are trending towards the first option above. Please let us know if
> > > > > you think otherwise.
> > > > The same as before: 'select HAVE_ARM_SMCCC_DISCOVERY'.
> > > HAVE_ARM_SMCCC_DISCOVERY has a dependency which is not always selected
> > > (e.g. ARM32), thus selecting it might lead to warnings of unmet
> > > dependencies.
> > Then `if (!IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY))` might be a good
> > option here (and depend on GICv3 selecting it).
>
>
> Thanks a lot Dmitry, wemade the change below and compile tested on various
> architectures (ARM64, ARM32, x86, PowerPC, RISC-V and MIPS) and it was
> success.
>
> We will include it in our next patch version, if there are no further
> concerns.
>
> }; /* Bail out if we are not running under Gunyah */ - if
> (!arm_smccc_hypervisor_has_uuid(&gunyah_uuid)) + if
> (!IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) || +
> !arm_smccc_hypervisor_has_uuid(&gunyah_uuid)) return; /*
Unreadable. Don't you read what you are sending?
--
With best wishes
Dmitry