From: Florian Fainelli <f.fainelli@gmail.com>
To: linus.walleij@linaro.org
Cc: andy.shevchenko@gmail.com, swarren@nvidia.com,
alcooperx@gmail.com, Florian Fainelli <f.fainelli@gmail.com>,
"open list:PIN CONTROL SUBSYSTEM" <linux-gpio@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH fixes v4] pinctrl: Do not check previous and current state
Date: Tue, 7 Mar 2017 10:52:36 -0800 [thread overview]
Message-ID: <20170307185236.31805-1-f.fainelli@gmail.com> (raw)
In case a platform only defaults a "default" set of pins, but not a
"sleep" set of pins, and this particular platform suspends and resumes
in a way that the pin states are not preserved by the hardware, when we
resume, we would call pinctrl_single_resume() -> pinctrl_force_default()
-> pinctrl_select_state() and the first thing we do is check that the
pins state is the same as before, and do nothing.
In order to fix this, just remove the p->state == state check from
pinctrl_select_state() since it would not allow callers of this function
to get the pins to be brought into the expected state.
Fixes: 6e5e959dde0d ("pinctrl: API changes to support multiple states per device")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v4:
- just remove the p->state == state check because it cannot allow pinctrl_select_state
to work for callers that expect it to do the actual state change
Changes in v3:
- move the state check to pinctrl_select_state
Changes in v2:
- rename __pinctrl_select_state to pinctrl_commit_state
drivers/pinctrl/core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index d69046537b75..33cef0a65c9c 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1203,9 +1203,6 @@ int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state)
struct pinctrl_state *old_state = p->state;
int ret;
- if (p->state == state)
- return 0;
-
if (p->state) {
/*
* For each pinmux setting in the old state, forget SW's record
--
2.9.3
next reply other threads:[~2017-03-07 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 18:52 Florian Fainelli [this message]
2017-03-13 18:59 ` [PATCH fixes v4] pinctrl: Do not check previous and current state Florian Fainelli
2017-03-13 19:06 ` Andy Shevchenko
2017-03-15 10:29 ` Linus Walleij
2017-03-15 10:28 ` 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=20170307185236.31805-1-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=alcooperx@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).