From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6283DFC7F; Fri, 10 Apr 2026 17:10:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775841048; cv=none; b=EtVKsGfbD+PKVCVGdQ41hoVv8/JQ0tb4xLw7R4RTVoShO6nnDjvJgs2o2M1neWnGMhV31mijuLNokWj+4nFvC1C0JwJi2ZD3rUEUJdgE9+AO2e3A+YOo+G1lNYiawpbHvRRRxhlxRbA9kWuidzfFubJCn9hcomOEXePYZ4eNQoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775841048; c=relaxed/simple; bh=eStU3i7xbyOQ/8mrBlXosGPOz2LATtGTCKZTSHKcY5o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NaE3bZ92odL1jZzNx/92j3LyjF7uQy8JH1RZG/7VFOb513tMfTKe8Y44g8EqxCIQ4JfH7SP59QMt66B4gBcBiYxi67ykfHFIFecEbDauHjMUq2PWbYEAwPCrjB5h/q2gmSg9kyqVv6eY0rt5t8O73DP+2XDgmvxvM3SSXiBA6ZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=H2mTnqkV; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="H2mTnqkV" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 1D4274E429B1; Fri, 10 Apr 2026 17:10:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C5A19603F0; Fri, 10 Apr 2026 17:10:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6D2A210450077; Fri, 10 Apr 2026 19:10:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775841034; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=F1NfZqIejbtKCh+NaPP95bKnLVDVR4KaSEjAHJAWrvc=; b=H2mTnqkVE9iX/NoE/W02infw9hN/6+HTpEprCljrFAK8/Kz9ir1+nuyiXxumzVDnJdi8Hl MROsh3dTvTXTj5fPx+tgSh67l3i5TAQUZuKA5AIKMc79Ol5ot8LNWXGUsOZJJzv3e92i1Z 2i3PPDKL0M9JkWGe0Q2stiPisUdBVEGGslXZKbhEAV7JltNgC/+yODJTx7X/RFi2DDSji7 BcY5Dw+Ux8JerCwkqhl9oQR6L6P1GzkgmGAX7MGDxESJoNNC3k5ZZpG497fVs2eV7Qe5hT y4FT+Nzg1dDxGl8kidsDZL4Y2yUPkuUKUfuJF1ObmQ6Dzk7/2zCF65iqp5aMRg== From: Maxime Chevallier To: Andrew Lunn , Jakub Kicinski , davem@davemloft.net, Eric Dumazet , Paolo Abeni , Simon Horman , Russell King Cc: Maxime Chevallier , thomas.petazzoni@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH net] net: phy: qcom: at803x: Use the correct bit to disable extended next page Date: Fri, 10 Apr 2026 19:10:20 +0200 Message-ID: <20260410171021.1277138-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 As noted in the blamed commit, the AR8035 and other PHYs from this family advertise the Extended Next Page support by default, which may be understood by some partners as this PHY being multi-gig capable. The fix is to disable XNP advertising, which is done by setting bit 12 of the Auto-Negotiation Advertisement Register (MII_ADVERTISE). The blamed commit incorrectly uses MDIO_AN_CTRL1_XNP, which is bit 13 as per 802.3 : 45.2.7.1 AN control register (Register 7.0) BIT 12 in MII_ADVERTISE is wrapped by ADVERTISE_RESV, used by some drivers such as the aquantia one. 802.3 Clause 28 defines bit 12 as Extended Next Page ability, at least in recent versions of the standard. Let's add a define for it and use it in the at803x driver. Fixes: 3c51fa5d2afe ("net: phy: ar803x: disable extended next page bit") Signed-off-by: Maxime Chevallier --- Some further driver cleanup can be done to remove the use of ADVERTISE_RESV, but the macro is uapi now so it'll have to stay. drivers/net/phy/qcom/at803x.c | 2 +- include/uapi/linux/mii.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c index 338acd11a9b6..023c1fe0cd14 100644 --- a/drivers/net/phy/qcom/at803x.c +++ b/drivers/net/phy/qcom/at803x.c @@ -524,7 +524,7 @@ static int at803x_config_init(struct phy_device *phydev) * behaviour but we still need to accommodate it. XNP is only needed * for 10Gbps support, so disable XNP. */ - return phy_modify(phydev, MII_ADVERTISE, MDIO_AN_CTRL1_XNP, 0); + return phy_modify(phydev, MII_ADVERTISE, ADVERTISE_XNP, 0); } static void at803x_link_change_notify(struct phy_device *phydev) diff --git a/include/uapi/linux/mii.h b/include/uapi/linux/mii.h index 39f7c44baf53..61d6edad4b94 100644 --- a/include/uapi/linux/mii.h +++ b/include/uapi/linux/mii.h @@ -82,7 +82,8 @@ #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ #define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ #define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ -#define ADVERTISE_RESV 0x1000 /* Unused... */ +#define ADVERTISE_XNP 0x1000 /* Extended Next Page */ +#define ADVERTISE_RESV ADVERTISE_XNP /* Used to be reserved */ #define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ #define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ #define ADVERTISE_NPAGE 0x8000 /* Next page bit */ -- 2.49.0