linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: pinctrl: add active state to core
Date: Fri, 14 Jun 2013 01:46:44 -0700	[thread overview]
Message-ID: <20130614084644.GD20992@atomide.com> (raw)
In-Reply-To: <51BA1E06.6020705@wwwdotorg.org>

* Stephen Warren <swarren@wwwdotorg.org> [130613 12:37]:
> On 06/12/2013 12:33 PM, Tony Lindgren wrote:
> > * Linus Walleij <linus.walleij@linaro.org> [130611 12:59]:
> >> On Tue, Jun 11, 2013 at 6:33 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> >>> On 06/11/2013 02:16 AM, Linus Walleij wrote:
> >>>> From: Linus Walleij <linus.walleij@linaro.org>
> >>>>
> >>>> In addition to the recently introduced pinctrl core
> >>>> control, the PM runtime pin control for the OMAP platforms
> >>>> require a fourth state in addtition to the default, idle and
> >>>> sleep states already handled by the core: an explicit "active"
> >>>> state. Let's introduce this to the core in addition to the
> >>>> other states already defined.
> >>>
> >>> Surely "default" /is/ "active"? That's what it's meant so far.
> >>
> >> I thought so too, until Tony informed us that in the OMAP world
> >> this state is not always the active one.
> >>
> >> But I don't know the exact reasons for.
> >>
> >> I guess that some "default" states on the OMAP may mean these
> >> are configured as decoupled, inactive, until explicitly activated
> >> or something like that.
> > 
> > The main reason is that remuxing all the pins for a device for
> > PM runtime suspend and resume is not necessary. Most pins are
> > static and configured once during the consumer driver probe.
> > And in most cases, remuxing only one pin for the rx line is
> > needed. This is performance critical as it may need to be done
> > constantly while entering and exiting idle, and remuxing all the
> > pins is just a waste of cycles.
> 
> Then isn't the correct solution to optimize the code that switches
> between states, so that it only reprograms the pins/groups necessary?
> Inventing extra states just to work around that issue seems quite wrong.

Hmm how would the pinctrl subsystem know which pins to reprogram and
which ones are static?
 
> So, I think you're relying on:
> 
> default: Set up everything static.
> active: flip just a few pins to active state.
> idle: flip just a few pins to idle state.
> 
> ... and assuming that the default->active or default->idle transitions
> will not affect any pins that are used in default, but not used in
> active/idle.

Yes except the default pins are not touched after probe at all.
 
> However, that very specifically isn't the case; pinctrl drivers are
> allowed to force unused pins back to some default unused state when the
> pinctrl state that's being switched to doesn't mention them, and hence
> this concept won't work in general.

We don't have any default state for pins for omaps at least and pinctrl
single does not not set them to anything when disable is called unless
function-off is specified.

But even if the pinctrl driver does something to the pins in disable,
that should work too. It's just an extra step between toggling between
two named pin states.

> Also, if default uses more pins that active, when you switch to active,
> those pins won't be marked as owned any more, I think, so something else
> could in theory grab them. At least, debugfs wouldn't be entirely
> accurate any more.

I think you're misunderstanding. The default pins are held for as long
as the device is loaded. We're not touching the default pins at all
after probe. Active and idle pins are not subsets of default.

Regards,

Tony

  reply	other threads:[~2013-06-14  8:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11  8:16 [PATCH] drivers: pinctrl: add active state to core Linus Walleij
2013-06-11 16:03 ` Greg Kroah-Hartman
2013-06-12 18:35   ` Tony Lindgren
2013-06-11 16:33 ` Stephen Warren
2013-06-11 19:53   ` Linus Walleij
2013-06-12 18:33     ` Tony Lindgren
2013-06-13 19:31       ` Stephen Warren
2013-06-14  8:46         ` Tony Lindgren [this message]
2013-06-14 15:23           ` Stephen Warren
2013-06-17  7:29             ` Tony Lindgren
2013-06-13 19:38     ` Stephen Warren
2013-06-16 10:01 ` Linus Walleij

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=20130614084644.GD20992@atomide.com \
    --to=tony@atomide.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).