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: 13151217 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 A8F66C61DA4 for ; Fri, 24 Feb 2023 12:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id: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-Owner; bh=oOUHfm6liK2+pEkFLHJseKqdt6YDS6UDIHuq/c0TaYE=; b=NVf9dbIgyJ5KrOiDQrWoH2X9v6 7Hmns+Jvv/Wy1QvIQLrqY1iWPnVjLHnq7y2dNt6FZOUca1mZ/oIWgQ4pIoGK6Y/TzSH73hHAm1bjs bmifG/leyAhb8SgIsNRIHejnV59B5/3/vqJsPBnPgJy5THeJilc/ajLjhqmb7R5DxW8HWvn5U/xde CKzU3n6uTQ3lHr8gFzxrq5KJA96f7DsGlVnH9WAyyb0OCoHzbORu90UjnaA2tIPhURIpM2VSyilsZ rU5PQv4s6ma4SrmDsoE49DP+uhYbHSdY0W4xJPxgYT/yKVOwrcynuR3VQRH3Is3kJ15tPbH/ooEx9 SS4/sDYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVXJB-002PWC-Sa; Fri, 24 Feb 2023 12:36:17 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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(-)