Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296Ab3FEJYF (ORCPT ); Wed, 5 Jun 2013 05:24:05 -0400 Received: from mail.free-electrons.com ([94.23.35.102]:34227 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511Ab3FEJYD (ORCPT ); Wed, 5 Jun 2013 05:24:03 -0400 Message-ID: <51AF03AF.3080106@free-electrons.com> Date: Wed, 05 Jun 2013 11:23:59 +0200 From: Alexandre Belloni Organization: Free Electrons User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Florian Fainelli CC: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel , "shawn.guo" , David Miller , Nicolas Ferre Subject: Re: [PATCHv2 1/3] net: phy: prevent linking breakage References: <1369741403-25315-2-git-send-email-alexandre.belloni@free-electrons.com> <6466898.RnYOe3jpGG@wuerfel> <1394174.ONngHnHYKL@wuerfel> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2348 Lines: 55 On 04/06/2013 18:09, Florian Fainelli wrote: > 2013/6/4 Arnd Bergmann : >> On Tuesday 04 June 2013 16:36:50 Florian Fainelli wrote: >>> It seems to me that what David proposes is to have say an >>> arch/arm/mach-foo/phy-fixups.c file which is only enabled when >>> CONFIG_PHYLIB is set (obj-$(CONFIG_PHYLIB) += phy-fixup.o), such that >>> it does not need to have any conditionnals when calling >>> phy_register_fixup. This sounds a little unusual, but why not. >> I don't think it would actually help us, because then we still need >> to declare a local function that gets called from the board init >> code. Instead of doing >> >> if (IS_ENABLED(CONFIG_PHYLIB)) >> phy_register_fixup_for_uid(phy_id, foo_phy_fixup); >> >> we would then do >> >> if (IS_ENABLED(CONFIG_PHYLIB)) >> foo_phy_fixup_register(); >> >> which is not much different at all. > You would just need to define a stub for your arch_foo_phy_fixup() > which has a different definition depending on whether CONFIG_PHYLIB is > defined or not. > > This would be just one function, instead of the whole bunch of stubs > needed for phylib. Right now its probably 1 vs 3, so it does not make > that much of a difference but who knows, if we had more phylib stubs > and forget to update the stubs? (which tends to happen pretty often). The fact is that for now it is called on 6 different platforms. Of those: - two (imx and mxs) are now doing it right *after* discovering the issue - two always selecting PHYLIB and can't be compiled without NET - two will break at compile time. I'm really concerned about getting more platforms getting it wrong. I think it boils down to who wants to take the maintenance burden. I would believe that doing it in phylib is more future proof. But I'm fine with whatever the consensus will be. However, it is becoming urgent for Atmel to get the fix in 3.10 so that they never get a kernel compilation that breaks. Regards, -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/