All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Viresh Kumar <viresh.kumar@st.com>,
	"cjb@laptop.org" <cjb@laptop.org>,
	"patches@linaro.org" <patches@linaro.org>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"ben-linux@fluff.org" <ben-linux@fluff.org>,
	"kgene.kim@samsung.com" <kgene.kim@samsung.com>,
	Lee Jones <lee.jones@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support
Date: Fri, 30 Mar 2012 18:45:07 +0000	[thread overview]
Message-ID: <201203301845.07534.arnd@arndb.de> (raw)
In-Reply-To: <4F75D5C0.5050307@wwwdotorg.org>

On Friday 30 March 2012, Stephen Warren wrote:
> That property looks very reasonable.
> 
> Question: This would be a non-backwards-compatible change to the binding
> definition. How should this be handled? In the past, I believe it's been
> stated that new kernels need to run against old device trees, and hence
> once a DT binding was defined and in use, it couldn't change except in a
> backwards-compatible way. However, more recently, Grant has said that
> his opinion is that (some or all?) bindings are currently considered
> experimental and subject to change. And besides, the .dts files are
> contained in the kernel tree at present... Some generally stated and
> agreed upon policy here might be useful.

I tried to leave the ones that look like they've been around for a while
backwards compatible (gpio, esdhc), while changing the relatively new
ones without backwards compatibility code.

> > +Optional properties:
> > +- cd-gpios : Specify GPIOs for card detection, see gpio binding
> > +- wp-gpios : Specify GPIOs for write protection, see gpio binding
> 
> > +- cd-inverted: when present, polarity on the wp gpio line is inverted
> > +- wp-inverted: when present, polarity on the wp gpio line is inverted
> 
> I'm not sure about those two: Some of the GPIO bindings have flags in
> the GPIO specifier (Tegra, ARM PL061, gpio.txt mentions the possibility
> of polarity being in the specifier), and bit 0 of the flags is used to
> indicate inversion. I think that either we should rely on GPIO
> specifiers having such flags and remove these xxx-inverted properties
> from the MMC binding, or remove that flag bit from the GPIO bindings.

Maybe the GPIO maintainer can comment on this. My understanding is
that not all gpio controllers support this in their bindings. If they
do, I agree that we can remove the extra properties here.

> Note that anything using of_gpio_simple_xlate() is going to end up using
> the GPIO flag definitions from <linux/of_gpio.h> in their GPIO
> specifier, and there a number of active users of this feature; grep for
> OF_GPIO_ACTIVE_LOW.
> 
> The rather begs the question why of_get_named_gpio() exists; surely
> of_get_named_gpio_flags() should always be used so that consumers know
> whether the GPIO value should be inverted, or are the GPIO flags
> supposed to be processed by the OF/GPIO core or GPIO driver somehow, and
> act transparently to GPIO consumers?
> 
> > diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> ...
> > -- interrupts : Should contain SD/MMC interrupt
> > +- interrupt  : Should contain SD/MMC interrupt
> 
> Isn't that usually pluralized, so interrupts?

Right, my mistake.

> > +- bus-width : Number of data lines, can be <1>, <4>, or <8>
> 
> For the device-specific binding documentation, rather than repeating the
> core bindings, shouldn't we say something like:
> 
> This binding is based on the core MMC bindings documented in mmc.txt.
> This file only documents additions or changes to those bindings.
> 
> ... and then remove any of the common properties from the individual files?

yes, good idea.

> > diff --git a/arch/arm/boot/dts/tegra-cardhu.dts b/arch/arm/boot/dts/tegra-cardhu.dts
> ...
> > @@ -66,5 +67,6 @@
> >  
> >       sdhci@78000400 {
> >               support-8bit;
> > +             bus-width = <8>;
> >       };
> >  };
> 
> Ah OK, so the first phase is to add all the new standardize properties,
> then later remove all the legacy properties once the drivers have been
> updated.
> 
> You've missed additions of "non-removable", but I can add them later. or
> provide you an incremental patch or something.
> 
> > diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> 
> This doesn't seem to decode cd-inverted, or do anything with the
> bus-width property value that it reads. Was that intentional?

For now, I was trying to get the binding document right. I suppose as a follow-up,
we can actually add a common helper function to decode these attributes and set
the right flag in the mmc device, but that is not urgent. Right now, I mainly
want to make sure we gain no new users that have conflicting bindings.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support
Date: Fri, 30 Mar 2012 18:45:07 +0000	[thread overview]
Message-ID: <201203301845.07534.arnd@arndb.de> (raw)
In-Reply-To: <4F75D5C0.5050307@wwwdotorg.org>

On Friday 30 March 2012, Stephen Warren wrote:
> That property looks very reasonable.
> 
> Question: This would be a non-backwards-compatible change to the binding
> definition. How should this be handled? In the past, I believe it's been
> stated that new kernels need to run against old device trees, and hence
> once a DT binding was defined and in use, it couldn't change except in a
> backwards-compatible way. However, more recently, Grant has said that
> his opinion is that (some or all?) bindings are currently considered
> experimental and subject to change. And besides, the .dts files are
> contained in the kernel tree at present... Some generally stated and
> agreed upon policy here might be useful.

I tried to leave the ones that look like they've been around for a while
backwards compatible (gpio, esdhc), while changing the relatively new
ones without backwards compatibility code.

> > +Optional properties:
> > +- cd-gpios : Specify GPIOs for card detection, see gpio binding
> > +- wp-gpios : Specify GPIOs for write protection, see gpio binding
> 
> > +- cd-inverted: when present, polarity on the wp gpio line is inverted
> > +- wp-inverted: when present, polarity on the wp gpio line is inverted
> 
> I'm not sure about those two: Some of the GPIO bindings have flags in
> the GPIO specifier (Tegra, ARM PL061, gpio.txt mentions the possibility
> of polarity being in the specifier), and bit 0 of the flags is used to
> indicate inversion. I think that either we should rely on GPIO
> specifiers having such flags and remove these xxx-inverted properties
> from the MMC binding, or remove that flag bit from the GPIO bindings.

Maybe the GPIO maintainer can comment on this. My understanding is
that not all gpio controllers support this in their bindings. If they
do, I agree that we can remove the extra properties here.

> Note that anything using of_gpio_simple_xlate() is going to end up using
> the GPIO flag definitions from <linux/of_gpio.h> in their GPIO
> specifier, and there a number of active users of this feature; grep for
> OF_GPIO_ACTIVE_LOW.
> 
> The rather begs the question why of_get_named_gpio() exists; surely
> of_get_named_gpio_flags() should always be used so that consumers know
> whether the GPIO value should be inverted, or are the GPIO flags
> supposed to be processed by the OF/GPIO core or GPIO driver somehow, and
> act transparently to GPIO consumers?
> 
> > diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> ...
> > -- interrupts : Should contain SD/MMC interrupt
> > +- interrupt  : Should contain SD/MMC interrupt
> 
> Isn't that usually pluralized, so interrupts?

Right, my mistake.

> > +- bus-width : Number of data lines, can be <1>, <4>, or <8>
> 
> For the device-specific binding documentation, rather than repeating the
> core bindings, shouldn't we say something like:
> 
> This binding is based on the core MMC bindings documented in mmc.txt.
> This file only documents additions or changes to those bindings.
> 
> ... and then remove any of the common properties from the individual files?

yes, good idea.

> > diff --git a/arch/arm/boot/dts/tegra-cardhu.dts b/arch/arm/boot/dts/tegra-cardhu.dts
> ...
> > @@ -66,5 +67,6 @@
> >  
> >       sdhci at 78000400 {
> >               support-8bit;
> > +             bus-width = <8>;
> >       };
> >  };
> 
> Ah OK, so the first phase is to add all the new standardize properties,
> then later remove all the legacy properties once the drivers have been
> updated.
> 
> You've missed additions of "non-removable", but I can add them later. or
> provide you an incremental patch or something.
> 
> > diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> 
> This doesn't seem to decode cd-inverted, or do anything with the
> bus-width property value that it reads. Was that intentional?

For now, I was trying to get the binding document right. I suppose as a follow-up,
we can actually add a common helper function to decode these attributes and set
the right flag in the mmc device, but that is not urgent. Right now, I mainly
want to make sure we gain no new users that have conflicting bindings.

	Arnd

  reply	other threads:[~2012-03-30 18:45 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 17:56 [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add device tree support Thomas Abraham
2012-01-31 17:56 ` Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 1/6] mmc: sdhci-s3c: Remove usage of clk_type member in platform data Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 2/6] arm: exynos4: use 'exynos4-sdhci' as device name for sdhci controllers Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 3/6] arm: samsung: remove all uses of clk_type member in sdhci platform data Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 4/6] mmc: sdhci-s3c: derive transfer width host capability from max_width in " Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 19:12   ` Sergei Shtylyov
2012-01-31 19:12     ` Sergei Shtylyov
2012-01-31 17:56 ` [PATCH v3 5/6] mmc: sdhci-s3c: Keep a copy of platform data and use it Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support Thomas Abraham
2012-01-31 17:56   ` Thomas Abraham
2012-01-31 20:08   ` Grant Likely
2012-01-31 20:08     ` Grant Likely
2012-02-01 18:21   ` Karol Lewandowski
2012-02-01 18:21     ` Karol Lewandowski
2012-03-27 16:15   ` Arnd Bergmann
2012-03-27 16:15     ` Arnd Bergmann
2012-03-27 16:19   ` Arnd Bergmann
2012-03-27 16:19     ` Arnd Bergmann
2012-03-30  6:33     ` Viresh Kumar
2012-03-30  6:33       ` Viresh Kumar
2012-03-30 11:36       ` Arnd Bergmann
2012-03-30 11:36         ` Arnd Bergmann
2012-03-30 15:48         ` Stephen Warren
2012-03-30 15:48           ` Stephen Warren
2012-03-30 18:45           ` Arnd Bergmann [this message]
2012-03-30 18:45             ` Arnd Bergmann
     [not found]             ` <201203301845.07534.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-01 11:29               ` Mark Brown
2012-04-01 11:29                 ` Mark Brown
2012-05-13  4:14           ` [PATCH v2] mmc: dt: Consolidate DT bindings Chris Ball
2012-05-13  4:14             ` Chris Ball
2012-05-13 19:29             ` Guennadi Liakhovetski
2012-05-13 19:29               ` Guennadi Liakhovetski
     [not found]             ` <871umou38f.fsf_-_-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
2012-05-13 19:46               ` Arnd Bergmann
2012-05-13 19:46                 ` Arnd Bergmann
2012-05-13 20:10                 ` Chris Ball
2012-05-13 20:10                   ` Chris Ball
2012-05-14 19:53                   ` Arnd Bergmann
2012-05-14 19:53                     ` Arnd Bergmann
2012-04-09 14:48         ` [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support Chris Ball
2012-04-09 14:48           ` Chris Ball
2012-04-10 21:37         ` Chris Ball
2012-04-10 21:37           ` Chris Ball
2012-02-09 13:42 ` [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add " Kukjin Kim
2012-02-09 13:42   ` Kukjin Kim
2012-02-11 21:37   ` Chris Ball
2012-02-11 21:37     ` Chris Ball
2012-02-16 13:04     ` Kukjin Kim
2012-02-16 13:04       ` Kukjin Kim
2012-02-16 13:08       ` Chris Ball
2012-02-16 13:08         ` Chris Ball
2012-02-21 11:37         ` Kukjin Kim
2012-02-21 11:37           ` Kukjin Kim
2012-02-21 13:17           ` Chris Ball
2012-02-21 13:17             ` Chris Ball
2012-02-22 12:58             ` Mark Brown
2012-02-22 12:58               ` Mark Brown
2012-03-02 20:40               ` Chris Ball
2012-03-02 20:40                 ` Chris Ball
2012-03-03  0:44                 ` Kukjin Kim
2012-03-03  0:44                   ` Kukjin Kim
2012-03-03  0:46                   ` [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Mark Brown
2012-03-03  0:46                     ` Mark Brown
2012-03-03  0:46                     ` [PATCH 2/2] mmc: sdhci-s3c: Enable runtime power management Mark Brown
2012-03-03  0:46                       ` Mark Brown
2012-03-05 10:48                       ` Jaehoon Chung
2012-03-05 10:48                         ` Jaehoon Chung
2012-03-05 11:52                         ` Mark Brown
2012-03-05 11:52                           ` Mark Brown
2012-03-06  6:40                           ` Jaehoon Chung
2012-03-06  6:40                             ` Jaehoon Chung
2012-03-09  4:57                       ` Chris Ball
2012-03-09  4:57                         ` Chris Ball
2012-03-09  5:08                       ` Chris Ball
2012-03-09  5:08                         ` Chris Ball
2012-03-09 12:26                         ` Mark Brown
2012-03-09 12:26                           ` Mark Brown
2012-03-05 10:24                     ` [PATCH 1/2] mmc: sdhci-s3c: Use CONFIG_PM_SLEEP to ifdef system suspend Jaehoon Chung
2012-03-05 10:24                       ` Jaehoon Chung
2012-03-09  4:56                     ` Chris Ball
2012-03-09  4:56                       ` Chris Ball
2012-03-27 15:50             ` [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add device tree support Chris Ball
2012-03-27 15:50               ` Chris Ball
2012-03-28  9:54               ` Mark Brown
2012-03-28  9:54                 ` Mark Brown
2012-03-29  3:15                 ` Kukjin Kim
2012-03-29  3:15                   ` Kukjin Kim
2012-04-01  1:12                   ` Chris Ball
2012-04-01  1:12                     ` Chris Ball
2012-04-02 19:08                     ` Kukjin Kim
2012-04-02 19:08                       ` Kukjin Kim

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=201203301845.07534.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=anton.vorontsov@linaro.org \
    --cc=ben-linux@fluff.org \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kgene.kim@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=swarren@wwwdotorg.org \
    --cc=viresh.kumar@st.com \
    /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.