From patchwork Fri Dec 9 22:47:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 31947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1029988wrr; Fri, 9 Dec 2022 14:53:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7FJ/7MYSx9hT8ctV1hGoyl3KxrofbysL5RU68Y7lHnz3pSnyAK3I4hhEpbRrgiGUKSiVVx X-Received: by 2002:a17:906:eddd:b0:7c1:439:2ad4 with SMTP id sb29-20020a170906eddd00b007c104392ad4mr7168666ejb.57.1670626413117; Fri, 09 Dec 2022 14:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670626413; cv=none; d=google.com; s=arc-20160816; b=ggA7Hk3cSlBqRN1yMXlp6uU7IW/9IcFz4e47IRxKGKdmbd8Wv18Zhqv886PCFMnaM3 t+0j0OWCjJGz1pxMvXOZnzagiKduI+Ldo4lxr25pf+qhlY6SD4z0AGoxTNhvMgciENmm CTbu6B69ihAejM+gnDUdl2Ua+zD1+62EZ4KFJNojCbJmFaEWV6JpEMtBNrlw+8DlO1tz qpxNTquk3UehvjiDhUIpB51J9w8HjFK2/5BWzSQFB0J0w0ALJx0yBlSqefzk7UwjgVbh gZWjrfopitV+tTfWuXU4RPwvOkWFZhqrvEDKdR3sYQyyV8qQfpwi4/ky8dL4qTqx6XwX WTEg== 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=Zu+X0wWblNWuSMZQH6lF+ORTq/EbVz0uqh9AM1U4qCw=; b=eNV7anW2ZkiH1r5M7yC3izT3x2mvKZBzoaIxA932aaOErdfv19N0Wz0nojGd4K9JSb jZEmqVSHX89xr7eCxRlydXV7TH+uj2jrs0VVAAe7kN1zvd8hY/luJgc7fm5bxBKB+Rzx W8V4Lxs1rqEMjiXKxpANkgSox7Rqy6zr3uC9DXmVyGYeToDbTpW9JeSRuXxGeW7juxIJ 0HWlH/HTSUS5tXR/4Mw+EnJ13VIF4IXUqAPo+MZJQCTkZE+R2mYuCHhoI1KTLiSqbyxU Aaj11hDJCzDGJZ/VQDk1umD6JHg/O7N/WadJd0Vo8erIgdc0D9kjbjo3iimhPSV64pyD C1yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=zXWENwvK; 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 mp16-20020a1709071b1000b007330c08fe49si743055ejc.206.2022.12.09.14.53.10; Fri, 09 Dec 2022 14:53:33 -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=zXWENwvK; 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 S230007AbiLIWrs (ORCPT + 99 others); Fri, 9 Dec 2022 17:47:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiLIWrW (ORCPT ); Fri, 9 Dec 2022 17:47:22 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 533761C12A; Fri, 9 Dec 2022 14:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670626042; x=1702162042; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=l7YBKmMzDz1O5Koq1YvREF/7MqTU5nkmnxEBATNyr3s=; b=zXWENwvKe+AaZCmmgO5cFca27no0p2e9STU1IIYln6Y0esS1ttIZ8QtU SSJLTuKazA+I1/XmUKr2gTjHB3y5nAPL//yAgxujAiP8kKtTUvW8ivrWx PCoAnOSzmW1niG9mlCQ2ejNI0ODRy7QtZbeBucAHS4uEC55MuGqLw26FG 3EQtQmye+YdTketwjv6qnyyee2u9Gdyk3PvOUr4zTUrpsihRd1eHY9peU PXqInpwBAYJn1/DgaZ4/B5MQpnxR25pmCKaCKis1H2N9Fz5FkVNZME3a2 qsO8B1iwMvdirH+ZuuVcE37jg8nuMKqkkpqKmNA8vvvHszoO13unOj/ve Q==; X-IronPort-AV: E=Sophos;i="5.96,232,1665471600"; d="scan'208";a="192458907" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 15:47:21 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 15:47:20 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 15:47:19 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , , , , , Jerry Ray Subject: [PATCH net-next v5 5/6] dsa: lan9303: Determine CPU port based on dsa_switch ptr Date: Fri, 9 Dec 2022 16:47:12 -0600 Message-ID: <20221209224713.19980-6-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209224713.19980-1-jerry.ray@microchip.com> References: <20221209224713.19980-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?1751778761729866286?= X-GMAIL-MSGID: =?utf-8?q?1751778761729866286?= 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. Signed-off-by: Jerry Ray --- 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 694249aa1f19..1d22e4b74308 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -1064,7 +1064,11 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port, struct lan9303 *chip = ds->priv; int ctl; - if (!phy_is_pseudo_fixed_link(phydev)) + /* On this device, we are only interested in doing something here if + * this is the CPU port. All other ports are 10/100 phys using MDIO + * to control there link settings. + */ + if (!dsa_is_cpu_port(ds, port)) return; ctl = lan9303_phy_read(ds, port, MII_BMCR);