public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Richard Genoud <richard.genoud@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Stephen Warren <swarren@nvidia.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] pinctrl: re-enable old state in case of error in pinctrl_select_state
Date: Wed, 27 Mar 2013 17:55:45 -0600	[thread overview]
Message-ID: <51538701.60409@wwwdotorg.org> (raw)
In-Reply-To: <1364222843-30305-5-git-send-email-richard.genoud@gmail.com>

On 03/25/2013 08:47 AM, Richard Genoud wrote:
> If a new state is applied, the groups configured in the old state but
> not in the new state are disabled.
> If something goes wrong and the new state can't be applied, we have to
> re-enable those groups.

What is the use-case for this? I wonder if it isn't better to simply
undo the partial selection of the new state (as patch 3/4 attempts to
do) and then leave p->state==NULL, indicating that no state is actively
selected. IIRC, this would be the same as right after the initial
pinctrl_select().

I wonder if it's likely that attempting to re-apply the old state would
actually work, given that applying something just failed.

Finally, this recovery code doesn't:

a) Process anything except MUX_GROUP; any pin config settings in the old
state aren't restored.

b) (I think) Apply any mux settings that don't involve groups that are
referenced by both the old and new states; given that patch 3/4 attempts
to undo everything in the failed application of the new state, I think
this "re-apply the old state" code should simple run through everything
in the old state any apply it unconditionally.

c) Set p->state = oldstate, so it's left at NULL, which would confuse
any future pinctrl_select().

  parent reply	other threads:[~2013-03-27 23:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 14:47 [PATCH 0/4] pintrcl: restore old state when pinctrl_select_state fails Richard Genoud
2013-03-25 14:47 ` [PATCH 1/4] pinctrl: fix typo in header Richard Genoud
2013-03-27 22:13   ` Linus Walleij
2013-03-25 14:47 ` [PATCH 2/4] pinctrl: create pinctrl_free_setting function Richard Genoud
2013-03-27 22:15   ` Linus Walleij
2013-03-25 14:47 ` [PATCH 3/4] pinctrl: disable and free setting in select_state in case of error Richard Genoud
2013-03-27 22:17   ` Linus Walleij
2013-03-27 23:49   ` Stephen Warren
2013-03-28 10:55     ` Richard Genoud
2013-03-28 14:53       ` Stephen Warren
2013-03-28 15:47         ` Richard Genoud
2013-04-03 12:30           ` Linus Walleij
2013-04-03 12:36             ` Richard Genoud
2013-03-25 14:47 ` [PATCH 4/4] pinctrl: re-enable old state in case of error in pinctrl_select_state Richard Genoud
2013-03-27 22:18   ` Linus Walleij
2013-03-27 23:55   ` Stephen Warren [this message]
2013-03-28 11:35     ` Richard Genoud
2013-03-28 17:34     ` Richard GENOUD
2013-03-28 17:38       ` Stephen Warren
2013-03-28 18:06         ` Richard GENOUD

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=51538701.60409@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.genoud@gmail.com \
    --cc=swarren@nvidia.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