From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
To: Andrew Lunn <andrew@lunn.ch>, Chaoyi Chen <kernel@airkyi.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Jonas Karlman <jonas@kwiboo.se>,
David Wu <david.wu@rock-chips.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] net: ethernet: stmmac: dwmac-rk: Make the clk_phy could be used for external phy
Date: Wed, 6 Aug 2025 11:32:47 +0800 [thread overview]
Message-ID: <d99c50ed-797b-4086-b1b5-d3df281d3c2a@rock-chips.com> (raw)
In-Reply-To: <3c401e82-169f-4540-9c12-175798ac72a6@lunn.ch>
Hi Andrew,
On 8/6/2025 11:14 AM, Andrew Lunn wrote:
> On Wed, Aug 06, 2025 at 09:14:05AM +0800, Chaoyi Chen wrote:
>> From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>>
>> For external phy, clk_phy should be optional, and some external phy
>> need the clock input from clk_phy. This patch adds support for setting
>> clk_phy for external phy.
>>
>> Signed-off-by: David Wu <david.wu@rock-chips.com>
>> Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
> Please take a read of:
>
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
>
> net-next is closed at the moment for the merge window.
>
> You also need the indicate the tree in the Subject: line.
Sorry for that, I will send v2 at an appropriate time.
>
>> ---
>> drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
>> index 700858ff6f7c..703b4b24f3bc 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
>> @@ -1558,6 +1558,7 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat)
>> struct device *dev = &bsp_priv->pdev->dev;
>> int phy_iface = bsp_priv->phy_iface;
>> int i, j, ret;
>> + unsigned int rate;
> Reverse Christmas tree. Longest to shortest.
Will fix in v2.
>
>>
>> bsp_priv->clk_enabled = false;
>>
>> @@ -1595,12 +1596,19 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat)
>> clk_set_rate(bsp_priv->clk_mac, 50000000);
>> }
>>
>> - if (plat->phy_node && bsp_priv->integrated_phy) {
>> + if (plat->phy_node) {
>> bsp_priv->clk_phy = of_clk_get(plat->phy_node, 0);
>> ret = PTR_ERR_OR_ZERO(bsp_priv->clk_phy);
>> - if (ret)
>> - return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
>> - clk_set_rate(bsp_priv->clk_phy, 50000000);
>> + /* If it is not integrated_phy, clk_phy is optional */
>> + if (bsp_priv->integrated_phy) {
>> + if (ret)
>> + return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
>> +
>> + ret = of_property_read_u32(plat->phy_node, "clock-frequency", &rate);
> Is this property already in the DT binding?
I didn't see explicit binding, but make dtbs_check W=1 didn't generate
any warning. I will drop this in v2.
>
>
> Andrew
>
> ---
> pw-bot: cr
>
>
prev parent reply other threads:[~2025-08-06 5:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 1:14 Chaoyi Chen
2025-08-06 3:14 ` Andrew Lunn
2025-08-06 3:32 ` Chaoyi Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d99c50ed-797b-4086-b1b5-d3df281d3c2a@rock-chips.com \
--to=chaoyi.chen@rock-chips.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=edumazet@google.com \
--cc=jonas@kwiboo.se \
--cc=kernel@airkyi.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®