Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2483923rdb; Wed, 4 Oct 2023 02:37:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiVTsc2q81KEwBz2AfY0ieVLMHg+lxKJyZ6M8vBqVOkPvc0BF64tj/Za8lPaSrahhL8SC4 X-Received: by 2002:a05:6a20:7354:b0:15e:b763:2422 with SMTP id v20-20020a056a20735400b0015eb7632422mr7480090pzc.9.1696412236315; Wed, 04 Oct 2023 02:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696412236; cv=none; d=google.com; s=arc-20160816; b=M+MAiP+7mFt6hw3N5SXU1X50MVBcL7TFHbJVNnh83Xkk7bAtu0qEQCtmwNyhApwHdC dXsusxVCvyrpgzM+75L1hycHmSPy276eR8HwfABCv2U5+hNqjlT8OjLlQKkrOlx5lmIK eCLP641PQjjRakL++ap4WLsxew3JEkc1llSUg8kAuBsr9Om1j2zYdk9DnMkWEIkvJl2P MQrV4/H3gmezjj34RkS01iSE2DynztCcY5ELLmO+y/5d9X1bDmMwVtbDlh9CkekZVZJh uTS0iAVia7OZcikxOswcEuo2r+QjptJIIBkg0zSwkFg8jg7BYCWQu3eCbyPTPQGl3IdE MrMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Lse8unceeBlZSIYehw9Iyo0Qm+xqQqD7uemGpMABH5Q=; fh=v78ykjHCzCVwxZtbRdthmW7wH6NM9QbVMtLidpf/uiI=; b=cKOksfkNeaj+XggxKx+C7gK+ZxiMxPLciJjWXzDH26Q2ArbPUZCEz6LuQ1mJgVRVj7 O/PH23ufM7QkEl5jb/1Pq1lqlr0S01AT713BPaDZ3AQzSlJ5h33uJjw/l88x2lhqosWe lkTO24yi7e+tq0rKQdUHbXvsPkDUl7SGoa5KUlFkN9qQZ7jIVQzgRASRlexqSylDuB2j 94tly2AGWEV8CUtWUiWlUvVIdHLDhpg+tTPPtnoK1zU3UYtlTZDqGU3VQpjoc9nzGz0e ppuQIwxRvrrjcuYWkUuQW7VT8Go2UiNbpx/3MIWvAZs61LGBVD4p5oAzBShL/Dfp5rSO /Sag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=naFCgYpF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y73-20020a638a4c000000b0057458518e20si3325031pgd.164.2023.10.04.02.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=naFCgYpF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 266C18206D66; Wed, 4 Oct 2023 02:37:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242023AbjJDJhM (ORCPT + 53 others); Wed, 4 Oct 2023 05:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242031AbjJDJhJ (ORCPT ); Wed, 4 Oct 2023 05:37:09 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BFFC9 for ; Wed, 4 Oct 2023 02:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696412226; x=1727948226; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aaQbZYm62D4fCzj0NnolpXqk56xyLVeFSijgr0HN4Fg=; b=naFCgYpFcoQbAEYGXRw/pBgYmAtHwYRECjo22Y+F7QUOurRKUVW3CBn8 /yOaABUQ7Q2SR9x72/uE24N5MlrGLHLOFEG4ZfWS8k7OhaNhXnY0pK0HX DVh+YxwReUkPu+U7VW82AHsKKGAB+vk7nvilQEZ/gz6RqUs8ThaSpC33b SFkbwBw8JSJHZg39RvGIaMMCsjkoGC6cUAZFBSCqJQU9jSGH5eopRB/fX 6069hgo8mTE6CL0fjQHdQavb+mLQ98+Kq7nfK8fj7/G/qhWzvZqc1T/kF XJicNjZeBIc8LTh1mNS64t+5ZSCHqWJFkKeS3eOxkZtoO7hjS4OseoiQL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="449611819" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="449611819" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 02:37:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="1082415180" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="1082415180" Received: from oferweis-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.222.21]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 02:37:04 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Miri Korenblit , Gregory Greenman Subject: [PATCH 09/15] wifi: iwlwifi: abort scan when rfkill on but device enabled Date: Wed, 4 Oct 2023 12:36:28 +0300 Message-Id: <20231004123422.c43b69aa2c77.Icc7b5efb47974d6f499156ff7510b786e177993b@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20231004093634.131303-1-gregory.greenman@intel.com> References: <20231004093634.131303-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:37:15 -0700 (PDT) From: Miri Korenblit In RFKILL we first set the RFKILL bit, then we abort scan (if one exists) by waiting for the notification from FW and notifying mac80211. And then we stop the device. But in case we have a scan ongoing in the period of time between rfkill on and before the device is stopped - we will not wait for the FW notification because of the iwl_mvm_is_radio_killed() condition, and then the scan_status and uid_status are misconfigured, (scan_status is cleared but uid_status not) and when the notification suddenly arrives (before stopping the device) we will get into the assert about scan_status and uid_status mismatch. Fix this by waiting for FW notif when rfkill is on but the device isn't disabled yet. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index c1d9ce753468..5edcbfbc01ef 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -3408,7 +3408,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify) if (!(mvm->scan_status & type)) return 0; - if (iwl_mvm_is_radio_killed(mvm)) { + if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) { ret = 0; goto out; } -- 2.38.1