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: 13151227 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB7B4C61DA4 for ; Fri, 24 Feb 2023 12:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KrzLqN38QIYnyqPZ1lJBK+TRR5xczy8PwdK3RrTip2Q=; b=D7oD/RJ40cb/hX x3H0iS8QaO4hFvbX1grb6LyhnTPfY7fmgg97P0tP/wAbd7s7H4qOTaEUbzUOGJAWc9wqLKEfehCPm Bj6D3dzjSY7psbCE27QXiPCYQ6WWH19/EYkPrT8lqB5FLLE/cgbwRynhxSggDyBRDCAUKgEorbl7E 7Uf/HnfEU96TddJNJhsw8i1R3Vdcecljit+FN3LNQng/i6ofFTvhHeG51OO4o7QQSBYpDlRLGzHmq Y5F7WJy532BQHXraM0XWHiSwVMj+8OvONfrmvtl+BmBKnRE3Vysm+iDfnhsb5fDhT6V77C4s7L03F byChMZgrO/JiNVre0GGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVXJ4-002PUd-7l; Fri, 24 Feb 2023 12:36:10 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVXJ1-002PTC-EZ; Fri, 24 Feb 2023 12:36:09 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230224_043607_777528_51CC426E X-CRM114-Status: GOOD ( 16.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-)