Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbbKIQ6i (ORCPT ); Mon, 9 Nov 2015 11:58:38 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64455 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbbKIQ6f (ORCPT ); Mon, 9 Nov 2015 11:58:35 -0500 From: Arnd Bergmann To: Andrew Lunn Cc: netdev@vger.kernel.org, Thomas Petazzoni , Florian Fainelli , linux-kernel@vger.kernel.org, Stas Sergeev , "David S. Miller" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] mvneta: add FIXED_PHY dependency Date: Mon, 09 Nov 2015 17:57:43 +0100 Message-ID: <6910088.dNmooXDTJR@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151109164232.GB3388@lunn.ch> References: <4225885.EYXTHjRPmX@wuerfel> <20151109164232.GB3388@lunn.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:29RzwkxSsYsmZES4tJl04siIv50YiJPBJzkJAIetqTh0eI7N/c7 YaijCRmkPejtpNf6wwSQ5yI0ud4U54LDBg1GbYj16SvGH3WUa4//kf0vOSlQPmtY61FHQCl pbS9ZxtHJH7kpF+9/W3qFJtpTqZQ+aZQYkI9rfp9gl08y1AKcWwO6CWjdQpubuZqI5VAt51 I2T1iIChmrP/y5ISTb05A== X-UI-Out-Filterresults: notjunk:1;V01:K0:PJlNXpDuYtg=:LhLd3oYqEcC4h/4Zq4UKF+ npDi+/ajrfb6owN437LcQPJaS12zleLOV033lYwsMu/zZGg9lM1PimlFRZHoU5601jLX4YK2x h2LA+3BH/e9UG0I386ls4xGgSC7LcGZ6PWGNxPDhOX3bz6j6Mg5DdDV2wVMv+ekZhpeemFqCV ejB2AbdUlnWhwjQi+3LvnAj5bLVUVOXu2Ku5NV95HIcn76M6s7EzPxWVz3NTc6iyHC8oeZH/w VGAPBBYKLk8SgYJAlmXeJAC6CmhDFistOcoPA+qeZ+hR67oqOTS0A5VG+B6K+Qly0DV4ZAlsB 7mcozwwL2wtZOpUyopsifNVLueelcSyoizxRTxuVk2Sjaa8tQx2HXlGKxOzipI2iSpTowTkkg jJDiBpm9UEsQXOopdb2XBxGtcnYaAVzv//X2N9dXQlDIxVgomdnTNrdIdHedQcNo0sUX4JVNi SsYdKF4duG0T2TUbPSQ1cFQBaeugl3PmlFGSahT9a6QQUJqB1j4JoOpJmCF/VZ7EVBVpC+BNo dTi0JVpIbjB5YziDbsVwZKXSyOuAMCWKne8NQd0TZ6kOnquiIyREZgturC8gqt88vTP1Hg30f hWPFqokXjGdTJ/7qPW1fKbDBQt3QDxd0kfr6+z5X43CKS3fUDA1mdLWHV8z5mfbCJaHWgvS4+ SCr493m6eBZJ5AJNhJJRm1QH3+W7G8YcDsx6qZXjqATXGp61w9REviH1Ar9l490MvBe/k1QSX a0SYeL/l0MrB1e73 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2468 Lines: 57 On Monday 09 November 2015 17:42:32 Andrew Lunn wrote: > On Mon, Nov 09, 2015 at 03:08:57PM +0100, Arnd Bergmann wrote: > > The fixed_phy infrastructure is done in a way that is optional, > > by providing 'static inline' helper functions doing nothing in > > include/linux/phy_fixed.h for all its APIs. However, three out > > of the four users (DSA, BCMGENET, and SYSTEMPORT) always > > 'select FIXED_PHY', presumably because they need that. > > Hi Arnd > > Need is probably too strong, it could be considered an optional > feature. If you don't have a fixed_phy property in your DT blob, you > don't need fixed phy support in your image. Ok, I see. > > MVNETA is the fourth one, and if that is built-in but FIXED_PHY > > is configured as a loadable module, we get a link error: > > > > drivers/built-in.o: In function `mvneta_fixed_link_update': > > fpga-mgr.c:(.text+0x33ed80): undefined reference to `fixed_phy_update_state' > > > > Presumably this driver has the same dependency as the others, > > so this patch also uses 'select' to ensure that the fixed-phy > > support is built-in. > > This will work, and is uniform with the other instances. But maybe a > more correct fix is to ensure fixed-phy is never a module when there > is a builtin user. That is hard to express with Kconfig. The alternative I listed instead guarantees that CONFIG_MVNETA cannot be set to 'y' whenever FIXED_PHY=m. For all practical purposes that has the same effect. The fixed-phy support isn't very big (around 2KB), so I wonder how relevant that optimization is. > > Should we perhaps make 'FIXED_PHY' a silent option and remove the > > inline helpers, based on the assumption that a driver that wants these > > will not work without them? > > I suppose it comes down to, are we allowed to optionally implement > part of the DT binding? I'm not sure what you are asking. A lot of DT bindings have both optional and mandatory properties. For mvneta, the "phy" and "phy-mode" properties are listed as mandatory, so the driver can safely assume that they are always present. If there are reasons to leave them out, and for the driver to handle that case correctly, the binding should be updated to mark them as optional. Arnd -- 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/