From patchwork Fri Feb 24 12:35:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13151222 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 D149FC61DA4 for ; Fri, 24 Feb 2023 12:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjBXMgN (ORCPT ); Fri, 24 Feb 2023 07:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjBXMgN (ORCPT ); Fri, 24 Feb 2023 07:36:13 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC6F671F8 for ; Fri, 24 Feb 2023 04:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oOUHfm6liK2+pEkFLHJseKqdt6YDS6UDIHuq/c0TaYE=; b=z8KdmSnkzkHmL83t8pGRNLz1+D CC4LZFOjWj+X1hOVleI5M4h6cu8bYP5ARnxb5Wxf3NQ6qiSfUju2vMZ4J8iZz1Jeawbzh/AIizPlC N05QPZ+2PU+rbBHxnbw8TYYYEienuFt2kpx4ecGTvWx5UNO06k80+AoGApYBc3umEXkOHzBLygDNP Ex+H7NepQD2eqKfSWwSHN+Px54dExvyzukOXZEQMdWPXrFqJGYK4r2E2DDYWMERigAjxtONLEKTBO L9VrQhZS1uN43fZR00z1ENsZCbuQc56KuDZdOsBgBq6vQUcrENLngzWI7nZL6xXrzPZSPqBKkopND OSPTF8TQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35628) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pVXIg-0000cw-7b; Fri, 24 Feb 2023 12:35:46 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pVXIa-0005PH-Am; Fri, 24 Feb 2023 12:35:40 +0000 Date: Fri, 24 Feb 2023 12:35:40 +0000 From: "Russell King (Oracle)" To: Daniel Golle Cc: AngeloGioacchino Del Regno , "David S. Miller" , Eric Dumazet , Felix Fietkau , Jakub Kicinski , John Crispin , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Lorenzo Bianconi , Mark Lee , Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang Subject: [PATCH RFC net-next 0/4] Various mtk_eth_soc cleanups Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Hi, These are a number of patches that do a bit of cleanup to mtk_eth_soc, including one (the last) which seems to indicate that I somehow missed adding RMII and REVMII to the supported_interfaces - but no one has complained, and checking the DT files in the kernel, no one uses these modes (so the driver is probably untested for these.) The first patch cleans up mtk_gmac0_rgmii_adjust(), which is the troublesome function preventing the driver becoming a post-March2020 phylink driver. It doesn't solve that problem, merely makes the code easier to follow by getting rid of repeated tenary operators. The second patch moves the check for DDR2 memory to the initialisation of phylink's supported_interfaces - if TRGMII is not possible for some reason, we should not be erroring out in phylink MAC operations when that can be determined prior to phylink creation. The third patch removes checks from mtk_mac_config() that are done when initialising supported_interfaces - phylink will not call mtk_mac_config() with an interface that was not marked as supported, so these checks are redundant. The last patch adds comments for REVMII and RMII. As I note, these seem to be unused in the DT files, and as no one has reported that these don't work, I suggest that no one uses them. Should we drop support for these modes, or add them to supported_interfaces? Please review, and I'll collect attributations for resending after net-next has re-opened. Thanks. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 71 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 37 deletions(-)