Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754969AbbHLPXq (ORCPT ); Wed, 12 Aug 2015 11:23:46 -0400 Received: from foss.arm.com ([217.140.101.70]:58987 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397AbbHLPXn (ORCPT ); Wed, 12 Aug 2015 11:23:43 -0400 Date: Wed, 12 Aug 2015 16:23:38 +0100 From: Catalin Marinas To: David Daney Cc: David Miller , mark.rutland@arm.com, linux-mips@linux-mips.org, rafael@kernel.org, netdev@vger.kernel.org, david.daney@cavium.com, linux-kernel@vger.kernel.org, tomasz.nowicki@linaro.org, rrichter@cavium.com, linux-acpi@vger.kernel.org, ddaney.cavm@gmail.com, sgoutham@cavium.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 0/2] net: thunder: Add ACPI support. Message-ID: <20150812152337.GB5393@e104818-lin.cambridge.arm.com> References: <1439254717-2875-1-git-send-email-ddaney.cavm@gmail.com> <20150811.114908.1384923604512568161.davem@davemloft.net> <55CA5567.9010002@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55CA5567.9010002@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1995 Lines: 47 On Tue, Aug 11, 2015 at 01:04:55PM -0700, David Daney wrote: > On 08/11/2015 11:49 AM, David Miller wrote: > >From: David Daney > >Date: Mon, 10 Aug 2015 17:58:35 -0700 > > > >>Change from v1: Drop PHY binding part, use fwnode_property* APIs. > >> > >>The first patch (1/2) rearranges the existing code a little with no > >>functional change to get ready for the second. The second (2/2) does > >>the actual work of adding support to extract the needed information > >>from the ACPI tables. > > > >Series applied. > > Thank you very much. > > >In the future it might be better structured to try and get the OF > >node, and if that fails then try and use the ACPI method to obtain > >these values. > > Our current approach, as you can see in the patch, is the opposite. If ACPI > is being used, prefer that over the OF device tree. > > You seem to be recommending precedence for OF. It should be consistent > across all drivers/sub-systems, so do you really think that OF before ACPI > is the way to go? On arm64 (unless you use a vendor kernel), DT takes precedence over ACPI if both arm provided to the kernel (and it's a fair assumption given that ACPI on ARM is still in the early days). You could also force ACPI with acpi=force on the kernel cmd line and the arch code will not unflatten the DT even if it is provided, therefore is_of_node(fwnode) returning false. I haven't looked at your driver in detail but something like AMD's xgbe_probe() uses a single function for both DT and ACPI with device_property_read_*() functions getting the information from the correct place in either case. The ACPI vs DT precedence is handled by the arch boot code, we never mix the two and confuse the drivers. -- Catalin -- 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/