From: Paolo Abeni <pabeni@redhat.com>
To: Minda Chen <minda.chen@starfivetech.com>,
Emil Renner Berthing <kernel@esmil.dk>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [net-next v1] net: stmmac: starfive: Add serdes PHY init/deinit function
Date: Tue, 15 Apr 2025 11:14:46 +0200 [thread overview]
Message-ID: <6851d6b8-109c-4de0-89a8-a56659c87cf4@redhat.com> (raw)
In-Reply-To: <20250410070453.61178-1-minda.chen@starfivetech.com>
On 4/10/25 9:04 AM, Minda Chen wrote:
> To support SGMII interface, add internal serdes PHY powerup/
> powerdown function.
>
> Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
> ---
> .../ethernet/stmicro/stmmac/dwmac-starfive.c | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> index 2013d7477eb7..f5923f847100 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
> @@ -9,6 +9,8 @@
>
> #include <linux/mod_devicetable.h>
> #include <linux/platform_device.h>
> +#include <linux/phy.h>
> +#include <linux/phy/phy.h>
> #include <linux/property.h>
> #include <linux/mfd/syscon.h>
> #include <linux/regmap.h>
> @@ -28,6 +30,7 @@ struct starfive_dwmac_data {
> struct starfive_dwmac {
> struct device *dev;
> const struct starfive_dwmac_data *data;
> + struct phy *serdes_phy;
> };
>
> static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
> @@ -80,6 +83,26 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
> return 0;
> }
>
> +static int starfive_dwmac_serdes_powerup(struct net_device *ndev, void *priv)
> +{
> + struct starfive_dwmac *dwmac = priv;
> + int ret;
> +
> + ret = phy_init(dwmac->serdes_phy);
> + if (ret)
> + return ret;
This is called also in case of PM suspend/resume. Do you need to keep
the init here, or should that moved at probe time only? Similar question
for phy_exit() below.
Thanks!
Paolo
next prev parent reply other threads:[~2025-04-15 9:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 7:04 Minda Chen
2025-04-15 9:14 ` Paolo Abeni [this message]
2025-04-16 3:13 ` Minda Chen
2025-04-15 12:08 ` Andrew Lunn
2025-04-16 3:14 ` Minda Chen
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=6851d6b8-109c-4de0-89a8-a56659c87cf4@redhat.com \
--to=pabeni@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@esmil.dk \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=minda.chen@starfivetech.com \
--cc=netdev@vger.kernel.org \
/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®