All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Miller <davem@davemloft.net>,
	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.
Date: Wed, 12 Aug 2015 08:36:04 -0700	[thread overview]
Message-ID: <55CB67E4.8030001@caviumnetworks.com> (raw)
In-Reply-To: <20150812152337.GB5393@e104818-lin.cambridge.arm.com>

On 08/12/2015 08:23 AM, Catalin Marinas wrote:
> 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 <ddaney.cavm@gmail.com>
>>> 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.
>

My long term plan is to create something like 
firmware_get_mac_address(), that would encapsulate  of_get_mac_address() 
and the ACPI equivalent.

Same for firmware_phy_find_device().

These would function as you suggest, but lacking this infrastructure, we 
implemented this patch set instead.

Thanks,
David Daney

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Miller <davem@davemloft.net>, <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.
Date: Wed, 12 Aug 2015 08:36:04 -0700	[thread overview]
Message-ID: <55CB67E4.8030001@caviumnetworks.com> (raw)
In-Reply-To: <20150812152337.GB5393@e104818-lin.cambridge.arm.com>

On 08/12/2015 08:23 AM, Catalin Marinas wrote:
> 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 <ddaney.cavm@gmail.com>
>>> 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.
>

My long term plan is to create something like 
firmware_get_mac_address(), that would encapsulate  of_get_mac_address() 
and the ACPI equivalent.

Same for firmware_phy_find_device().

These would function as you suggest, but lacking this infrastructure, we 
implemented this patch set instead.

Thanks,
David Daney

WARNING: multiple messages have this Message-ID (diff)
From: ddaney@caviumnetworks.com (David Daney)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/2] net: thunder: Add ACPI support.
Date: Wed, 12 Aug 2015 08:36:04 -0700	[thread overview]
Message-ID: <55CB67E4.8030001@caviumnetworks.com> (raw)
In-Reply-To: <20150812152337.GB5393@e104818-lin.cambridge.arm.com>

On 08/12/2015 08:23 AM, Catalin Marinas wrote:
> 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 <ddaney.cavm@gmail.com>
>>> 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.
>

My long term plan is to create something like 
firmware_get_mac_address(), that would encapsulate  of_get_mac_address() 
and the ACPI equivalent.

Same for firmware_phy_find_device().

These would function as you suggest, but lacking this infrastructure, we 
implemented this patch set instead.

Thanks,
David Daney

  reply	other threads:[~2015-08-12 15:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11  0:58 [PATCH v2 0/2] net: thunder: Add ACPI support David Daney
2015-08-11  0:58 ` David Daney
2015-08-11  0:58 ` [PATCH v2 1/2] net: thunder: Factor out DT specific code in BGX David Daney
2015-08-11  0:58   ` David Daney
2015-08-11  0:58 ` [PATCH v2 2/2] net, thunder, bgx: Add support to get MAC address from ACPI David Daney
2015-08-11  0:58   ` David Daney
2015-08-11 18:49 ` [PATCH v2 0/2] net: thunder: Add ACPI support David Miller
2015-08-11 18:49   ` David Miller
2015-08-11 20:04   ` David Daney
2015-08-11 20:04     ` David Daney
2015-08-11 20:04     ` David Daney
2015-08-11 20:12     ` Robert Richter
2015-08-11 20:12       ` Robert Richter
2015-08-11 20:12       ` Robert Richter
2015-08-11 20:50       ` David Miller
2015-08-11 20:50         ` David Miller
2015-08-11 20:49     ` David Miller
2015-08-11 20:49       ` David Miller
2015-08-12 15:23     ` Catalin Marinas
2015-08-12 15:23       ` Catalin Marinas
2015-08-12 15:36       ` David Daney [this message]
2015-08-12 15:36         ` David Daney
2015-08-12 15:36         ` David Daney
2015-08-13  8:34         ` Hanjun Guo
2015-08-13  8:34           ` Hanjun Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CB67E4.8030001@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rrichter@cavium.com \
    --cc=sgoutham@cavium.com \
    --cc=tomasz.nowicki@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.