diff mbox

pinctrl: single: Fix missing flush of posted write for a wakeirq

Message ID 1464729426-11187-1-git-send-email-tony@atomide.com
State New
Headers show

Commit Message

Tony Lindgren May 31, 2016, 9:17 p.m. UTC
With many repeated suspend resume cycles, the pin specific wakeirq
may not always work on omaps. This is because the write to enable the
pin interrupt may not have reached the device over the interconnect
before suspend happens.

Let's fix the issue with a flush of posted write with a readback.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/pinctrl/pinctrl-single.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Linus Walleij June 2, 2016, 12:27 p.m. UTC | #1
On Tue, May 31, 2016 at 11:17 PM, Tony Lindgren <tony@atomide.com> wrote:

> With many repeated suspend resume cycles, the pin specific wakeirq
> may not always work on omaps. This is because the write to enable the
> pin interrupt may not have reached the device over the interconnect
> before suspend happens.
>
> Let's fix the issue with a flush of posted write with a readback.
>
> Reported-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Patch applied.

Is it a regression that needs to be sent to fixes and tagged
for stable?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren June 2, 2016, 3:19 p.m. UTC | #2
* Linus Walleij <linus.walleij@linaro.org> [160602 05:29]:
> On Tue, May 31, 2016 at 11:17 PM, Tony Lindgren <tony@atomide.com> wrote:
> 
> > With many repeated suspend resume cycles, the pin specific wakeirq
> > may not always work on omaps. This is because the write to enable the
> > pin interrupt may not have reached the device over the interconnect
> > before suspend happens.
> >
> > Let's fix the issue with a flush of posted write with a readback.
> >
> > Reported-by: Nishanth Menon <nm@ti.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Patch applied.

Thanks.

> Is it a regression that needs to be sent to fixes and tagged
> for stable?

It fixes wake from suspend in repeated cases, so at least
Android users would appreciate it in the stable trees.

Although the Android users are using vendor tree, it's still
one fix less to carry them.

So yeah, I'd vote yes for stable tag on this one.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij June 8, 2016, 8:05 a.m. UTC | #3
On Thu, Jun 2, 2016 at 5:19 PM, Tony Lindgren <tony@atomide.com> wrote:

> So yeah, I'd vote yes for stable tag on this one.

I trust you :)

Put in my fixes branch and tagged for stable.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index cf9bafa..bfdf720 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1580,6 +1580,9 @@  static inline void pcs_irq_set(struct pcs_soc_data *pcs_soc,
 		else
 			mask &= ~soc_mask;
 		pcs->write(mask, pcswi->reg);
+
+		/* flush posted write */
+		mask = pcs->read(pcswi->reg);
 		raw_spin_unlock(&pcs->lock);
 	}