From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754984AbdFLQJW (ORCPT ); Mon, 12 Jun 2017 12:09:22 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38715 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982AbdFLQJT (ORCPT ); Mon, 12 Jun 2017 12:09:19 -0400 Subject: Re: mdio-thunder.c:undefined reference to `mdiobus_unregister' To: kbuild test robot , Florian Fainelli Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, "netdev@vger.kernel.org" , Arnd Bergmann References: <201706121044.hytIipdV%fengguang.wu@intel.com> From: Randy Dunlap Message-ID: Date: Mon, 12 Jun 2017 09:09:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <201706121044.hytIipdV%fengguang.wu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/11/17 19:14, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 32c1431eea4881a6b17bd7c639315010aeefa452 > commit: 90eff9096c01ba90cdae504a6b95ee87fe2556a3 net: phy: Allow splitting MDIO bus/device support from PHYs > date: 3 months ago > config: x86_64-randconfig-s2-06120830 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: > git checkout 90eff9096c01ba90cdae504a6b95ee87fe2556a3 > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > > drivers/built-in.o: In function `thunder_mdiobus_pci_remove': >>> mdio-thunder.c:(.text+0x2a212f): undefined reference to `mdiobus_unregister' >>> mdio-thunder.c:(.text+0x2a2138): undefined reference to `mdiobus_free' > drivers/built-in.o: In function `thunder_mdiobus_pci_probe': > mdio-thunder.c:(.text+0x2a22e7): undefined reference to `devm_mdiobus_alloc_size' > mdio-thunder.c:(.text+0x2a236f): undefined reference to `of_mdiobus_register' > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation > Ugh. I don't know the solution to this one. CONFIG_MDIO_DEVICE=y CONFIG_MDIO_THUNDER=y CONFIG_PHYLIB=m First 2 lines are OK, but the third line causes the problem... in drivers/net/phy/Makefile: # PHYLIB implies MDIO_DEVICE, in that case, we have a bunch of circular # dependencies that does not make it possible to split mdio-bus objects into a # dedicated loadable module, so we bundle them all together into libphy.ko ifdef CONFIG_PHYLIB libphy-y += $(mdio-bus-y) else obj-$(CONFIG_MDIO_DEVICE) += mdio-bus.o endif libphy-$(CONFIG_SWPHY) += swphy.o libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_led_triggers.o obj-$(CONFIG_PHYLIB) += libphy.o So PHYLIB is built as libphy.ko and the mdiobus functions are there instead of being in mdio-bus.o (so they are not built-in), while the mdio-thunder driver is built-in. -- ~Randy