From patchwork Wed Jun 7 13:56:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 104531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp232535vqr; Wed, 7 Jun 2023 07:16:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uo++0MzfOHB/IrwG3fT1WtJE5P+M51jVLUtIfDcQsyMThIwCk5lvCHvcvK4eDcW/Dzf6k X-Received: by 2002:a17:902:c20c:b0:1ae:32d3:43b8 with SMTP id 12-20020a170902c20c00b001ae32d343b8mr5416396pll.11.1686147390511; Wed, 07 Jun 2023 07:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686147390; cv=none; d=google.com; s=arc-20160816; b=Aide/8JKqzq12Y+tosb3XQpNx8shtEf9sV7QYpy+saFLNHWzDcoyyTZzrYErMeo1Gg iwP0tBZfaJr/2w12PaK6YzV8Ht7aGSFeKiqiXApW05vtrnScefGTIn8wCL0umccYI8aH YmYY/F4hPUDFPr94I+W3vQhEIWe1FdFC90I+HkT+vsaAU02y3R0YzLlFCMVMw97NPEHm EBvZai1ODhAE1UP69BuSdY4T79YLm2lOxzNX8Ih4tWQi5M1UI6AaRtTFZVoapjNEufTJ /xi1ErF8BuLKPOs4GLncGmrsrpsJos0SnMaweiIPBDkD39SQE/+ynT/LjiW6APQwrmYf 3AEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Sb46lb0dj6abs+gSukwQv9X3esf+pt9Y+yG7J5O0cuY=; b=ow3/xsfS/LSQWsWdU7x4s4oP/BDGsHhPPeduzaG0PgGhT11yEMrU5FNSpXLwGRFmgM znPqiEno6Xu/ubYrHkOhz2m1DurvRtT+xfUIomKP/VLUbWjpWuOyP6B6NPxNnOCqCmNe zjrNKl8RzXeEgXLRvuShfiG+hlIpQMud/hneP97iDEtpSeSW4MaXyEOSzr5FeTwdKOut 2ZAjQVRoMADarr2e6/jsAX+Ltz0dSnPgqoml8TcSY2CZ2MbwQC9lAvOUF99AV984DtoE dYb38qPMM4zlpSg6wuazk3TrtFOHJVwm+VtdpQA022KCWTRA0vmrjyMyL4sDM60SE5Yn ycNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D5AMwlgU; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd5-20020a170902830500b001a1d78af685si8630951plb.466.2023.06.07.07.16.17; Wed, 07 Jun 2023 07:16:30 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=D5AMwlgU; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239762AbjFGN4u (ORCPT + 99 others); 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768053686560299639?= X-GMAIL-MSGID: =?utf-8?q?1768053686560299639?= 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 From patchwork Wed Jun 7 13:56:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 104530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp232134vqr; Wed, 7 Jun 2023 07:16:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44+hpHzj2vTOQU2GK62CcXsuihVwLrlkoJxgKHdkfFUKD9S1qz0YwGMOFzjm6jFLNFLjUp X-Received: by 2002:a17:902:db0f:b0:1af:981b:eeff with SMTP id m15-20020a170902db0f00b001af981beeffmr5376560plx.64.1686147362805; Wed, 07 Jun 2023 07:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686147362; cv=none; d=google.com; s=arc-20160816; b=aB0LB33bBs8/ArIyy23o0akWBVPyXWVhGbdBjdCBTJSv2R7WjuEVL+3kY5Sqtkq/w4 ts2ksnftuji4A2mIc9A3sh9UgTB+BO2mjZwpdf/YatGiGEsBDnoDJYcyO9Burtp/zE9R sE0T4HwdUGEDhUA+vfXnKSq+xpOhGqsSoKLox5zWfi/YuuwLDK6daOcbz7nhfdn/5VmW NOqQvmys3VZOLKCiOdLCQNw2qyTPNn6yKo6smXPaXLUIQFrQ9QfbGW9IO6PxxJyxjDik /uab/VAZZqAN4URMeDTWsHKos5JlpopKuigBDt5CWvJlD88ckSOkpHdg/Lwg8q/x8GDf 4GkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9hRoTzu+ly7Cf0Zo6mlsJ/mXYYh8jVQI6mBbTOCGo+4=; b=z68+I4kUkj43AF2+FWGl8jJ20YoLmYNNekoZcxw8BGt9RJYO44iP75wW17bOPqDAvC zyBHtMvjinVw0+WfNVSB+TGzkh2HXbVblwo5TDymbJlfHIL21rD6ciWphP98sTT04sha pt3msHfW1G+I6H3QAEHzG2tW4626oKVyTojf7rIH/Ov8tgDsYRYGgnkWwbMutsUUlSWb JTN2ltLM1mktaXY2ytZO4qZlEQYHK67/YWdeyKzdAvkCP4h4RSBX6yEpT46bAoKmqlz/ uQmzj/OvLS31Wsu+VOWqkzr+BoZKtmFV2XVH5iTWlzCSbyWBepnCqZ97O/mwsGbs/985 n8AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cBhVEDK+; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a14-20020a170902ecce00b001adf26b357bsi1349025plh.631.2023.06.07.07.15.46; Wed, 07 Jun 2023 07:16:02 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=cBhVEDK+; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239870AbjFGN5A (ORCPT + 99 others); Wed, 7 Jun 2023 09:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239861AbjFGN45 (ORCPT ); Wed, 7 Jun 2023 09:56:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9CB1BEA for ; Wed, 7 Jun 2023 06:56:56 -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 08F0163F99 for ; Wed, 7 Jun 2023 13:56:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AE65C433EF; Wed, 7 Jun 2023 13:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686146215; bh=r/dkeieRe+CBoWvVAbirfQe75r6oLh/K8kfqL8af9hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cBhVEDK+bGfJNxNkcrFUiig1oWzsBWPMPtjov+xF+5agQV6NYtYaDfU7xTAQhH/XW hTHp1n1g4wkwBygN4PCLDkJ0a4yY/eZiaTUHURRV/vnnjH38RAXjedh3la9SF1dO/f OTKHTuhKrNavhhi+tRgkpaJ/WIlLocnI28wpcHnV1lScn2fUyf3D1I1MZlc29ofQiP LPsDLGGbkQPSZPNEGFbUmqbGG9OLZaGVHnA+CyKbxWgUu7zN8VwSQijOq8sYjz/LVt bs254+DnLjkTQpPyQx9CYn4LZfWqVmViL+Mr6JA4o38CJ2wt2Al8OmCXcWTPi5CH1m Zl8I09ruBqFhQ== From: Arnd Bergmann To: Joyce Ooi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Chevallier , Simon Horman Cc: Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] net: altera-tse: fix broken Kconfig dependency Date: Wed, 7 Jun 2023 15:56:33 +0200 Message-Id: <20230607135638.1341101-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230607135638.1341101-1-arnd@kernel.org> References: <20230607135638.1341101-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768053657108183897?= X-GMAIL-MSGID: =?utf-8?q?1768053657108183897?= From: Arnd Bergmann The CONFIG_PCS_ALTERA_TSE symbol is gone, so make sure the ethernet driver selects the correct symbol for its replacement, avoiding: x86_64-linux-ld: drivers/net/ethernet/altera/altera_tse_main.o: in function `altera_tse_remove': altera_tse_main.c:(.text+0xdf): undefined reference to `lynx_pcs_destroy' Fixes: 196eec4062b00 ("net: pcs: Drop the TSE PCS driver") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/altera/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/altera/Kconfig b/drivers/net/ethernet/altera/Kconfig index 93533ba034294..17985319088c1 100644 --- a/drivers/net/ethernet/altera/Kconfig +++ b/drivers/net/ethernet/altera/Kconfig @@ -4,7 +4,7 @@ config ALTERA_TSE depends on HAS_DMA select PHYLIB select PHYLINK - select PCS_ALTERA_TSE + select PCS_LYNX select MDIO_REGMAP select REGMAP_MMIO help