All of lore.kernel.org
 help / color / mirror / Atom feed
From: "DebBarma, Tarun Kanti" <tarun.kanti@ti.com>
To: Franky Lin <frankyl@broadcom.com>
Cc: khilman@ti.com, tony@atomide.com, santosh.shilimkar@ti.com,
	b-cousson@ti.com, grant.likely@secretlab.ca,
	linux-omap@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Panda ES board hang when using GPIO as interrupt
Date: Tue, 26 Jun 2012 12:51:25 +0530	[thread overview]
Message-ID: <CAC83ZvL2ozQD1DYmtKeFa1PB1pZ1JmBUKFWmDWnbJOCDL3sKNg@mail.gmail.com> (raw)
In-Reply-To: <4FE8CF77.5080400@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 2912 bytes --]

On Tue, Jun 26, 2012 at 2:22 AM, Franky Lin <frankyl@broadcom.com> wrote:
> Hi Kevin, Tarun,
>
> We are using the expansion connector A on Panda board to mount a SDIO WiFi
> dongle on MMC2 with a level triggered interrupt signal connected to GPIO
> 138. It's been working fine until 3.5 rc1. The board hang randomly within 5
> mins during a network traffic test. After bisecting we found the culprit is
> "[PATCH 8/8] gpio/omap: fix missing check in *_runtime_suspend()" [1].
>
> I noticed Kevin raised some similar cases on other platforms and also
> provided two patches in the patch mail thread. But unfortunately those two
> patches doesn't help in our case. I tested the driver with 3.5-rc3 mainline
> kernel and the issue is still there. I can only "fix" the hang by either
> reverting the commit or disabling CONFIG_PM_RUNTIME. Also, the hang only
> happens on Panda ES board. Old Panda with 4430 works good.
>
> Any thoughts and suggestions?
I just had a quick look at the code. Can you please check if the
attached patch solves
the issue? I just boot tested on Panda and Blaze.
--
Tarun

>From 0e1b322451b7a49487d2d17a147db1aa1d1119fa Mon Sep 17 00:00:00 2001
From: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Date: Tue, 26 Jun 2012 12:13:47 +0530
Subject: [PATCH] gpio/omap: enabled_non_wakeup_gpios check skips
bank->saved_datain

Commit b3c64bc30af67ed328a8d919e41160942b870451
(gpio/omap: (re)fix wakeups on level-triggered GPIOs)
still skips update of bank->saved_datain in *_runtime_suspend()
which must be done irrespective of edge/level trigger types.
Therefore, move the enbaled_non_wakeup_gpios check after the
bank->saved_datain is updated.

Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
---
 drivers/gpio/gpio-omap.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..94ecdcf 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1177,9 +1177,6 @@ static int omap_gpio_runtime_suspend(struct device *dev)
                __raw_writel(wake_hi | bank->context.risingdetect,
                             bank->base + bank->regs->risingdetect);

-       if (!bank->enabled_non_wakeup_gpios)
-               goto update_gpio_context_count;
-
        if (bank->power_mode != OFF_MODE) {
                bank->power_mode = 0;
                goto update_gpio_context_count;
@@ -1191,6 +1188,10 @@ static int omap_gpio_runtime_suspend(struct device *dev)
         */
        bank->saved_datain = __raw_readl(bank->base +
                                                bank->regs->datain);
+
+       if (!bank->enabled_non_wakeup_gpios)
+               goto update_gpio_context_count;
+
        l1 = bank->context.fallingdetect;
        l2 = bank->context.risingdetect;

-- 
1.7.0.4



>
> Thanks,
> Franky
>
> [1] http://article.gmane.org/gmane.linux.ports.arm.omap/75708/
>

[-- Attachment #2: 0001-gpio-omap-enabled_non_wakeup_gpios-check-skips-bank-.patch --]
[-- Type: text/x-patch, Size: 1556 bytes --]

From 0e1b322451b7a49487d2d17a147db1aa1d1119fa Mon Sep 17 00:00:00 2001
From: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Date: Tue, 26 Jun 2012 12:13:47 +0530
Subject: [PATCH] gpio/omap: enabled_non_wakeup_gpios check skips bank->saved_datain

Commit b3c64bc30af67ed328a8d919e41160942b870451
(gpio/omap: (re)fix wakeups on level-triggered GPIOs)
still skips update of bank->saved_datain in *_runtime_suspend()
which must be done irrespective of edge/level trigger types.
Therefore, move the enbaled_non_wakeup_gpios check after the
bank->saved_datain is updated.

Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
---
 drivers/gpio/gpio-omap.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..94ecdcf 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1177,9 +1177,6 @@ static int omap_gpio_runtime_suspend(struct device *dev)
 		__raw_writel(wake_hi | bank->context.risingdetect,
 			     bank->base + bank->regs->risingdetect);
 
-	if (!bank->enabled_non_wakeup_gpios)
-		goto update_gpio_context_count;
-
 	if (bank->power_mode != OFF_MODE) {
 		bank->power_mode = 0;
 		goto update_gpio_context_count;
@@ -1191,6 +1188,10 @@ static int omap_gpio_runtime_suspend(struct device *dev)
 	 */
 	bank->saved_datain = __raw_readl(bank->base +
 						bank->regs->datain);
+
+	if (!bank->enabled_non_wakeup_gpios)
+		goto update_gpio_context_count;
+
 	l1 = bank->context.fallingdetect;
 	l2 = bank->context.risingdetect;
 
-- 
1.7.0.4


WARNING: multiple messages have this Message-ID (diff)
From: tarun.kanti@ti.com (DebBarma, Tarun Kanti)
To: linux-arm-kernel@lists.infradead.org
Subject: Panda ES board hang when using GPIO as interrupt
Date: Tue, 26 Jun 2012 12:51:25 +0530	[thread overview]
Message-ID: <CAC83ZvL2ozQD1DYmtKeFa1PB1pZ1JmBUKFWmDWnbJOCDL3sKNg@mail.gmail.com> (raw)
In-Reply-To: <4FE8CF77.5080400@broadcom.com>

On Tue, Jun 26, 2012 at 2:22 AM, Franky Lin <frankyl@broadcom.com> wrote:
> Hi Kevin, Tarun,
>
> We are using the expansion connector A on Panda board to mount a SDIO WiFi
> dongle on MMC2 with a level triggered interrupt signal connected to GPIO
> 138. It's been working fine until 3.5 rc1. The board hang randomly within 5
> mins during a network traffic test. After bisecting we found the culprit is
> "[PATCH 8/8] gpio/omap: fix missing check in *_runtime_suspend()" [1].
>
> I noticed Kevin raised some similar cases on other platforms and also
> provided two patches in the patch mail thread. But unfortunately those two
> patches doesn't help in our case. I tested the driver with 3.5-rc3 mainline
> kernel and the issue is still there. I can only "fix" the hang by either
> reverting the commit or disabling CONFIG_PM_RUNTIME. Also, the hang only
> happens on Panda ES board. Old Panda with 4430 works good.
>
> Any thoughts and suggestions?
I just had a quick look at the code. Can you please check if the
attached patch solves
the issue? I just boot tested on Panda and Blaze.
--
Tarun

>From 0e1b322451b7a49487d2d17a147db1aa1d1119fa Mon Sep 17 00:00:00 2001
From: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Date: Tue, 26 Jun 2012 12:13:47 +0530
Subject: [PATCH] gpio/omap: enabled_non_wakeup_gpios check skips
bank->saved_datain

Commit b3c64bc30af67ed328a8d919e41160942b870451
(gpio/omap: (re)fix wakeups on level-triggered GPIOs)
still skips update of bank->saved_datain in *_runtime_suspend()
which must be done irrespective of edge/level trigger types.
Therefore, move the enbaled_non_wakeup_gpios check after the
bank->saved_datain is updated.

Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
---
 drivers/gpio/gpio-omap.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..94ecdcf 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1177,9 +1177,6 @@ static int omap_gpio_runtime_suspend(struct device *dev)
                __raw_writel(wake_hi | bank->context.risingdetect,
                             bank->base + bank->regs->risingdetect);

-       if (!bank->enabled_non_wakeup_gpios)
-               goto update_gpio_context_count;
-
        if (bank->power_mode != OFF_MODE) {
                bank->power_mode = 0;
                goto update_gpio_context_count;
@@ -1191,6 +1188,10 @@ static int omap_gpio_runtime_suspend(struct device *dev)
         */
        bank->saved_datain = __raw_readl(bank->base +
                                                bank->regs->datain);
+
+       if (!bank->enabled_non_wakeup_gpios)
+               goto update_gpio_context_count;
+
        l1 = bank->context.fallingdetect;
        l2 = bank->context.risingdetect;

-- 
1.7.0.4



>
> Thanks,
> Franky
>
> [1] http://article.gmane.org/gmane.linux.ports.arm.omap/75708/
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gpio-omap-enabled_non_wakeup_gpios-check-skips-bank-.patch
Type: text/x-patch
Size: 1556 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120626/eb8a718c/attachment.bin>

  reply	other threads:[~2012-06-26  7:21 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 20:52 Panda ES board hang when using GPIO as interrupt Franky Lin
2012-06-25 20:52 ` Franky Lin
2012-06-25 20:52 ` Franky Lin
2012-06-26  7:21 ` DebBarma, Tarun Kanti [this message]
2012-06-26  7:21   ` DebBarma, Tarun Kanti
2012-06-26 18:20   ` Franky Lin
2012-06-26 18:20     ` Franky Lin
2012-06-26 18:20     ` Franky Lin
2012-06-27 13:29     ` DebBarma, Tarun Kanti
2012-06-27 13:29       ` DebBarma, Tarun Kanti
2012-06-27  3:37 ` Kevin Hilman
2012-06-27  3:37   ` Kevin Hilman
2012-06-27  3:37   ` Kevin Hilman
2012-06-28  0:41   ` Franky Lin
2012-06-28  0:41     ` Franky Lin
2012-06-28  0:41     ` Franky Lin
2012-06-28 15:42     ` Jon Hunter
2012-06-28 15:42       ` Jon Hunter
2012-06-28 15:42       ` Jon Hunter
2012-06-28 21:24       ` Franky Lin
2012-06-28 21:24         ` Franky Lin
2012-06-28 21:55         ` Jon Hunter
2012-06-28 21:55           ` Jon Hunter
2012-06-28 21:55           ` Jon Hunter
2012-06-28 22:53           ` Franky Lin
2012-06-28 22:53             ` Franky Lin
2012-06-28 22:53             ` Franky Lin
2012-06-28 22:59             ` Jon Hunter
2012-06-28 22:59               ` Jon Hunter
2012-06-28 22:59               ` Jon Hunter
2012-06-28 23:10               ` Franky Lin
2012-06-28 23:10                 ` Franky Lin
2012-06-28 23:28                 ` Jon Hunter
2012-06-28 23:28                   ` Jon Hunter
2012-06-28 23:28                   ` Jon Hunter
2012-06-28 23:35                 ` Jon Hunter
2012-06-28 23:35                   ` Jon Hunter
2012-06-28 23:35                   ` Jon Hunter
2012-06-28 23:54                 ` Jon Hunter
2012-06-28 23:54                   ` Jon Hunter
2012-06-28 23:54                   ` Jon Hunter
2012-06-29  0:59                   ` Franky Lin
2012-06-29  0:59                     ` Franky Lin
2012-06-29  4:07                     ` DebBarma, Tarun Kanti
2012-06-29  4:07                       ` DebBarma, Tarun Kanti
2012-06-29  4:07                       ` DebBarma, Tarun Kanti
2012-06-29 15:53                       ` Jon Hunter
2012-06-29 15:53                         ` Jon Hunter
2012-06-29 15:53                         ` Jon Hunter
2012-06-27 23:43 ` Jon Hunter
2012-06-27 23:43   ` Jon Hunter
2012-06-27 23:43   ` Jon Hunter
2012-06-28  1:03   ` Franky Lin
2012-06-28  1:03     ` Franky Lin
2012-06-28 15:37     ` Jon Hunter
2012-06-28 15:37       ` Jon Hunter
2012-06-28 15:37       ` Jon Hunter

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=CAC83ZvL2ozQD1DYmtKeFa1PB1pZ1JmBUKFWmDWnbJOCDL3sKNg@mail.gmail.com \
    --to=tarun.kanti@ti.com \
    --cc=b-cousson@ti.com \
    --cc=frankyl@broadcom.com \
    --cc=grant.likely@secretlab.ca \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.