From patchwork Thu Feb 15 11:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 128407 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1620010ljc; Thu, 15 Feb 2018 03:08:35 -0800 (PST) X-Google-Smtp-Source: AH8x22472gA7p9M+T4Crbd1Zh/JzNnpZYfCDXPBcdS9CdmO/+CmbfBVeonQol/FyX7AB+idM8gEz X-Received: by 10.99.120.205 with SMTP id t196mr1845299pgc.392.1518692915626; Thu, 15 Feb 2018 03:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518692915; cv=none; d=google.com; s=arc-20160816; b=t2wT30Dg1QmgI8fGo3aNCL2JCbYTv3Aq9t5QL2awqJwo+xvOZlJo7IVMDqAgN/s52m n+6yK5vYuNjaqluGlls4V83W9l9MaJTRdTFgBrZdP9zbsp/PSGJo2RHqHlnA/xJNUTln DDk356GmTWMaL3ytq/cQ+DLGFOzoTJgwE/rbEQ2SKBmx+/NcqX2lFqP6r7IaQsH0m8px ohMNZPWE5hjbLSkIyF+s2qDJ74KCbzWEYh2si/qNzIXe1Z959TPzYb63p2MAGBxlPDGj cTs6R0gWWce4u1Vj4tzlM/9sOERePxVWd/5tE1VFy/upMo/jJyrmelH2FqW736zF0Rnt w6yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=M7MspwBqWGDmNTVqhfANtSYxcyjrmynBfa68WRtBfRo=; b=dnwjtpKyba/4e+CUFwgncQtVAKhpU5tdRqRcwAZaR6M5/e34qagtwPMGnyfmfQRvaE nzn/kzplzVWYvL4WVeerBkojphM/vtdxaUGYt1IzcKAjGa2KJ+CkrmK8IG9jWfkhnRsh mS0a0Dz5mVkmDsdhpDW9oxoxJWZCs+6qcgZ/Cgxeisz1gIsC223sEP8EejJ9kJpcSz6p BFTw6FL3K6CwXRhV1HfEBCI9/Po5rw3K3PsH65NkqlNulbD81cU5AGGNRUnTWIDcrftg 8yliCDhzBYHSVKIuJKXNfcWog7OfrJ23K2VmSDDNsEze3smKIsfCsrkhYo+hb+IhH/5h eptQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lu0eTI3x; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w123si1340728pfd.285.2018.02.15.03.08.35; Thu, 15 Feb 2018 03:08:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lu0eTI3x; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755444AbeBOLId (ORCPT + 2 others); Thu, 15 Feb 2018 06:08:33 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44926 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755389AbeBOLIc (ORCPT ); Thu, 15 Feb 2018 06:08:32 -0500 Received: by mail-wr0-f195.google.com with SMTP id v65so2921938wrc.11 for ; Thu, 15 Feb 2018 03:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=M7MspwBqWGDmNTVqhfANtSYxcyjrmynBfa68WRtBfRo=; b=Lu0eTI3xHk8iqZbaMjol/MwloUypAB9DY924FxAbIcLdED1AH4r95opm6Iev4/SBO7 kw01CR/BhF2GsLhb0cN6JGWTuvQLf/wc4XHrjBGjPXRTUKMqnNRs0cfRZXcrjGQlUIbl NC+s6SWHYt0WloLXxd7dRDnRR5NOb84fh2Im0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M7MspwBqWGDmNTVqhfANtSYxcyjrmynBfa68WRtBfRo=; b=IEKPIonBnyKl7Dk9YoY/xL43S7HTR1pPufcoITAqsFSIIJfaLgX2TLOtNhKxFSXxXH aeCk+IXBMFy5vPgCrOTBO4g+HhBuDQ87p+aS2lJqnTINN+4Xc0Ks4gkfMk7UTSrZoK4h pCB2s7Lz5FAAcgRwRspPHAO4+GIELCfTtfbcUrxSOLbR93/X3SWXDf7vIsYaGpMSERkd BDNHi89xWTWlk3kvtXZgFVBtFgldOtVYhA76+0UtZ3OfjpVvFwHTbiJBHErnv8uWYajn xMcx3dCXX0ULLl5iLqOlg8xZSOp6b+q8gPSfCPdEtcKHMJEPr+ja+ncSooeN+2QDgD8k Wz7g== X-Gm-Message-State: APf1xPB6xRvQMnzTBWn17CmJ5wkT9s7tvySh4/cCX3YvxO7Vux1PaEgV JqDKDwJjZ7HUbmjrGjbU8q+OFCre0n0= X-Received: by 10.223.153.51 with SMTP id x48mr2010985wrb.216.1518692911037; Thu, 15 Feb 2018 03:08:31 -0800 (PST) Received: from localhost.localdomain ([2a01:cb19:8349:a800:506f:fc8a:be33:ea0b]) by smtp.gmail.com with ESMTPSA id j125sm13286366wmd.19.2018.02.15.03.08.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 03:08:30 -0800 (PST) From: Loic Poulain To: kvalo@codeaurora.org, k.eugene.e@gmail.com Cc: linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, nicolas.dechesne@linaro.org, wcn36xx@lists.infradead.org, Loic Poulain Subject: [PATCH] wcn36xx: Fix warning due to duplicate scan_completed notification Date: Thu, 15 Feb 2018 12:08:28 +0100 Message-Id: <1518692908-29303-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The wcn36xx_cancel_hw_scan method stops the hw scan and notify the scan completion via ieee80211_scan_completed. However, on scan offload cancellation, firmware sends a scan complete indication, triggering a new call to ieee80211_scan_completed. This leads to kernel warn since the scan has already been completed. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 9 +++------ drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index ab5be6d..fcc98d4 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -666,16 +666,13 @@ static void wcn36xx_cancel_hw_scan(struct ieee80211_hw *hw, { struct wcn36xx *wcn = hw->priv; - if (!wcn36xx_smd_stop_hw_scan(wcn)) { - struct cfg80211_scan_info scan_info = { .aborted = true }; - - ieee80211_scan_completed(wcn->hw, &scan_info); - } - mutex_lock(&wcn->scan_lock); wcn->scan_aborted = true; mutex_unlock(&wcn->scan_lock); + /* ieee80211_scan_completed will be called on FW scan indication */ + wcn36xx_smd_stop_hw_scan(wcn); + cancel_work_sync(&wcn->scan_work); } diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 2a4871c..7cc2928 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2138,6 +2138,8 @@ static int wcn36xx_smd_hw_scan_ind(struct wcn36xx *wcn, void *buf, size_t len) case WCN36XX_HAL_SCAN_IND_COMPLETED: mutex_lock(&wcn->scan_lock); wcn->scan_req = NULL; + if (wcn->scan_aborted) + scan_info.aborted = true; mutex_unlock(&wcn->scan_lock); ieee80211_scan_completed(wcn->hw, &scan_info); break;