Re: [PATCH v5 1/2] firmware: qcom: scm: Register gunyah watchdog device
From: Krzysztof Kozlowski
Date: Tue Nov 11 2025 - 05:42:26 EST
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. Whichever they choose here, they need to be sure to
actually compile test it, because existing patch lacks that and reports
are proving lack of building.
Best regards,
Krzysztof