Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: David Daney <ddaney.cavm@gmail.com>, <david.daney@cavium.com>,
	<aleksey.makarov@caviumnetworks.com>, <ulf.hansson@linaro.org>,
	<robh@kernel.org>, <ralf@linux-mips.org>,
	<linux-mmc@vger.kernel.org>, <linux-mips@linux-mips.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH v6 2/3] MIPS: OCTEON: Rename legacy properties in internal device trees.
Date: Thu, 11 Feb 2016 09:35:06 -0800	[thread overview]
Message-ID: <56BCC64A.5040902@caviumnetworks.com> (raw)
In-Reply-To: <56BCBC90.6090805@imgtec.com>

On 02/11/2016 08:53 AM, Matt Redfearn wrote:
> Hi David,
>
> On 11/02/16 16:32, David Daney wrote:
>> On 02/11/2016 08:26 AM, Matt Redfearn wrote:
>>> Many OCTEON devices have been shipped in products with fixed DTBs. These
>>> DTBS contain properties which are not compatible with newer kernels with
>>> upstream drivers.
>>> Therefore some mechanism is necessary to convert legacy naming into
>>> upstream naming. In the first instance this is to support the OCTEON MMC
>>> controller, which is in a later patch of this series.
>>> This patch adds a octeon_handle_legacy_device_tree() function which is
>>> always called from device_tree_init() to fix up the device tree so that
>>> drivers need have no knowledge of the legacy naming or properties.
>>>
>>> Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
>>
>> NAK...
>>
>> I already sent e-mail on this, but it crossed in flight.
>
> Yeah, unfortunate timing.
>
>>
>> Basically, this patch is much more complex than the original code
>> which was just a few lines to check the alternate "legacy" names.
>
> This code is functionally equivalent to the previous version, just
> located in platform code rather than the driver itself.

I know, one thing I really don't like about it, is that we are modifying 
the kernel's view of the device that was passed in.  How does that 
effect what is seen in /sys/firmware ?

I would rather see code that calls mmc_of_parse(), and then, if the two 
properties in question (bus-width, and max-frequency) have not been 
filled in, attempt to read them with the legacy names using 
of_property_read_u32()

The implementation of mmc_of_parse() already contains support for 
parsing legacy properties, so we could also add a couple more there, 
which would be the simplest change of all.


> In terms of LOC
> it's not much different. Doing it this was does allow future flexibility
> to change other bindings that are fixed in firmware without having to
> support each set in the individual drivers.

I think the controversy is limited to the MMC driver.  As far as I know, 
we are in good shape with the bindings for the other drivers.


> Leaving this patch out will mean having to get any legacy bindings
> accepted into each driver via their maintainer.
> But for the moment we're just talking about the MMC driver - if this
> patch is not accepted then the only way to support legacy devices is
> with Ulf's signoff of handling both binding versions in the driver.
>
[...]

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
	david.daney@cavium.com, aleksey.makarov@caviumnetworks.com,
	ulf.hansson@linaro.org, robh@kernel.org, ralf@linux-mips.org,
	linux-mmc@vger.kernel.org, linux-mips@linux-mips.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v6 2/3] MIPS: OCTEON: Rename legacy properties in internal device trees.
Date: Thu, 11 Feb 2016 09:35:06 -0800	[thread overview]
Message-ID: <56BCC64A.5040902@caviumnetworks.com> (raw)
Message-ID: <20160211173506.Q1TfxwIHUyyHWfJJtHqatuwIwkuY5FGZEOX76eKLsB8@z> (raw)
In-Reply-To: <56BCBC90.6090805@imgtec.com>

On 02/11/2016 08:53 AM, Matt Redfearn wrote:
> Hi David,
>
> On 11/02/16 16:32, David Daney wrote:
>> On 02/11/2016 08:26 AM, Matt Redfearn wrote:
>>> Many OCTEON devices have been shipped in products with fixed DTBs. These
>>> DTBS contain properties which are not compatible with newer kernels with
>>> upstream drivers.
>>> Therefore some mechanism is necessary to convert legacy naming into
>>> upstream naming. In the first instance this is to support the OCTEON MMC
>>> controller, which is in a later patch of this series.
>>> This patch adds a octeon_handle_legacy_device_tree() function which is
>>> always called from device_tree_init() to fix up the device tree so that
>>> drivers need have no knowledge of the legacy naming or properties.
>>>
>>> Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
>>
>> NAK...
>>
>> I already sent e-mail on this, but it crossed in flight.
>
> Yeah, unfortunate timing.
>
>>
>> Basically, this patch is much more complex than the original code
>> which was just a few lines to check the alternate "legacy" names.
>
> This code is functionally equivalent to the previous version, just
> located in platform code rather than the driver itself.

I know, one thing I really don't like about it, is that we are modifying 
the kernel's view of the device that was passed in.  How does that 
effect what is seen in /sys/firmware ?

I would rather see code that calls mmc_of_parse(), and then, if the two 
properties in question (bus-width, and max-frequency) have not been 
filled in, attempt to read them with the legacy names using 
of_property_read_u32()

The implementation of mmc_of_parse() already contains support for 
parsing legacy properties, so we could also add a couple more there, 
which would be the simplest change of all.


> In terms of LOC
> it's not much different. Doing it this was does allow future flexibility
> to change other bindings that are fixed in firmware without having to
> support each set in the individual drivers.

I think the controversy is limited to the MMC driver.  As far as I know, 
we are in good shape with the bindings for the other drivers.


> Leaving this patch out will mean having to get any legacy bindings
> accepted into each driver via their maintainer.
> But for the moment we're just talking about the MMC driver - if this
> patch is not accepted then the only way to support legacy devices is
> with Ulf's signoff of handling both binding versions in the driver.
>
[...]

  parent reply	other threads:[~2016-02-11 17:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 16:26 [PATCH v6 1/3] mmc: OCTEON: Add DT bindings for OCTEON MMC controller Matt Redfearn
2016-02-11 16:26 ` Matt Redfearn
2016-02-11 16:26 ` [PATCH v6 2/3] MIPS: OCTEON: Rename legacy properties in internal device trees Matt Redfearn
2016-02-11 16:26   ` Matt Redfearn
2016-02-11 16:32   ` David Daney
2016-02-11 16:53     ` Matt Redfearn
2016-02-11 16:53       ` Matt Redfearn
2016-02-11 17:35       ` David Daney [this message]
2016-02-11 17:35         ` David Daney
2016-02-15  8:17         ` Matt Redfearn
2016-02-15  8:17           ` Matt Redfearn
2016-02-11 16:26 ` [PATCH v6 3/3] mmc: OCTEON: Add host driver for OCTEON MMC controller Matt Redfearn
2016-02-11 16:26   ` Matt Redfearn

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=56BCC64A.5040902@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=aleksey.makarov@caviumnetworks.com \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=matt.redfearn@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox