[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5377db69-13d2-4ee2-b5d4-d9d4ae681848@kernel.org>
Date: Tue, 18 Nov 2025 12:46:11 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@....qualcomm.com>,
hrishabh.rajput@....qualcomm.com, Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Wim Van Sebroeck <wim@...ux-watchdog.org>, Guenter Roeck
<linux@...ck-us.net>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>
Cc: linux-arm-msm@...r.kernel.org, linux-watchdog@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Pavan Kondeti <pavan.kondeti@....qualcomm.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Shivendra Pratap <shivendra.pratap@....qualcomm.com>
Subject: Re: [PATCH v8 1/2] firmware: qcom: scm: Register gunyah watchdog
device
On 18/11/2025 12:32, Krzysztof Kozlowski wrote:
> On 18/11/2025 12:18, Kathiravan Thirumoorthy wrote:
>>
>> On 11/18/2025 4:10 PM, Hrishabh Rajput via B4 Relay wrote:
>>> From: Hrishabh Rajput <hrishabh.rajput@....qualcomm.com>
>>>
>>> To restrict Gunyah watchdog initialization to Qualcomm platforms running
>>> under the Gunyah Hypervisor, register the watchdog device in the QCOM
>>> SCM driver.
>>>
>>> When Gunyah is not present or Gunyah emulates MMIO-based watchdog, we
>>> expect Qualcomm watchdog or ARM SBSA watchdog device to be present in
>>> the devicetree. First, we make sure we're running under the Gunyah
>>> Hypervisor. Then we move to check if any of the above mentioned
>>> watchdog device nodes are present, if not then we proceed to register
>>> the SMC-based Gunyah watchdog device.
>>>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
>>> Tested-by: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
>>> Tested-by: Neil Armstrong <neil.armstrong@...aro.org>
>>> Signed-off-by: Hrishabh Rajput <hrishabh.rajput@....qualcomm.com>
>>> ---
>>> drivers/firmware/qcom/qcom_scm.c | 53 ++++++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 53 insertions(+)
>>>
>>> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
>>> index e777b7cb9b12..14d0663316e6 100644
>>> --- a/drivers/firmware/qcom/qcom_scm.c
>>> +++ b/drivers/firmware/qcom/qcom_scm.c
>>> @@ -2182,6 +2182,56 @@ int qcom_scm_qtee_callback_response(phys_addr_t buf, size_t buf_size,
>>> }
>>> EXPORT_SYMBOL(qcom_scm_qtee_callback_response);
>>>
>>> +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;
>>
>> nit: Can we use the __cleanup() attribute for device_node like below and
>> drop the explicit of_node_put()?
>>
>> struct device_node *np __free(device_node) = NULL;
>
> Please don't. It is not desired style, error prone and not helping.
>
> Don't use cleanup.h if you are not accustomed to its specific style.
Good that you linked here your patches, so I can NAK everything. That's
very poor idea. Simple, readable code you transform into buggy,
error-prone discouraged style.
In all your patches the code was left like this ON PURPOSE.
Best regards,
Krzysztof
Powered by blists - more mailing lists