Message ID | 20230219150321.2683358-1-trix@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp889004wrn; Sun, 19 Feb 2023 07:13:46 -0800 (PST) X-Google-Smtp-Source: AK7set/480wsdb0EWWyDq5XHuudFtIc9DUikLX67rjun8UQg1BHlRYSI36kmX9l7ovNHjTMXeKuV X-Received: by 2002:a62:4e0a:0:b0:5a8:be42:2c5f with SMTP id c10-20020a624e0a000000b005a8be422c5fmr990244pfb.34.1676819626142; Sun, 19 Feb 2023 07:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676819626; cv=none; d=google.com; s=arc-20160816; b=D6m9K1BRO/IdvSumR2qj+IbYBa2wIDqu7h2aQSqJt+pPtY6LFfng08Dacz/klSk4ei Q+1c0/zorgpyx+vphPn46695CKdjdGR4lvX3L8WIFjMs1jrJ/6KAjzFk1ehXy0htiwSl xQcm1hTkEWwEpqkpmVBx9n2slvPr4J77TlAuTU8/wIChhaB2gmG0x5LRUSFzNC4ASnKj 9/66jIuAXBxCkf6qzYbklhyIr4ci2xWjoHpJtj+XduvB2+ZY4La9Vrozj7RslvRIrss7 M5Dr1Uk6J5Am2COBCgvPDB+UWrCaEZxQWABffIGtJvpM9xHMqzbcvtErOR+L1PpFCa8L 3GeQ== 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=l5O7cDrniZeFvFtupLPAJc4Ul8TEw28vVrb3ohN5kOQ=; b=b0r/FmHw3RLAZUmHvEIyONdF5lHamkaO3EDlLD7TzHqQdBppe6w1SkuPg92bfjOo7u v3nN/lZafn3q3AigG6vfnR0ZQfahiSaxo92fOTskXuxrdxXhE86pj1QUwl0ZBUuxsnJW NbdEVMZS5oM+EvvzWJVuM+fmccFl1zsjs0PA0IEQmeX60/xjd2cZeAjZvOHkGHEi4zLx 790oDbwCojcNS0SvVjryQ4h3jWdwVzk03pEWMeC5YJ2R3ybPMro14LKHLr/wMx9ztT1b t/6fHYyUbo3hMDKrCewfA7zUNk9dbEgdLYYhe16alZlJ86FnGsTdNymBBYFy/801FF3S CDZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DCmufo4+; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a62a107000000b005a910ae9a76si8083906pff.305.2023.02.19.07.13.33; Sun, 19 Feb 2023 07:13:46 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=DCmufo4+; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjBSPEW (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Sun, 19 Feb 2023 10:04:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjBSPEV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Feb 2023 10:04:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F6B1EC45 for <linux-kernel@vger.kernel.org>; Sun, 19 Feb 2023 07:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676819011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l5O7cDrniZeFvFtupLPAJc4Ul8TEw28vVrb3ohN5kOQ=; b=DCmufo4+hII0MTDKvs8L66uphmjvJBYsaQ2CKlzik09DdZgaD0MbsFLeMSkiZdH26xtSBM rlb/EaUFHfJ74rWQBTJz+gSTDOeA+iML6HJKGL8P5dsCeLjfFHgBB+6AcfcoY2wpMu53D3 9kvlsaPD9dwPeb/Fbrt+1mTAsdWUt0A= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-658-AMH0Z6yYNu6WeRGVQzkOWw-1; Sun, 19 Feb 2023 10:03:30 -0500 X-MC-Unique: AMH0Z6yYNu6WeRGVQzkOWw-1 Received: by mail-qv1-f70.google.com with SMTP id x4-20020a0ceb84000000b0056c2797aa8bso521915qvo.2 for <linux-kernel@vger.kernel.org>; Sun, 19 Feb 2023 07:03:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l5O7cDrniZeFvFtupLPAJc4Ul8TEw28vVrb3ohN5kOQ=; b=b0NJ80uzmZRu8nAJE2BhCGTg9ejEAT4AvjzbAsPi9JzdMLQzxSMNlVhCHLwcK2PMkU gjR+KJBsNBt24Ii6DukTwdWMbBOfuAnKK+Ugbc5sMV43dmAgstI9RP4ijuW+RFpyCmBx f5xdinwzfJhKXZX0nrm1ANZ26jPCyOKQQQc4IzKCYaGJuSrHuuF8LdFR65qTtg6CK3lF 0ACptQd6+IvMEAFaGbYQLEBQIFKFzfAnYwCg8ZLUdTcXMAv5in5pO8fy0mcuKfkTkrGy viSLhyrXDVGbg/F5tZ6Z8tsZptrglV6Z2/wrUXqPtm6AjRgYcXDxzYm3oX2n8RbSmbj0 h5Vw== X-Gm-Message-State: AO0yUKWTMuyCR3JVKlCrX0ap/mN3qC7HswDS63hvkwZivvARG1W63zg6 kSRC9PbRqNgpCTGoOaH3X1W8eQLFEBCMErV8y8jTOSB1KsA3ADGnNaWX1913QnseZOjduQo0yBf lg0xmDNCQJWByxaDmHYPMOmdm X-Received: by 2002:a05:622a:144d:b0:3b9:b6e8:8670 with SMTP id v13-20020a05622a144d00b003b9b6e88670mr12947076qtx.51.1676819010075; Sun, 19 Feb 2023 07:03:30 -0800 (PST) X-Received: by 2002:a05:622a:144d:b0:3b9:b6e8:8670 with SMTP id v13-20020a05622a144d00b003b9b6e88670mr12947042qtx.51.1676819009857; Sun, 19 Feb 2023 07:03:29 -0800 (PST) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a4-20020ac84344000000b003b2957fb45bsm7230258qtn.8.2023.02.19.07.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 07:03:29 -0800 (PST) From: Tom Rix <trix@redhat.com> To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, steen.hegelund@microchip.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Rix <trix@redhat.com> Subject: [PATCH] net: lan743x: LAN743X selects FIXED_PHY to resolve a link error Date: Sun, 19 Feb 2023 10:03:21 -0500 Message-Id: <20230219150321.2683358-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758272816247077392?= X-GMAIL-MSGID: =?utf-8?q?1758272816247077392?= |
Series |
net: lan743x: LAN743X selects FIXED_PHY to resolve a link error
|
|
Commit Message
Tom Rix
Feb. 19, 2023, 3:03 p.m. UTC
A rand config causes this link error
drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open':
drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register'
lan743x_netdev_open is controlled by LAN743X
fixed_phy_register is controlled by FIXED_PHY
So LAN743X should also select FIXED_PHY
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/net/ethernet/microchip/Kconfig | 1 +
1 file changed, 1 insertion(+)
Comments
On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > A rand config causes this link error > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > lan743x_netdev_open is controlled by LAN743X > fixed_phy_register is controlled by FIXED_PHY > > So LAN743X should also select FIXED_PHY > > Signed-off-by: Tom Rix <trix@redhat.com> Hi Tom, I am a little confused by this. I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. But I do not see a build failure, and I believe that is because when FIXED_PHY is not set then a stub version of fixed_phy_register(), defined as static inline in include/linux/phy_fixed.h, is used. Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 > --- > drivers/net/ethernet/microchip/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig > index 24c994baad13..43ba71e82260 100644 > --- a/drivers/net/ethernet/microchip/Kconfig > +++ b/drivers/net/ethernet/microchip/Kconfig > @@ -47,6 +47,7 @@ config LAN743X > depends on PCI > depends on PTP_1588_CLOCK_OPTIONAL > select PHYLIB > + select FIXED_PHY > select CRC16 > select CRC32 > help > -- > 2.27.0 >
On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: > On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > > A rand config causes this link error > > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > > > lan743x_netdev_open is controlled by LAN743X > > fixed_phy_register is controlled by FIXED_PHY > > > > So LAN743X should also select FIXED_PHY > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > Hi Tom, > > I am a little confused by this. > > I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. > But I do not see a build failure, and I believe that is because > when FIXED_PHY is not set then a stub version of fixed_phy_register(), > defined as static inline in include/linux/phy_fixed.h, is used. > > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY is a module? What might be needed is depends on FIXED_PHY || FIXED_PHY=n Andrew
On Mon, Feb 20, 2023 at 02:19:34AM +0100, Andrew Lunn wrote: > On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: > > On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > > > A rand config causes this link error > > > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > > > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > > > > > lan743x_netdev_open is controlled by LAN743X > > > fixed_phy_register is controlled by FIXED_PHY > > > > > > So LAN743X should also select FIXED_PHY > > > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > > > Hi Tom, > > > > I am a little confused by this. > > > > I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. > > But I do not see a build failure, and I believe that is because > > when FIXED_PHY is not set then a stub version of fixed_phy_register(), > > defined as static inline in include/linux/phy_fixed.h, is used. > > > > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 > > I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY > is a module? What might be needed is > > depends on FIXED_PHY || FIXED_PHY=n Thanks Andrew, LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom describes. And his patch does appear to resolve the problem. Unfortunately your proposed solution seems to run foul of a complex dependency situation. $ make ... drivers/net/ethernet/microchip/Kconfig:45:error: recursive dependency detected! drivers/net/ethernet/microchip/Kconfig:45: symbol LAN743X depends on FIXED_PHY drivers/net/phy/Kconfig:48: symbol FIXED_PHY depends on PHYLIB drivers/net/phy/Kconfig:16: symbol PHYLIB is selected by LAN743X For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations"
On Mon, Feb 20, 2023 at 07:46:13AM +0100, Simon Horman wrote: > On Mon, Feb 20, 2023 at 02:19:34AM +0100, Andrew Lunn wrote: > > On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: > > > On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > > > > A rand config causes this link error > > > > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > > > > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > > > > > > > lan743x_netdev_open is controlled by LAN743X > > > > fixed_phy_register is controlled by FIXED_PHY > > > > > > > > So LAN743X should also select FIXED_PHY > > > > > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > > > > > Hi Tom, > > > > > > I am a little confused by this. > > > > > > I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. > > > But I do not see a build failure, and I believe that is because > > > when FIXED_PHY is not set then a stub version of fixed_phy_register(), > > > defined as static inline in include/linux/phy_fixed.h, is used. > > > > > > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 > > > > I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY > > is a module? What might be needed is > > > > depends on FIXED_PHY || FIXED_PHY=n > > Thanks Andrew, > > LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom > describes. And his patch does appear to resolve the problem. O.K. So the commit message needs updating to describe the actual problem. > Unfortunately your proposed solution seems to run foul of a complex > dependency situation. I was never any good at Kconfig. Arnd is the expert at solving problems like this. You want either everything built in, or FIXED_PHY built in and LAN743X modular, or both modular. Andrew
+Arnd On Tue, Feb 21, 2023 at 03:29:39AM +0100, Andrew Lunn wrote: > On Mon, Feb 20, 2023 at 07:46:13AM +0100, Simon Horman wrote: > > On Mon, Feb 20, 2023 at 02:19:34AM +0100, Andrew Lunn wrote: > > > On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: > > > > On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > > > > > A rand config causes this link error > > > > > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > > > > > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > > > > > > > > > lan743x_netdev_open is controlled by LAN743X > > > > > fixed_phy_register is controlled by FIXED_PHY > > > > > > > > > > So LAN743X should also select FIXED_PHY > > > > > > > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > > > > > > > Hi Tom, > > > > > > > > I am a little confused by this. > > > > > > > > I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. > > > > But I do not see a build failure, and I believe that is because > > > > when FIXED_PHY is not set then a stub version of fixed_phy_register(), > > > > defined as static inline in include/linux/phy_fixed.h, is used. > > > > > > > > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 > > > > > > I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY > > > is a module? What might be needed is > > > > > > depends on FIXED_PHY || FIXED_PHY=n > > > > Thanks Andrew, > > > > LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom > > describes. And his patch does appear to resolve the problem. > > O.K. So the commit message needs updating to describe the actual > problem. Yes, that would be a good improvement. Perhaps a fixes tag too? > > Unfortunately your proposed solution seems to run foul of a complex > > dependency situation. > > I was never any good at Kconfig. Arnd is the expert at solving > problems like this. > > You want either everything built in, or FIXED_PHY built in and LAN743X > modular, or both modular. I _think_ the patch, which uses select FIXED_PHY for LAN743X, achieves that. I CCed Arnd in case he has any input. Though I think I read in an recent email from him that he is out most of this week.
On 2/21/23 8:20 AM, Simon Horman wrote: > +Arnd > > On Tue, Feb 21, 2023 at 03:29:39AM +0100, Andrew Lunn wrote: >> On Mon, Feb 20, 2023 at 07:46:13AM +0100, Simon Horman wrote: >>> On Mon, Feb 20, 2023 at 02:19:34AM +0100, Andrew Lunn wrote: >>>> On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: >>>>> On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: >>>>>> A rand config causes this link error >>>>>> drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': >>>>>> drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' >>>>>> >>>>>> lan743x_netdev_open is controlled by LAN743X >>>>>> fixed_phy_register is controlled by FIXED_PHY >>>>>> >>>>>> So LAN743X should also select FIXED_PHY >>>>>> >>>>>> Signed-off-by: Tom Rix <trix@redhat.com> >>>>> Hi Tom, >>>>> >>>>> I am a little confused by this. >>>>> >>>>> I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. >>>>> But I do not see a build failure, and I believe that is because >>>>> when FIXED_PHY is not set then a stub version of fixed_phy_register(), >>>>> defined as static inline in include/linux/phy_fixed.h, is used. >>>>> >>>>> Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 >>>> I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY >>>> is a module? What might be needed is >>>> >>>> depends on FIXED_PHY || FIXED_PHY=n >>> Thanks Andrew, >>> >>> LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom >>> describes. And his patch does appear to resolve the problem. >> O.K. So the commit message needs updating to describe the actual >> problem. > Yes, that would be a good improvement. > > Perhaps a fixes tag too? > >>> Unfortunately your proposed solution seems to run foul of a complex >>> dependency situation. >> I was never any good at Kconfig. Arnd is the expert at solving >> problems like this. >> >> You want either everything built in, or FIXED_PHY built in and LAN743X >> modular, or both modular. > I _think_ the patch, which uses select FIXED_PHY for LAN743X, > achieves that. > > I CCed Arnd in case he has any input. Though I think I read > in an recent email from him that he is out most of this week. I was out last week as well :) I considered this a cleanup rather than a fix, I can add that fixes tag. From my point of view this is a linking problem, I don't mind changing, what commit message should I use ? Tom >
On Sun, Feb 26, 2023, at 16:15, Tom Rix wrote: > On 2/21/23 8:20 AM, Simon Horman wrote: >> On Tue, Feb 21, 2023 at 03:29:39AM +0100, Andrew Lunn wrote: >>> On Mon, Feb 20, 2023 at 07:46:13AM +0100, Simon Horman wrote: >>>> >>>> LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom >>>> describes. And his patch does appear to resolve the problem. >>> O.K. So the commit message needs updating to describe the actual >>> problem. >> Yes, that would be a good improvement. >> >> Perhaps a fixes tag too? >> >>>> Unfortunately your proposed solution seems to run foul of a complex >>>> dependency situation. >>> I was never any good at Kconfig. Arnd is the expert at solving >>> problems like this. >>> >>> You want either everything built in, or FIXED_PHY built in and LAN743X >>> modular, or both modular. >> I _think_ the patch, which uses select FIXED_PHY for LAN743X, >> achieves that. >> >> I CCed Arnd in case he has any input. Though I think I read >> in an recent email from him that he is out most of this week. FWIW, the original patch looks good to me, Reviewed-by: Arnd Bergmann <arnd@arndb.de> I'm not sure if the #else path in include/linux/phy_fixed.h is actually helpful, as it does not avoid a link failure but just makes it less common. Maybe we should just drop that from the header and require all users of fixed_phy to 'select' that symbol even when they are built-in? Arnd
On Sun, Feb 26, 2023 at 07:15:01AM -0800, Tom Rix wrote: > > On 2/21/23 8:20 AM, Simon Horman wrote: > > +Arnd > > > > On Tue, Feb 21, 2023 at 03:29:39AM +0100, Andrew Lunn wrote: > > > On Mon, Feb 20, 2023 at 07:46:13AM +0100, Simon Horman wrote: > > > > On Mon, Feb 20, 2023 at 02:19:34AM +0100, Andrew Lunn wrote: > > > > > On Sun, Feb 19, 2023 at 07:16:07PM +0100, Simon Horman wrote: > > > > > > On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote: > > > > > > > A rand config causes this link error > > > > > > > drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open': > > > > > > > drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register' > > > > > > > > > > > > > > lan743x_netdev_open is controlled by LAN743X > > > > > > > fixed_phy_register is controlled by FIXED_PHY > > > > > > > > > > > > > > So LAN743X should also select FIXED_PHY > > > > > > > > > > > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > > > > > Hi Tom, > > > > > > > > > > > > I am a little confused by this. > > > > > > > > > > > > I did manage to cook up a config with LAN743X=m and FIXED_PHY not set. > > > > > > But I do not see a build failure, and I believe that is because > > > > > > when FIXED_PHY is not set then a stub version of fixed_phy_register(), > > > > > > defined as static inline in include/linux/phy_fixed.h, is used. > > > > > > > > > > > > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42 > > > > > I'n guessing, but it could be that LAN743X is built in, and FIXED_PHY > > > > > is a module? What might be needed is > > > > > > > > > > depends on FIXED_PHY || FIXED_PHY=n > > > > Thanks Andrew, > > > > > > > > LAN743X=y and FIXED_PHY=m does indeed produce the problem that Tom > > > > describes. And his patch does appear to resolve the problem. > > > O.K. So the commit message needs updating to describe the actual > > > problem. > > Yes, that would be a good improvement. > > > > Perhaps a fixes tag too? > > > > > > Unfortunately your proposed solution seems to run foul of a complex > > > > dependency situation. > > > I was never any good at Kconfig. Arnd is the expert at solving > > > problems like this. > > > > > > You want either everything built in, or FIXED_PHY built in and LAN743X > > > modular, or both modular. > > I _think_ the patch, which uses select FIXED_PHY for LAN743X, > > achieves that. > > > > I CCed Arnd in case he has any input. Though I think I read > > in an recent email from him that he is out most of this week. > > I was out last week as well :) :) > I considered this a cleanup rather than a fix, I can add that fixes tag. FWIIW, I'm happy with a cleanup. And in that chase there should be no fixes tag (conversely, if it is a fix, then there should be a fixes tag). As a cleanup, I suggest targeting this at net-next ([PATCH net-next]). As net-next is currently closed you'll need to wait for it to re-open. I expect that will happen next week, after v6.3-rc2 has been tagged. > From my point of view this is a linking problem, I don't mind changing, > what commit message should I use ? I think updating the patch description by adding something like "This problem occurs when LAN743X=y and FIXED_PHY=m." would be sufficient.
diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig index 24c994baad13..43ba71e82260 100644 --- a/drivers/net/ethernet/microchip/Kconfig +++ b/drivers/net/ethernet/microchip/Kconfig @@ -47,6 +47,7 @@ config LAN743X depends on PCI depends on PTP_1588_CLOCK_OPTIONAL select PHYLIB + select FIXED_PHY select CRC16 select CRC32 help