From patchwork Mon Jan 9 21:18:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 41154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2386456wrt; Mon, 9 Jan 2023 13:20:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuYhtxVDUfsmXM8j1D1iIRPXTw7Ejba18NMXJFkFTFsd/UMglRqI1DN0XuCd8G5foOvX38+ X-Received: by 2002:a17:90a:1a49:b0:226:8803:3d3d with SMTP id 9-20020a17090a1a4900b0022688033d3dmr24499981pjl.14.1673299225862; Mon, 09 Jan 2023 13:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673299225; cv=none; d=google.com; s=arc-20160816; b=K/j/hPyJSC/esvW6lzHPGJBsfK8k7zI139EvtiLzdDuk1ZZIa5C8Orau7niaCdlVX2 ZZDsx1a2M0ELlQbW8fmcOgkPqdAuCsBh/29qL5mRyJU4S/3qfXJaIporI/crNaBS6W89 FhfaiW4RgTieU8WMsVGHUNvLivpuZxzMFPUPvibkRHI3vFOz9q0/JJlcx39SWO4H82KS tGRJ6PQkR3SBgDPI1QOpI5643rSSREcwM+aQZ44QZO4rT78ARbUaPWSu1S4Kb+d5goD7 pb8Frq6A6E2n4NcrarVlwwzddnT1ADs7IwvIDJa013IKHNTSn/3oQLsR6Y8an5LNl72j DfQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=CWzF2ZPzrioi9xFt/8R7f0UK9kLlhSHbzWnHLpta1jY=; b=0RYmfOWPs4VqmEKD4KyIbTVqXZlzaQFrKXapl89MGGN/0KoZYyC+VHPY4UQjQJtJz6 /ARSQKpD2RQlECtZR3SgcHuI1+FDRBM3PQ2FvOc0gvyIUgPI7pFv+iWt9Rt4GD1AKTW4 aeEZG4fQleriWbyGrYtjCcT315JgQw2/5oC+/2KMJqQVkzcKx3HOUlM2HdrVv3YYdfKr rBr2je8vTIpNsPwS/xQ5nj6vfzdfrqhsk5xV6s7a3o5Fc5LaDp+f5ldFblq60nO9IbJs bFpUW1Iby50n+1dtn67JvymL3Pkqfovwb6EqRFOKhSmbDbbwPo0dRdhSNNPBM02B/GuU iUAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ULHb+Xzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp11-20020a17090b4a8b00b00218b76cda10si10376649pjb.0.2023.01.09.13.20.13; Mon, 09 Jan 2023 13:20:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ULHb+Xzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237951AbjAIVUG (ORCPT + 99 others); Mon, 9 Jan 2023 16:20:06 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754581408994839416?= X-GMAIL-MSGID: =?utf-8?q?1754581408994839416?= 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 *ds, int port, { int ctl; - 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 != 0) return; ctl = lan9303_phy_read(ds, port, MII_BMCR);