From patchwork Tue Sep 17 18:25:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 2903391 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A3D9BFF05 for ; Tue, 17 Sep 2013 18:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39C4A202D1 for ; Tue, 17 Sep 2013 18:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 135FE202CF for ; Tue, 17 Sep 2013 18:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753420Ab3IQSZt (ORCPT ); Tue, 17 Sep 2013 14:25:49 -0400 Received: from svenfoo.org ([82.94.215.22]:50108 "EHLO mail.zonque.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055Ab3IQSZt (ORCPT ); Tue, 17 Sep 2013 14:25:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id A0201C162C; Tue, 17 Sep 2013 20:25:46 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nFpJ7i9TirLC; Tue, 17 Sep 2013 20:25:46 +0200 (CEST) Received: from tamtam.fritz.box (p5DDC5080.dip0.t-ipconnect.de [93.220.80.128]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id E47A7C13FA; Tue, 17 Sep 2013 20:25:45 +0200 (CEST) From: Daniel Mack To: linux-wireless@vger.kernel.org Cc: s.neumann@raumfeld.com, afenkart@gmail.com, bzhao@marvell.com, linville@tuxdriver.com, johannes.berg@intel.com, Daniel Mack , Subject: [PATCH 3.12] mwifiex: queue main work from main process when bailing on races Date: Tue, 17 Sep 2013 20:25:30 +0200 Message-Id: <1379442330-18249-1-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Queue main_work in case mwifiex_main_process() bails due to an already processed transaction. This is particularly necessary because mwifiex_main_process() is called from both the SDIO interrupt handler and the workqueue. In case an interrupt occurs while the main process is currently executed from the workqueue, the interrupt is lost, resulting in a command timeout and consequently a card reset. I'm marking this for stable kernel in version 3.7+, because on our platform, the issue appears since 601216e12c ("mwifiex: process RX packets in SDIO IRQ thread directly") went in. Signed-off-by: Daniel Mack Reported-by: Sven Neumann Reported-by: Andreas Fenkart Cc: Bing Zhao Cc: [v3.7+] Acked-by: Bing Zhao --- drivers/net/wireless/mwifiex/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index ff4ed96..0700bc2 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -235,6 +235,7 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) /* Check if already processing */ if (adapter->mwifiex_processing) { spin_unlock_irqrestore(&adapter->main_proc_lock, flags); + queue_work(adapter->workqueue, &adapter->main_work); goto exit_main_proc; } else { adapter->mwifiex_processing = true;