Re: [PATCH v5 1/2] firmware: qcom: scm: Register gunyah watchdog device

From: Dmitry Baryshkov
Date: Tue Nov 11 2025 - 05:41:00 EST


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'.

--
With best wishes
Dmitry