* [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue
@ 2013-09-27 17:55 Bing Zhao
2013-09-27 18:55 ` Daniel Mack
2013-10-15 10:38 ` Daniel Mack
0 siblings, 2 replies; 5+ messages in thread
From: Bing Zhao @ 2013-09-27 17:55 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Sven Neumann, Andreas Fenkart, Daniel Mack,
Dylan Reid, Paul Stewart, Amitkumar Karwar, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
601216e "mwifiex: process RX packets in SDIO IRQ thread directly"
introduced a command timeout issue which can be reproduced easily on
an AM33xx platform using a test application written by Daniel Mack:
https://gist.github.com/zonque/6579314
mwifiex_main_process() is called from both the SDIO handler and
the workqueue. In case an interrupt occurs right after the
int_status check, but before updating the mwifiex_processing flag,
this interrupt gets lost, resulting in a command timeout and
consequently a card reset.
Let main_proc_lock protect both int_status and mwifiex_processing
flag. This fixes the interrupt lost issue.
Cc: <stable@vger.kernel.org> # 3.7+
Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Reported-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
---
drivers/net/wireless/mwifiex/main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index fd77833..c2b91f5 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -358,10 +358,12 @@ process_start:
}
} while (true);
- if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter))
+ spin_lock_irqsave(&adapter->main_proc_lock, flags);
+ if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
+ spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto process_start;
+ }
- spin_lock_irqsave(&adapter->main_proc_lock, flags);
adapter->mwifiex_processing = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
--
1.8.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue
2013-09-27 17:55 [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue Bing Zhao
@ 2013-09-27 18:55 ` Daniel Mack
[not found] ` <CAMcMvsjFurVFS2f1zCPt0uqh2gCYAvHOvos-pY=k06=ynDH=aQ@mail.gmail.com>
2013-10-15 10:38 ` Daniel Mack
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2013-09-27 18:55 UTC (permalink / raw)
To: Bing Zhao
Cc: linux-wireless, John W. Linville, Sven Neumann, Andreas Fenkart,
Dylan Reid, Paul Stewart, Amitkumar Karwar
On 27.09.2013 19:55, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
>
> 601216e "mwifiex: process RX packets in SDIO IRQ thread directly"
> introduced a command timeout issue which can be reproduced easily on
> an AM33xx platform using a test application written by Daniel Mack:
>
> https://gist.github.com/zonque/6579314
Actually, just out of pure curiosity, I would be interested whether the
issue is also as easily reproducible on other platform like Chromebooks.
Could anyone give that a try maybe?
Thanks,
Daniel
>
> mwifiex_main_process() is called from both the SDIO handler and
> the workqueue. In case an interrupt occurs right after the
> int_status check, but before updating the mwifiex_processing flag,
> this interrupt gets lost, resulting in a command timeout and
> consequently a card reset.
>
> Let main_proc_lock protect both int_status and mwifiex_processing
> flag. This fixes the interrupt lost issue.
>
> Cc: <stable@vger.kernel.org> # 3.7+
> Reported-by: Sven Neumann <s.neumann@raumfeld.com>
> Reported-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> Reviewed-by: Dylan Reid <dgreid@chromium.org>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> Signed-off-by: Paul Stewart <pstew@chromium.org>
> ---
> drivers/net/wireless/mwifiex/main.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
> index fd77833..c2b91f5 100644
> --- a/drivers/net/wireless/mwifiex/main.c
> +++ b/drivers/net/wireless/mwifiex/main.c
> @@ -358,10 +358,12 @@ process_start:
> }
> } while (true);
>
> - if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter))
> + spin_lock_irqsave(&adapter->main_proc_lock, flags);
> + if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
> + spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
> goto process_start;
> + }
>
> - spin_lock_irqsave(&adapter->main_proc_lock, flags);
> adapter->mwifiex_processing = false;
> spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue
2013-09-27 17:55 [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue Bing Zhao
2013-09-27 18:55 ` Daniel Mack
@ 2013-10-15 10:38 ` Daniel Mack
2013-10-15 16:59 ` John W. Linville
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2013-10-15 10:38 UTC (permalink / raw)
To: Bing Zhao, linux-wireless
Cc: John W. Linville, Sven Neumann, Andreas Fenkart, Dylan Reid,
Paul Stewart, Amitkumar Karwar
On 27.09.2013 19:55, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
>
> 601216e "mwifiex: process RX packets in SDIO IRQ thread directly"
> introduced a command timeout issue which can be reproduced easily on
> an AM33xx platform using a test application written by Daniel Mack:
>
> https://gist.github.com/zonque/6579314
>
> mwifiex_main_process() is called from both the SDIO handler and
> the workqueue. In case an interrupt occurs right after the
> int_status check, but before updating the mwifiex_processing flag,
> this interrupt gets lost, resulting in a command timeout and
> consequently a card reset.
>
> Let main_proc_lock protect both int_status and mwifiex_processing
> flag. This fixes the interrupt lost issue.
John, could you take this patch trough your tree?
Thanks,
Daniel
>
> Cc: <stable@vger.kernel.org> # 3.7+
> Reported-by: Sven Neumann <s.neumann@raumfeld.com>
> Reported-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> Reviewed-by: Dylan Reid <dgreid@chromium.org>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> Signed-off-by: Paul Stewart <pstew@chromium.org>
> ---
> drivers/net/wireless/mwifiex/main.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
> index fd77833..c2b91f5 100644
> --- a/drivers/net/wireless/mwifiex/main.c
> +++ b/drivers/net/wireless/mwifiex/main.c
> @@ -358,10 +358,12 @@ process_start:
> }
> } while (true);
>
> - if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter))
> + spin_lock_irqsave(&adapter->main_proc_lock, flags);
> + if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
> + spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
> goto process_start;
> + }
>
> - spin_lock_irqsave(&adapter->main_proc_lock, flags);
> adapter->mwifiex_processing = false;
> spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue
2013-10-15 10:38 ` Daniel Mack
@ 2013-10-15 16:59 ` John W. Linville
0 siblings, 0 replies; 5+ messages in thread
From: John W. Linville @ 2013-10-15 16:59 UTC (permalink / raw)
To: Daniel Mack
Cc: Bing Zhao, linux-wireless, Sven Neumann, Andreas Fenkart,
Dylan Reid, Paul Stewart, Amitkumar Karwar
On Tue, Oct 15, 2013 at 12:38:50PM +0200, Daniel Mack wrote: > On 27.09.2013 19:55, Bing Zhao wrote:
> > From: Amitkumar Karwar <akarwar@marvell.com>
> >
> > 601216e "mwifiex: process RX packets in SDIO IRQ thread directly"
> > introduced a command timeout issue which can be reproduced easily on
> > an AM33xx platform using a test application written by Daniel Mack:
> >
> > https://gist.github.com/zonque/6579314
> >
> > mwifiex_main_process() is called from both the SDIO handler and
> > the workqueue. In case an interrupt occurs right after the
> > int_status check, but before updating the mwifiex_processing flag,
> > this interrupt gets lost, resulting in a command timeout and
> > consequently a card reset.
> >
> > Let main_proc_lock protect both int_status and mwifiex_processing
> > flag. This fixes the interrupt lost issue.
>
> John, could you take this patch trough your tree?
I already did, and it is already in Dave's tree too...
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-15 17:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 17:55 [PATCH 3.12] mwifiex: fix SDIO interrupt lost issue Bing Zhao
2013-09-27 18:55 ` Daniel Mack
[not found] ` <CAMcMvsjFurVFS2f1zCPt0uqh2gCYAvHOvos-pY=k06=ynDH=aQ@mail.gmail.com>
2013-09-28 9:46 ` Daniel Mack
2013-10-15 10:38 ` Daniel Mack
2013-10-15 16:59 ` John W. Linville
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).