From patchwork Wed Apr 5 11:58:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 9663843 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2EBE60353 for ; Wed, 5 Apr 2017 12:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D361826E4D for ; Wed, 5 Apr 2017 12:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C815128484; Wed, 5 Apr 2017 12:00:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D12D26E4D for ; Wed, 5 Apr 2017 12:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755203AbdDEMAn (ORCPT ); Wed, 5 Apr 2017 08:00:43 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:5508 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932927AbdDEL6W (ORCPT ); Wed, 5 Apr 2017 07:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1491393502; x=1522929502; h=cc:from:to:subject:date:message-id:in-reply-to: references; bh=8sRjioCWLeIlTsvYx1qt2ln3kXfY3NXAibsaP3rqMpg=; b=PxSdfVuKWbNVCzP8oNqSx8bWJbPOlThbpYmvnxIkcCKgbHOuZT+aMloa qrCOzNU0GJaZ0Lk644y70rp15hgUP3iUv6H9g0aa29IJ7ocxHHLFNlD3U Tzz4DAT9Hv/GLqZRNf74xoZrM4jew1SKZMieXGnsmvNputLM4k6eiKKFX U=; X-IronPort-AV: E=Sophos;i="5.36,278,1486454400"; d="scan'208";a="371582744" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine02.qualcomm.com with ESMTP; 05 Apr 2017 04:58:20 -0700 Cc: Hamad Kadmany , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez X-IronPort-AV: E=McAfee;i="5800,7501,8488"; a="899448685" X-MGA-submission: =?us-ascii?q?MDHwOfPWznigYxsPCXO1Mc5MenA6KaRglZ/p0N?= =?us-ascii?q?JWAo5JtbFkDtGiRthnSd1mehra8qDtRtFO7lBJmLB+vB6bWLN5+sHf9z?= =?us-ascii?q?ePXHuDAg3v5nfByhO1DVRyniqonYJj9FKnct7fMUoAgY0Oo2Y/njuEoD?= =?us-ascii?q?bE?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg02-L.qualcomm.com with ESMTP; 05 Apr 2017 04:58:18 -0700 From: Maya Erez To: Kalle Valo Subject: [PATCH 01/11] wil6210: fix sequence for scan-abort during reset Date: Wed, 5 Apr 2017 14:58:04 +0300 Message-Id: <1491393494-11816-2-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491393494-11816-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1491393494-11816-1-git-send-email-qca_merez@qca.qualcomm.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hamad Kadmany Communication with FW must be done before wil->status is initialized in order to properly handle cases where communication with FW halts during reset sequence. Signed-off-by: Hamad Kadmany Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index c33cc4a..7e72096 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -948,15 +948,15 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw) /* Disable device led before reset*/ wmi_led_cfg(wil, false); + mutex_lock(&wil->p2p_wdev_mutex); + wil_abort_scan(wil, false); + mutex_unlock(&wil->p2p_wdev_mutex); + /* prevent NAPI from being scheduled and prevent wmi commands */ mutex_lock(&wil->wmi_mutex); bitmap_zero(wil->status, wil_status_last); mutex_unlock(&wil->wmi_mutex); - mutex_lock(&wil->p2p_wdev_mutex); - wil_abort_scan(wil, false); - mutex_unlock(&wil->p2p_wdev_mutex); - wil_mask_irq(wil); wmi_event_flush(wil);