From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH 18/20] clocksource / acpi: Add macro CLOCKSOURCE_ACPI_DECLARE Date: Fri, 24 Jan 2014 15:15:13 +0000 Message-ID: <20140124151513.GD19052@arm.com> References: <1389961514-13562-1-git-send-email-hanjun.guo@linaro.org> <1389961514-13562-19-git-send-email-hanjun.guo@linaro.org> <20140122114537.GA15591@e106331-lin.cambridge.arm.com> <52E1B1DE.5050507@linaro.org> <20140124120815.GH814@e106331-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from fw-tnat.austin.arm.com ([217.140.110.23]:59397 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752541AbaAXPPv (ORCPT ); Fri, 24 Jan 2014 10:15:51 -0500 Content-Disposition: inline In-Reply-To: <20140124120815.GH814@e106331-lin.cambridge.arm.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Mark Rutland Cc: Hanjun Guo , Linus Walleij , "Rafael J. Wysocki" , Will Deacon , Russell King - ARM Linux , ACPI Devel Maling List , "linux-arm-kernel@lists.infradead.org" , "grant.likely@linaro.org" , Matthew Garrett , Olof Johansson , Bjorn Helgaas , Rob Herring , Arnd Bergmann , Patch Tracking , "linux-kernel@vger.kernel.org" , linaro-kernel , "linaro-acpi@lists.linaro.org" , Charles Garcia-Tobin , Amit Daniel Kachhap On Fri, Jan 24, 2014 at 12:08:15PM +0000, Mark Rutland wrote: > On Fri, Jan 24, 2014 at 12:20:46AM +0000, Hanjun Guo wrote: > > On 2014=E5=B9=B401=E6=9C=8822=E6=97=A5 19:45, Mark Rutland wrote: > > > On Wed, Jan 22, 2014 at 08:26:50AM +0000, Linus Walleij wrote: > > >> On Fri, Jan 17, 2014 at 1:25 PM, Hanjun Guo wrote: > > >> > > >>> From: Amit Daniel Kachhap > > >>> > > >>> This macro does the same job as CLOCKSOURCE_OF_DECLARE. The dev= ice > > >>> name from the ACPI timer table is matched with all the register= ed > > >>> timer controllers and matching initialisation routine is invoke= d. > > >>> > > >>> Signed-off-by: Amit Daniel Kachhap > > >>> Signed-off-by: Hanjun Guo > > >> Actually I have a fat patch renaming CLOCKSOURCE_OF_DECLARE() > > >> to TIMER_OF_DECLARE() and I think this macro, if needed, should > > >> be named TIMER_ACPI_DECLARE(). > > >> > > >> The reason is that "clocksource" is a Linux-internal name and th= is > > >> macro pertains to the hardware name in respective system > > >> description type. > > >> > > >>> +#ifdef CONFIG_ACPI > > >>> +#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn) = \ > > >>> + static const struct acpi_device_id __clksrc_acpi_table_= ##name \ > > >>> + __used __section(__clksrc_acpi_table) = \ > > >>> + =3D { .id =3D compat, = \ > > >>> + .driver_data =3D (kernel_ulong_t)fn } > > >>> +#else > > >>> +#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn) > > >>> +#endif > > >> This hammers down the world to compile one binary for ACPI > > >> and one binary for device tree. Maybe that's fine, I don't know. > > > How does it do that? > > > > > > As far as I could tell CONFIG_ACPI and CONFIG_OF are not mutually > > > exclusive, and this just means that we only build the datastructu= res for > > > matching from ACPI when CONFIG_ACPI is enabled. > > > > > > Have I missed something? > > > > > > I definitely don't want to see mutually exclusive ACPI and DT sup= port. > >=20 > > ACPI and DT did the same job so I think they should mutually exclus= ive. > > if we enable both DT and ACPI in one system, this will leading conf= usions. >=20 > ACPI and DT do similar jobs, and we should be mutually exclusive at > runtime. However, they should not be mutually exclusive at compile-ti= me. >=20 > Being mutually exclusive at compile-time is just broken. It creates m= ore > work for distributions (who need to ship double the number of kernels= ), > it increases the number of configurations requiring testing, and it > makes it easier for bugs to be introduced. It's just painful, and > there's no reason for it. I fully agree (IOW, I'll NAK patches that break this assumption; we wan= t single kernel image whether it uses DT or ACPI). > At boot time the kernel needs to decide which to use for hardware > description, and completely ignore the other (which should not be > present, but lets not assume that or inevitably someone will break th= at > assumption for a quick hack). >=20 > The same kernel should boot on a system that has a DTB or a system th= at > has ACPI tables. On a system that's provided both it should use one o= r > the other, but not both. Do we still need the chosen node to be passed via DT for command line, even if the kernel uses ACPI? --=20 Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html