From nobody Tue Sep 16 01:15:18 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B58EAC54EBD for ; Mon, 9 Jan 2023 21:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237955AbjAIVUI (ORCPT ); Mon, 9 Jan 2023 16:20:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237699AbjAIVT2 (ORCPT ); Mon, 9 Jan 2023 16:19:28 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E67EF01D; Mon, 9 Jan 2023 13:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673299152; x=1704835152; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=J1yPTJ30ftyyvOnC2+2vUGnUMmEFmadFpDvwb82hEIM=; b=ULHb+XzkpAZU1iMyNq8LWdweTltsPOzE8qfHkTQV9VN+AyqN5DdpoeK7 9t0GcIv4G2LDODqvi0ITX2ZN0vMxHU8+6/e39YYVAffbhXYlp0ostjTTK 5TCZXv73oEJHkz7Nb7ASUBZYisvVEORCO4g7e3rBgIkg08/EWM6Ss2cUM LzWM0j+N/0f+1aPaYyMUczRpm5+pIMs2kjsqV9T99C8ol36CM/rpKGB4A IPsW/29hcGtmY82Qf0hgyOo+DQtrxu4B/8XQx9CDWrlWsv+IXIQ6+PVZs 7FizB767DuzqkXmjtOkp2QQ0m//zwl2jdvNth59qRF9P0UyEiNKpAFPB4 A==; X-IronPort-AV: E=Sophos;i="5.96,313,1665471600"; d="scan'208";a="131543916" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Jan 2023 14:19:11 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 9 Jan 2023 14:19:07 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 9 Jan 2023 14:19:04 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Russell King , , , , Jerry Ray Subject: [PATCH net-next v6 5/6] dsa: lan9303: Port 0 is xMII port Date: Mon, 9 Jan 2023 15:18:48 -0600 Message-ID: <20230109211849.32530-6-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230109211849.32530-1-jerry.ray@microchip.com> References: <20230109211849.32530-1-jerry.ray@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparing to move the adjust_link logic into the phylink_mac_link_up api, change the macro used to check for the cpu port. In phylink_mac_link_up, the phydev pointer passed in for the CPU port is NULL, so we can't keep using phy_is_pseudo_fixed_link(phydev). Signed-off-by: Jerry Ray --- v5->v6: Using port 0 to identify the xMII port on the LAN9303. --- drivers/net/dsa/lan9303-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 792ce6a26a6a..7be4c491e5d9 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -1063,7 +1063,11 @@ static void lan9303_adjust_link(struct dsa_switch *d= s, int port, { int ctl; =20 - if (!phy_is_pseudo_fixed_link(phydev)) + /* On this device, we are only interested in doing something here if + * this is an xMII port. All other ports are 10/100 phys using MDIO + * to control there link settings. + */ + if (port !=3D 0) return; =20 ctl =3D lan9303_phy_read(ds, port, MII_BMCR); --=20 2.17.1