From patchwork Tue Jan 17 20:56:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 4133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2039864wrn; Tue, 17 Jan 2023 15:35:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaLo52seGGvhwN0rI4DOp3p+AbGColuhCqPMO77XggxDyQr/9jp7GHtvfVjmHcDwsAxPjr X-Received: by 2002:a05:6402:413:b0:498:b9ea:1894 with SMTP id q19-20020a056402041300b00498b9ea1894mr4568912edv.15.1673998547703; Tue, 17 Jan 2023 15:35:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673998547; cv=none; d=google.com; s=arc-20160816; b=Be6OToTDeVoI7qb5dkuykL5+LewrQVABkKi/zGDdT+iiJus8cxD8zFVcyP8iLy/JXR vhjebgRtZyCzPm+a9ZvuzI5zcTFRi0+PpmRbB96LxvHs8YAKipLV/h44mnOPeIxMxnzV IXUzmbTpH5ZkI6IQ0y3qIcGSar6pGGF/COOmQvAZ17Lyk6oxEwWEQy1ij5+ltmM0tjbj TLEaiikmFIi6sa2wOiywgwhVqajVkzo144+nvVN37/YxatIDYJjtA9LWUky8jtwBmFlp 2/cqhjRKUPNrxITtODqmPNl5bJJL0kAbePkmie5LpViy1hClJ02RNyvHMqpA6inrwtrb ejwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from :dkim-signature; bh=i87tgSzfHH482iCAslSwVpfPJ0sIvhNDLTD/aKKJAk4=; b=v0MJQDHLBYM7vWbKDi8/cv8q9upWvxART2pWyqIDngx6Bt9bApuZeQynPCL1eFh19F MNBP0t5hiTjBpFRmUEbqfWrGpoQGTd0a4TqVl9sMilYLKFq27ldTUwxxEp6/E3M8Hj82 /q90NBtMiO4GTJspcXkv2eWagNGb3cxGintQmdijuAP5xIHUUpjBiTIOtJfts9ROElSL oI1WPAouhZOJ1jXfV3R2jOT8XPkeEs3uU2Qr2aabbwXq7q7IpHXtSvpQj3WbNSCgK3mE WgMxLhtrF9uNEm+hpEDBKzqrFYBGRzFGfSQ5yT4w7X840fOPWGyMpzotn4RtmnM+ewGO 5IZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hIHtaNoC; 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 h12-20020a056402280c00b0048c0b5672e4si43059800ede.37.2023.01.17.15.35.23; Tue, 17 Jan 2023 15:35:47 -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=hIHtaNoC; 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 S229703AbjAQXca (ORCPT + 99 others); Tue, 17 Jan 2023 18:32:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbjAQXbe (ORCPT ); Tue, 17 Jan 2023 18:31:34 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D00D78C939; Tue, 17 Jan 2023 12:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673989036; x=1705525036; h=from:to:subject:date:message-id:mime-version; bh=HUcDI0BDItLq7xPF3mfX4cfv5vHR9dKnvrxx0RnOSpw=; b=hIHtaNoCthkwQOEzYTSI/lWkxomc4UtVqUHZkBrS5x8cCRyod7q1bJdM oGfVBWfqBzV4eBXG2JtvJUz963Kph1tO7HIfASCS3GdkrYKBZcNRLcb1s APNHvBbU9NKumBgTRLSw1eXsEX10rL8dkd4dieYBDrEJONSFFeUXI9Dnf CjkmcqPbULtrN/+HqEsg8TrF8F+nBvrN2Rur8YiZsXJjsFuIiGCiCChU6 kB+9nAWDNsfedrIoRxr1Nek4MNIeDWcQHXbiPBdMT/sT/nTB4zZlBxq8+ QaS2gYlyXYlHkDexO6EkO+uZQvI5TQCS8UG0abbimMGZ7hMYU3EeT2lvy g==; X-IronPort-AV: E=Sophos;i="5.97,224,1669100400"; d="scan'208";a="197058697" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2023 13:57:06 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.16; Tue, 17 Jan 2023 13:57:06 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 17 Jan 2023 13:57: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: [net-next: PATCH v7 0/7] dsa: lan9303: Move to PHYLINK Date: Tue, 17 Jan 2023 14:56:56 -0600 Message-ID: <20230117205703.25960-1-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 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?1755314701413843372?= X-GMAIL-MSGID: =?utf-8?q?1755314701413843372?= This patch series moves the lan9303 driver to use the phylink api away from phylib. Migrating to phylink means removing the .adjust_link api. The functionality from the adjust_link is moved to the phylink_mac_link_up api. The code being removed only affected the cpu port. The other ports on the LAN9303 do not need anything from the phylink_mac_link_up api. Patches: 0001 - Whitespace only change aligning the dsa_switch_ops members. No code changes. 0002 - Moves the Turbo bit initialization out of the adjust_link api and places it in a driver initialization execution path. It only needs to be initialized once, it is never changed, and it is not a per-port flag. 0003 - Adds exception handling logic in the extremely unlikely event that the read of the device fails. 0004 - Performance optimization that skips a slow register write if there is no need to perform it. 0005 - Change the way we identify the xMII port as phydev will be NULL when this logic is moved into phylink_mac_link_up. 0006 - Removes adjust_link and begins using the phylink dsa_switch_ops apis. 0007 - Adds XMII port flow control settings in the phylink_mac_link_up() api while cleaning up the ANEG / speed / duplex implementation. --- v6->v7: - Moved the initialization of the Turbo bit into lan9303_setup(). - Added a macro for determining is a port is an XMII port. - Added setting the XMII flow control in the phylink_mac_link_up() API. - removed unnecessary error handling and cleaned up the code flow in phylink_mac_link_up(). v5->v6: - Moved to using port number to identify xMII port for the LAN9303. v4->v5: - Created prep patches to better show how things migrate. - cleaned up comments. v3->v4: - Addressed whitespace issues as a separate patch. - Removed port_max_mtu api patch as it is unrelated to phylink migration. - Reworked the implementation to preserve the adjust_link functionality by including it in the phylink_mac_link_up api. v2->v3: Added back in disabling Turbo Mode on the CPU MII interface. Removed the unnecessary clearing of the phy supported interfaces. v1->v2: corrected the reported mtu size, removing ETH_HLEN and ETH_FCS_LEN drivers/net/dsa/lan9303-core.c | xx ++++++++++++-------- 1 file changed