From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: phandle entries will be applied sequentially
Date: Wed, 09 Oct 2013 09:58:03 -0600 [thread overview]
Message-ID: <52557D0B.5040901@wwwdotorg.org> (raw)
In-Reply-To: <20131009124425.GG25034@n2100.arm.linux.org.uk>
On 10/09/2013 06:44 AM, Russell King - ARM Linux wrote:
> On Wed, Oct 09, 2013 at 02:40:49PM +0200, Linus Walleij wrote:
>> NAK this this a Linux kernel implementation detail. Sherman Yin
>> fixed this up so the drivers does not have to imply any sequence
>> semantic for this.
>>
>> Study commit 03b054e9696c3cbd3d5905ec96da15acd0a2fe8d
>> "pinctrl: Pass all configs to driver on pin_config_set()"
>>
>> It is perfectly legal for a driver to accumulate the settings into
>> e.g. a single register write if it can, e.g.:
>>
>> u32 val = 0;
>>
>> for (i = 0; i < num_configs; i++) {
>> switch() {
>> FOO:
>> val |= 1;
>> break;
>> BAR:
>> val |= 2:
>> break;
>> BAZ:
>> val |=4;
>> break;
>> };
>>
>> writel(val, base+pinreg);
>>
>> I.e. the driver may choose to apply configs sequentially, but that is
>> not at all necessary.
>
> So, just to be clear, what you're saying is that specifying two settings
> in a pinctrl declaration which provide different values results in
> undefined behaviour?
That makes sense to me, yes. It should be simple to separate out the
common/shared parts of a configuration, vs. other unique parts, and put
them into separate "pin configuration nodes", and hence avoid the
situation completely.
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Linus Walleij <linus.walleij@linaro.org>
Cc: Sherman Yin <syin@broadcom.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Shawn Guo <shawn.guo@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] pinctrl: phandle entries will be applied sequentially
Date: Wed, 09 Oct 2013 09:58:03 -0600 [thread overview]
Message-ID: <52557D0B.5040901@wwwdotorg.org> (raw)
In-Reply-To: <20131009124425.GG25034@n2100.arm.linux.org.uk>
On 10/09/2013 06:44 AM, Russell King - ARM Linux wrote:
> On Wed, Oct 09, 2013 at 02:40:49PM +0200, Linus Walleij wrote:
>> NAK this this a Linux kernel implementation detail. Sherman Yin
>> fixed this up so the drivers does not have to imply any sequence
>> semantic for this.
>>
>> Study commit 03b054e9696c3cbd3d5905ec96da15acd0a2fe8d
>> "pinctrl: Pass all configs to driver on pin_config_set()"
>>
>> It is perfectly legal for a driver to accumulate the settings into
>> e.g. a single register write if it can, e.g.:
>>
>> u32 val = 0;
>>
>> for (i = 0; i < num_configs; i++) {
>> switch() {
>> FOO:
>> val |= 1;
>> break;
>> BAR:
>> val |= 2:
>> break;
>> BAZ:
>> val |=4;
>> break;
>> };
>>
>> writel(val, base+pinreg);
>>
>> I.e. the driver may choose to apply configs sequentially, but that is
>> not at all necessary.
>
> So, just to be clear, what you're saying is that specifying two settings
> in a pinctrl declaration which provide different values results in
> undefined behaviour?
That makes sense to me, yes. It should be simple to separate out the
common/shared parts of a configuration, vs. other unique parts, and put
them into separate "pin configuration nodes", and hence avoid the
situation completely.
next prev parent reply other threads:[~2013-10-09 15:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 5:42 [PATCH] pinctrl: phandle entries will be applied sequentially Shawn Guo
2013-10-09 5:42 ` Shawn Guo
2013-10-09 12:40 ` Linus Walleij
2013-10-09 12:40 ` Linus Walleij
2013-10-09 12:44 ` Russell King - ARM Linux
2013-10-09 12:44 ` Russell King - ARM Linux
2013-10-09 13:09 ` Linus Walleij
2013-10-09 13:09 ` Linus Walleij
2013-10-09 13:45 ` Russell King - ARM Linux
2013-10-09 13:45 ` Russell King - ARM Linux
2013-10-09 14:14 ` Linus Walleij
2013-10-09 14:14 ` Linus Walleij
2013-10-10 8:08 ` Shawn Guo
2013-10-10 8:08 ` Shawn Guo
2013-10-09 15:58 ` Stephen Warren [this message]
2013-10-09 15:58 ` Stephen Warren
2013-10-10 7:26 ` Shawn Guo
2013-10-10 7:26 ` Shawn Guo
2013-10-10 8:03 ` Linus Walleij
2013-10-10 8:03 ` Linus Walleij
2013-10-10 10:12 ` Shawn Guo
2013-10-10 10:12 ` Shawn Guo
2013-10-10 10:08 ` Russell King - ARM Linux
2013-10-10 10:08 ` Russell King - ARM Linux
2013-10-10 10:22 ` Shawn Guo
2013-10-10 10:22 ` Shawn Guo
2013-10-10 10:23 ` Russell King - ARM Linux
2013-10-10 10:23 ` Russell King - ARM Linux
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=52557D0B.5040901@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linux-arm-kernel@lists.infradead.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.