From: Tony Lindgren <tony@atomide.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: linus.walleij@linaro.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/4] pinctrl: Add support for additional dynamic states
Date: Mon, 29 Jul 2013 02:21:16 -0700 [thread overview]
Message-ID: <20130729092116.GA7656@atomide.com> (raw)
In-Reply-To: <51E98C71.5010709@wwwdotorg.org>
* Stephen Warren <swarren@wwwdotorg.org> [130719 12:05]:
> On 07/19/2013 01:39 AM, Tony Lindgren wrote:
> >
> > I think the only sane way to deal with this is to make the I2C controller
> > to show up as two separate I2C controller instances. Then use runtime
> > PM to save and restore the state for each instance, and locking between
> > the two driver instances.
> >
> > For the pin muxing part, I'd do this:
> >
> > i2c1 instance i2c2 instance notes
> > default_state 0 pins 0 pins (or dedicated pins only)
> > active_state all pins alls pins
> > idle_state safe mode safe mode
> >
> > Then when i2c1 instance is done, it's runtime PM suspend muxes the pins
> > to safe mode, or some nop state. Then when i2c2 instance is woken, it's
> > runtime PM resume muxes pins to i2c2.
>
> I see two issues with that approach:
>
> 1) Runtime PM doesn't always put a device into an idle state as soon as
> its work is done. Sometimes (always?) there is a delay between when the
> device is last used and when the HW is actually made idle so that if the
> device is re-activated quickly, the kernel hasn't wasted time making it
> idle then active again. You'd have to force that delay to complete when
> switching between the two virtual controller devices.
There is the autosuspend timeout for delayed transitions, but I think
runtime PM already has calls for making the state change immediate also.
> 2) This requires two separate device objects for the two I2C instances.
> I guess you could have the driver for the one I2C mux node end up
> instantiating two child devices for this purpose, and hence make that
> happen without needing to change the DT ABI. However, that sure feels
> complex...
Yes but you will also automatically get quite a bit of sanity to your
I2C driver code rather than trying to handle the two separate instances
within the driver alone. Consider things like scanning the I2C buses for
devices and just dev_dbg().
> I wonder if it wouldn't be better to have active/idle/sleep as
> "modifiers" to the state name rather than alternatives, so you end up
> with states named:
>
> default
> nobus:active
> nobus:idle
> nobus:sleep
> bus0:active
> bus0:idle
> bus0:sleep
> bus1:active
> bus1:idle
> bus1:sleep
>
> Of course, if you continue on with that approach (i.e. you add more
> sub-fields each separated by a colon), you end up with a huge
> combinatorial mess of state names.
Right :) Sooner or later we'll have some totally messed up piece of
hardware pop up that multiplexes one controller across a large number
number buses..
Regards,
Tony
next prev parent reply other threads:[~2013-07-29 9:21 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 9:05 [PATCH 0/4] improved support for runtime muxing for pinctrl Tony Lindgren
2013-07-16 9:05 ` [PATCH 1/4] pinctrl: Remove duplicate code in pinctrl_pm_select_state functions Tony Lindgren
2013-07-16 13:15 ` Grygorii Strashko
2013-07-16 13:41 ` Tony Lindgren
2013-07-16 14:25 ` Grygorii Strashko
2013-07-17 6:31 ` Tony Lindgren
2013-07-16 9:05 ` [PATCH 2/4] pinctrl: Allow pinctrl to have multiple active states Tony Lindgren
2013-07-17 20:55 ` Stephen Warren
2013-07-16 9:05 ` [PATCH 3/4] pinctrl: Add support for additional dynamic states Tony Lindgren
2013-07-16 9:35 ` Felipe Balbi
2013-07-16 12:06 ` Tony Lindgren
2013-07-17 21:14 ` Stephen Warren
2013-07-18 7:25 ` Tony Lindgren
2013-07-18 10:53 ` Tony Lindgren
2013-07-18 19:21 ` Stephen Warren
2013-07-19 7:29 ` Tony Lindgren
2013-07-19 18:52 ` Stephen Warren
2013-07-29 9:05 ` Tony Lindgren
2013-07-29 22:01 ` Stephen Warren
2013-08-14 16:41 ` Linus Walleij
2013-07-17 21:23 ` Stephen Warren
2013-07-18 7:36 ` Tony Lindgren
2013-07-18 19:26 ` Stephen Warren
2013-07-19 7:39 ` Tony Lindgren
2013-07-19 10:29 ` Grygorii Strashko
2013-07-19 19:03 ` Stephen Warren
2013-07-22 23:15 ` Linus Walleij
2013-07-29 9:08 ` Tony Lindgren
2013-07-19 18:58 ` Stephen Warren
2013-07-29 9:21 ` Tony Lindgren [this message]
2013-07-29 22:08 ` Stephen Warren
2013-07-22 23:07 ` Linus Walleij
2013-07-29 9:31 ` Tony Lindgren
2013-07-16 9:05 ` [PATCH 4/4] drivers: Add pinctrl handling for dynamic pin states Tony Lindgren
2013-07-17 21:21 ` Stephen Warren
2013-07-18 7:50 ` Tony Lindgren
2013-07-18 13:48 ` Tony Lindgren
2013-07-16 9:14 ` [PATCH 0/4] improved support for runtime muxing for pinctrl Tony Lindgren
2013-07-17 11:49 ` Grygorii Strashko
-- strict thread matches above, loose matches on Subject: below --
2013-07-18 15:15 [PATCHv2 " Tony Lindgren
2013-07-18 15:15 ` [PATCH 3/4] pinctrl: Add support for additional dynamic states Tony Lindgren
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=20130729092116.GA7656@atomide.com \
--to=tony@atomide.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=swarren@wwwdotorg.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).