From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8AC6C77B7A for ; Wed, 7 Jun 2023 13:57:13 +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:Date:Subject:Cc :To:From: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=2UDbX27CJc8bQVRauiSZT1Z7oD7lIMh95tlqhg3/pig=; b=y4DHOf7K9awgzU 5IwBCuHu88uFYge0GHXO8a5n8E7u3iang6HAGFQOL8MAyt7qw5KpEwTWZas/fXkBs16HE3Y199UGD BbTQvHVlwrc51Qwf/1+o3GJ09CzObUmX3jpPkizA9wLujbX2NXqGqw1sj8tiSaQMHBxhAm4IN9/qb viCeTybw63PRDJxypJa/iOoyaMMHZahQu5PwW7IDFqWGFw2upFyYglWthpK/aRQjrBROnTC7CyB8U WOl+ty2Q+FHgV5nIfM2I9G2Dkz/p5TSadFfRF0xQX9eqrY1rWhGZ6i8FGZKkDNutECPyP6X7iTLGO 0tVSSHg4dXZT0ujRCUEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6teb-006AIQ-37; Wed, 07 Jun 2023 13:56:49 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6teZ-006AHn-2g for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 13:56:49 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5AFBF6253B; Wed, 7 Jun 2023 13:56:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 859C2C433EF; Wed, 7 Jun 2023 13:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686146206; bh=bZhwvYa05FtutRjZRtFZn41GMyv24CmHT6uPZylAuVU=; h=From:To:Cc:Subject:Date:From; b=D5AMwlgUa9w6w4Pupuocx+TfI7PB91MRhjSx1a/NTAWH2kYakHlyb8Wz01rVyXZw2 Bx3Uxhdn0DKDTqQ2E2EfADvNY5pzcZ5SafvK1uD/F9fD6G14UKXStVvRw//yGP1t6r E5hsecjdLS5j2uE51Xn02etZUibWI6tQvaeu98SF/i8i5R4BFye1/V1LoJz9slB+PB 5NzmkaqlVkdUIxz90gI7Scg/AX8lR8zIKkifGtCf5dQ7DKGUBdZMMnulBnpfsYgW1X krsJQiXhaLLxRGvjMa8U+E10R3cSRLSDvxRhWu0PrSQ4ZJDuarPJp3s6lwx2ac1UPH GlroLJmvOsgFA== From: Arnd Bergmann To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Simon Horman , Maxime Chevallier Cc: Arnd Bergmann , Christian Marangi , Jon Hunter , Bhadram Varka , Samin Guo , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] stmmac: fix pcs_lynx link failure Date: Wed, 7 Jun 2023 15:56:32 +0200 Message-Id: <20230607135638.1341101-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_065647_914073_9DF88F45 X-CRM114-Status: GOOD ( 20.20 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The mdio code in stmmac now directly links into both the lynx_pcs and the xpcs device drivers, but the lynx_pcs dependency is only enforced for the altera variant of stmmac, which is the one that actually uses it. Building stmmac for a non-altera platform therefore causes a link failure: arm-linux-gnueabi-ld: drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o: in function `stmmac_mdio_unregister': stmmac_mdio.c:(.text+0x1418): undefined reference to `lynx_pcs_destroy' I've tried to come up with a patch that moves this dependency back into the dwmac-socfpga.c file, but there was no easy and obvious way to do this. It also seems that this would not be a proper solution, but instead there should be a real abstraction for pcs drivers that lets device drivers handle this transparently. As the lynx_pcs driver is tiny, it appears that we can just avoid the link error by always forcing it to be built when the stmmac driver is, even for non-altera platforms. This matches what we already do for the xpcs variant that is used by the intel and tegra variants of stmmac. Fixes: 5d1f3fe7d2d54 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 5583f0b055ec7..fa956f2081a53 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -5,6 +5,7 @@ config STMMAC_ETH depends on PTP_1588_CLOCK_OPTIONAL select MII select PCS_XPCS + select PCS_LYNX select PAGE_POOL select PHYLINK select CRC32 @@ -160,7 +161,6 @@ config DWMAC_SOCFPGA select MFD_SYSCON select MDIO_REGMAP select REGMAP_MMIO - select PCS_LYNX help Support for ethernet controller on Altera SOCFPGA -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 E75A4C77B7A for ; Wed, 7 Jun 2023 13:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239774AbjFGN4u (ORCPT ); Wed, 7 Jun 2023 09:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbjFGN4s (ORCPT ); Wed, 7 Jun 2023 09:56:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C15FF1BD9 for ; Wed, 7 Jun 2023 06:56:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5DD6E6355A for ; Wed, 7 Jun 2023 13:56:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 859C2C433EF; Wed, 7 Jun 2023 13:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686146206; bh=bZhwvYa05FtutRjZRtFZn41GMyv24CmHT6uPZylAuVU=; h=From:To:Cc:Subject:Date:From; b=D5AMwlgUa9w6w4Pupuocx+TfI7PB91MRhjSx1a/NTAWH2kYakHlyb8Wz01rVyXZw2 Bx3Uxhdn0DKDTqQ2E2EfADvNY5pzcZ5SafvK1uD/F9fD6G14UKXStVvRw//yGP1t6r E5hsecjdLS5j2uE51Xn02etZUibWI6tQvaeu98SF/i8i5R4BFye1/V1LoJz9slB+PB 5NzmkaqlVkdUIxz90gI7Scg/AX8lR8zIKkifGtCf5dQ7DKGUBdZMMnulBnpfsYgW1X krsJQiXhaLLxRGvjMa8U+E10R3cSRLSDvxRhWu0PrSQ4ZJDuarPJp3s6lwx2ac1UPH GlroLJmvOsgFA== From: Arnd Bergmann To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Simon Horman , Maxime Chevallier Cc: Arnd Bergmann , Christian Marangi , Jon Hunter , Bhadram Varka , Samin Guo , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] stmmac: fix pcs_lynx link failure Date: Wed, 7 Jun 2023 15:56:32 +0200 Message-Id: <20230607135638.1341101-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The mdio code in stmmac now directly links into both the lynx_pcs and the xpcs device drivers, but the lynx_pcs dependency is only enforced for the altera variant of stmmac, which is the one that actually uses it. Building stmmac for a non-altera platform therefore causes a link failure: arm-linux-gnueabi-ld: drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o: in function `stmmac_mdio_unregister': stmmac_mdio.c:(.text+0x1418): undefined reference to `lynx_pcs_destroy' I've tried to come up with a patch that moves this dependency back into the dwmac-socfpga.c file, but there was no easy and obvious way to do this. It also seems that this would not be a proper solution, but instead there should be a real abstraction for pcs drivers that lets device drivers handle this transparently. As the lynx_pcs driver is tiny, it appears that we can just avoid the link error by always forcing it to be built when the stmmac driver is, even for non-altera platforms. This matches what we already do for the xpcs variant that is used by the intel and tegra variants of stmmac. Fixes: 5d1f3fe7d2d54 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 5583f0b055ec7..fa956f2081a53 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -5,6 +5,7 @@ config STMMAC_ETH depends on PTP_1588_CLOCK_OPTIONAL select MII select PCS_XPCS + select PCS_LYNX select PAGE_POOL select PHYLINK select CRC32 @@ -160,7 +161,6 @@ config DWMAC_SOCFPGA select MFD_SYSCON select MDIO_REGMAP select REGMAP_MMIO - select PCS_LYNX help Support for ethernet controller on Altera SOCFPGA -- 2.39.2