From: Stephen Warren <swarren@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
"B29396@freescale.com" <B29396@freescale.com>,
"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
"dongas86@gmail.com" <dongas86@gmail.com>,
"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
"thomas.abraham@linaro.org" <thomas.abraham@linaro.org>,
"tony@atomide.com" <tony@atomide.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/3] pinctrl: Introduce PINCTRL_STATE_DEFAULT define, and use it
Date: Fri, 24 Feb 2012 09:09:32 -0800 [thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF17BD8BCC87@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <CACRpkdZWu_nYkWLxXBUv-VAQTMByDM37qACRf3im7R4GQgZc5A@mail.gmail.com>
Linus Walleij wrote at Thursday, February 23, 2012 11:09 PM:
> On Fri, Feb 24, 2012 at 1:04 AM, Stephen Warren <swarren@nvidia.com> wrote:
>
> > This provides a single centralized name for the default state.
> >
> > Update PIN_MAP_* macros to use this state name, instead of requiring the
> > user to pass a state name in.
> >
> > Update documentation and mapping tables to use this.
> >
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
>
> I like the direction this is taking for sure. This is however not
> working because it break U300, no hogs nor device requests work
> after this patch so I cannot apply it.
Ah, I think I see what's happening.
Right now, pinctrl_hog_maps() iterates over every map entry, and when
it finds a hog entry, it tries to get() and enable() that one entry.
get() again iterates over the mapping table finding every entry with
the same name. This all works fine if every hog entry in the mapping
table for a given pin controller has a different name. However, this
patch changes the name field to PINCTRL_STATE_DEFAULT in all cases,
so the first get() finds 3 matching table entries and enables them all,
then the outer loop in pinctrl_hog_maps() finds the second table entry
and calls get() again which again finds all 3 entries and tries to
enable them all.
I think the fix for this is to replace the body of pinctrl_hog_maps()
with:
static int pinctrl_hog_maps(struct pinctrl_dev *pctldev)
{
int ret;
INIT_LIST_HEAD(&pctldev->pinctrl_hogs);
mutex_lock(&pinctrl_maps_mutex);
ret = pinctrl_hog_map(pctldev, PINCTRL_STATE_DEFAULT);
mutex_unlock(&pinctrl_maps_mutex);
return ret;
}
Does that work better? If so, I can fold it into the patch and repost,
or you can fix it up as you apply; whichever you wish.
--
nvpublic
next prev parent reply other threads:[~2012-02-24 17:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 0:04 Stephen Warren
2012-02-24 0:04 ` [PATCH 2/3] pinctrl: Re-order struct pinctrl_map Stephen Warren
2012-02-24 3:31 ` Dong Aisheng
2012-02-24 6:14 ` Linus Walleij
2012-02-24 0:04 ` [PATCH 3/3] pinctrl: Move pinctrl-maps debugfs file to top-level Stephen Warren
2012-02-24 3:47 ` Dong Aisheng
2012-02-24 6:18 ` Linus Walleij
2012-02-24 3:24 ` [PATCH 1/3] pinctrl: Introduce PINCTRL_STATE_DEFAULT define, and use it Dong Aisheng
2012-02-24 5:26 ` Stephen Warren
2012-02-24 7:09 ` Dong Aisheng
2012-02-24 17:32 ` Stephen Warren
2012-02-25 4:16 ` Dong Aisheng
2012-02-24 6:09 ` Linus Walleij
2012-02-24 17:09 ` Stephen Warren [this message]
2012-02-24 19:20 ` Stephen Warren
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=74CDBE0F657A3D45AFBB94109FB122FF17BD8BCC87@HQMAIL01.nvidia.com \
--to=swarren@nvidia.com \
--cc=B29396@freescale.com \
--cc=dongas86@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.org \
--cc=thomas.abraham@linaro.org \
--cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®