mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Weiting Lee <weiting.lee@airoha.com>
To: <netdev@vger.kernel.org>
Cc: <andrew@lunn.ch>, <hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
	<davem@davemloft.net>, <kuba@kernel.org>, <edumazet@google.com>,
	<pabeni@redhat.com>, <linux-kernel@vger.kernel.org>,
	<bjorn@mork.no>, <ericwouds@gmail.com>, <frank-w@public-files.de>,
	<joseph.lin@airoha.com>, <wenshin.chung@airoha.com>,
	<lucien.jheng@airoha.com>, <albert-al.lee@airoha.com>,
	Weiting Lee <weiting.lee@airoha.com>
Subject: [PATCH] net: phy: air_en8811h: add dedicated suspend callback for AN8811HB
Date: Thu, 17 Sep 2026 09:21:02 +0800	[thread overview]
Message-ID: <20260917012102.3103131-1-weiting.lee@airoha.com> (raw)

The AN8811HB hardware requires a re-negotiation sequence before
entering power-down to correctly restore the link upon resume.
Add an8811hb_suspend() to handle this.

Signed-off-by: Weiting Lee <weiting.lee@airoha.com>
---
 drivers/net/phy/air_en8811h.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index a03d63dd4ac9..5b1edb127c68 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -1573,6 +1573,19 @@ static void an8811hb_remove(struct phy_device *phydev)
 	}
 }
 
+static int an8811hb_suspend(struct phy_device *phydev)
+{
+	int ret;
+
+	clk_save_context();
+
+	ret = phy_modify(phydev, MII_BMCR, 0, BMCR_ANRESTART);
+	if (ret < 0)
+		return ret;
+
+	return genphy_suspend(phydev);
+}
+
 static struct phy_driver en8811h_driver[] = {
 {
 	PHY_ID_MATCH_MODEL(EN8811H_PHY_ID),
@@ -1606,7 +1619,7 @@ static struct phy_driver en8811h_driver[] = {
 	.config_aneg		= en8811h_config_aneg,
 	.read_status		= en8811h_read_status,
 	.resume			= en8811h_resume,
-	.suspend		= en8811h_suspend,
+	.suspend		= an8811hb_suspend,
 	.config_intr		= en8811h_clear_intr,
 	.handle_interrupt	= en8811h_handle_interrupt,
 	.led_hw_is_supported	= en8811h_led_hw_is_supported,
-- 
2.43.0


             reply	other threads:[~2026-09-17  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  1:21 Weiting Lee [this message]
2026-09-17  1:56 ` Andrew Lunn

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=20260917012102.3103131-1-weiting.lee@airoha.com \
    --to=weiting.lee@airoha.com \
    --cc=albert-al.lee@airoha.com \
    --cc=andrew@lunn.ch \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ericwouds@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=hkallweit1@gmail.com \
    --cc=joseph.lin@airoha.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lucien.jheng@airoha.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wenshin.chung@airoha.com \
    /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®