Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 453b0c3f authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville
Browse files

mwifiex: fix SDIO interrupt lost issue

601216e1 "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: default avatarSven Neumann <s.neumann@raumfeld.com>
Reported-by: default avatarAndreas Fenkart <andreas.fenkart@streamunlimited.com>
Tested-by: default avatarDaniel Mack <zonque@gmail.com>
Reviewed-by: default avatarDylan Reid <dgreid@chromium.org>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarPaul Stewart <pstew@chromium.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dfb6b7c1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);