[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db61cf6e-24a9-4b99-b4f0-4871f7fefae8@quicinc.com>
Date: Tue, 24 Dec 2024 14:46:52 +0530
From: Manikanta Mylavarapu <quic_mmanikan@...cinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
CC: Lei Wei <quic_leiwei@...cinc.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, "Rob
Herring" <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
"Conor
Dooley" <conor+dt@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit
<hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, <netdev@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <quic_kkumarcs@...cinc.com>,
<quic_suruchia@...cinc.com>, <quic_pavir@...cinc.com>,
<quic_linchen@...cinc.com>, <quic_luoj@...cinc.com>,
<srinivas.kandagatla@...aro.org>, <bartosz.golaszewski@...aro.org>,
<vsmuthu@....qualcomm.com>, <john@...ozen.org>
Subject: Re: [PATCH net-next v3 3/5] net: pcs: qcom-ipq9574: Add PCS
instantiation and phylink operations
On 12/24/2024 12:45 PM, Dmitry Baryshkov wrote:
> On Tue, Dec 24, 2024 at 12:29:56PM +0530, Manikanta Mylavarapu wrote:
>>
>>
>> On 12/16/2024 7:10 PM, Lei Wei wrote:
>>> This patch adds the following PCS functionality for the PCS driver
>>> for IPQ9574 SoC:
>>>
>>> a.) Parses PCS MII DT nodes and instantiate each MII PCS instance.
>>> b.) Exports PCS instance get and put APIs. The network driver calls
>>> the PCS get API to get and associate the PCS instance with the port
>>> MAC.
>>> c.) PCS phylink operations for SGMII/QSGMII interface modes.
>>>
>>> Signed-off-by: Lei Wei <quic_leiwei@...cinc.com>
>>> ---
>>> drivers/net/pcs/pcs-qcom-ipq9574.c | 463 +++++++++++++++++++++++++++++++++++
>>> include/linux/pcs/pcs-qcom-ipq9574.h | 16 ++
>>> 2 files changed, 479 insertions(+)
>>>
>
>>> +
>>> +/* Parse the PCS MII DT nodes which are child nodes of the PCS node,
>>> + * and instantiate each MII PCS instance.
>>> + */
>>> +static int ipq_pcs_create_miis(struct ipq_pcs *qpcs)
>>> +{
>>> + struct device *dev = qpcs->dev;
>>> + struct ipq_pcs_mii *qpcs_mii;
>>> + struct device_node *mii_np;
>>> + u32 index;
>>> + int ret;
>>> +
>>> + for_each_available_child_of_node(dev->of_node, mii_np) {
>>> + ret = of_property_read_u32(mii_np, "reg", &index);
>>> + if (ret) {
>>> + dev_err(dev, "Failed to read MII index\n");
>>> + of_node_put(mii_np);
>>
>> Assume, the second child node failed here.
>> Returning without calling the first child node of_node_put().
>>
>> Please clear the previous child nodes resources before return.
>
> s/clear child nodes/put OF nodes/
>
> Note, for_each_available_child_of_node() handles refcounting for
> the nodes that we looped through. So, I don't think the comment is
> valid. If I missed something, please expand your comment.
>
Yes, you are correct. for_each_available_child_of_node() handles the
refcount. I am dropping my comment.
> P.S. Please also trim your messages. There is no need to resend the
> whole patch if you are commenting a single function.
>
Got it. Thank you for your input.
Thanks & Regards,
Manikanta.
Powered by blists - more mailing lists