From patchwork Mon Sep 16 11:39:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 2896591 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 A67A7BFF05 for ; Mon, 16 Sep 2013 11:39:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88A3B201D3 for ; Mon, 16 Sep 2013 11:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF883201EC for ; Mon, 16 Sep 2013 11:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757426Ab3IPLjT (ORCPT ); Mon, 16 Sep 2013 07:39:19 -0400 Received: from svenfoo.org ([82.94.215.22]:48005 "EHLO mail.zonque.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751866Ab3IPLjR (ORCPT ); Mon, 16 Sep 2013 07:39:17 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 21F94C1683; Mon, 16 Sep 2013 13:39:12 +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 jV9Nsbdw44jK; Mon, 16 Sep 2013 13:39:12 +0200 (CEST) Received: from tamtam.fritz.box (p5DDC6431.dip0.t-ipconnect.de [93.220.100.49]) (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 080A0C1701; Mon, 16 Sep 2013 13:39:10 +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 1/1] mwifiex: queue main work from main process when bailing on races Date: Mon, 16 Sep 2013 13:39:06 +0200 Message-Id: <1379331546-30617-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1379331546-30617-1-git-send-email-zonque@gmail.com> References: <1379331546-30617-1-git-send-email-zonque@gmail.com> 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+] --- 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;