From patchwork Wed Oct 4 17:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 729678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0476E7C4E7 for ; Wed, 4 Oct 2023 17:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243688AbjJDR3O (ORCPT ); Wed, 4 Oct 2023 13:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243673AbjJDR3M (ORCPT ); Wed, 4 Oct 2023 13:29:12 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9183B8; Wed, 4 Oct 2023 10:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EnB6a5pnSsK6FWaVsvwnJs0fY8zkzVoSOpLAxFAPSkfjJH2dqOm0eAH0LRAoAvKiUYpfYJBBkssit5HaUffPFxSHBpLpYRtkPVycv7RhXip40KUvND45eyJj56gDArcNKymDlhf/WC2FS3cM1pyVB/rn/IJTulwb1ILfFLNjqt1eBEBaOKeWYINgM9XNQDPDvgIbEfZkQWMT0LJLJlCfqlkKk11banMMW3Bkc31L7EuuHGFOue9LvoAYwcjI8rkvGvze3p5hhj755VrVTUDqjrrHR55lE6ucpJO+fNPbcP6nVh46nqjHhcQADiquQFkOfrGqQtT/UpbOdqxRSSIVdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uFAaoOX/wsVCx+7JK4GuOCjNe4Hcm8a4PR49uuM5L30=; b=n87cAiA/Owitrv7Ws7m+frM9D8WqrwxoCt0h2IIB1SxWniCPC3qtMXw0iHNdYnhQxf5cDCML532Ihn/MxyKNziOU8xDhkhnM9rygH7n1u3o1Jlje5dNCllwtQ7O3T8oMVPWADjhkR1ZZFTfHsLHQtUBAr2b2yCH0LJA4xSq+HEgIqNIyaF0iryWuSHyK6qwny2sy7ng1XZ6l2a7pK34qHNit5FRl7Ddqr591L2FM63c1YR4aKmhqjeUTQfgUFomWwylbI9GtU20nWetrZ2KmeyvM1lhP1AljMQp8J7l8izjfdv0H1N+DPVuWyN1keZy48pNJR1yLWluzCqlJC9kduw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uFAaoOX/wsVCx+7JK4GuOCjNe4Hcm8a4PR49uuM5L30=; b=RY4UrxmaRFj+kcA9bBjhOo7Hr5vN3q+H8kOuqOAIh5AGhE8E/gxturAGU5FzOtCv7WSc7yGwys0nsG7+Nd0F5FHWly7+eLMHdd1H07WBcqmWGHb9/FCmV8gmXEgmtOv5hJRwc8RfFKLL2zofeQ20Q44M3Tsn6U1F7Lkv6ii2P/w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:02 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6838.030; Wed, 4 Oct 2023 17:29:02 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v3 5/8] wifi: wfx: simplify exclusion between scan and Rx filters Date: Wed, 4 Oct 2023 19:28:40 +0200 Message-Id: <20231004172843.195332-6-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: ee7fa7f1-9d66-47df-7391-08dbc4ff6695 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92xNgbdznuIU8Sa8ZRVhDGfVh6aH2t/ltM4YDFa/Xmo3M5768xLoNbTSKcsv1ONOTHkqr6kmHgYGwCf9YCftEVvb9lPcX19VmE9hAatQhn10Tl40FK0byDLx4z5jv2QVF8gHHK9B4IdRBmUKuMq1fKqLIeyCYjwJETxeg26mHxyhveJwPffS4HdIdlNVPB4VdKCxR8T3ikj+xUOr5v1Lf5F0DJM+s24OG/cRAcNhLRdjKKJsAqG2ahzxJqmb1gBdcepxhlEuExm16k4H07OaU6SNfL4VauThQ/uwlp9+K9VpkhyzKx0Mc00P/PdadD/PXoKRyClr0sYk6RpZIogUFk4JjvZOuNZju9SIoi6SPIVhQJG7p1Ql2G9+loIU5UOphaQXQeZV8CkfCircgKAgdvGExE0in0/2VI3a0Fo2TskgJL1fUNTVKJbzI2Y2UG5GqPbBzWR6S0jykM2EO9J+Shhiu8iAo0HJ1p1EA4kuaLCVXt8OfnV+zVJVJZZ+LZEXydneY2isFK+6IPHNQ8yytk8mVi78IGVPbNDd9xikcKiuTbFTwJHh0x54Mlu1xJpX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB7773.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RQzpYw25GCWQn8pqUDWSGneIzSGH?= =?utf-8?q?vSTs6kWnqfiUMUb5nFk6xzMbzCQTIz66jwH5/+FtJCyisA8ium9iay+4SL+nQOk6B?= =?utf-8?q?Qj3SNhz4amtCTuDfvPkHgh2zbkbgXMDpd507IJzXWMEhAGLmfQcFht22lElxwzUTS?= =?utf-8?q?kComUWYy5uSAy8nheO294YevbGG8TlGeGIl0UwFlW77xlSZEM/sJqM0Ly/bmu3Oo0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FSNjwK?= =?utf-8?q?7Nd+qtsFJMNoFJnZzIkby2vcLuqo4ZSOUm8rx/SLLGytHQW5kOV3lwLJ8tWaK42r3?= =?utf-8?q?3wLZhuJmsgJsncNZdESliWN+YI1pf6KmLmh0A8n/MSalHrUx3srhlH+/F3CbHp+fn?= =?utf-8?q?CizC+tnVcsHysBGi3Q2ZmGI5p/2YjBSjETHKkukdfISi5PXQu5XqLem5S4A5IpFwD?= =?utf-8?q?PotuCq2SnCIqt4M6kEO+V7zJPgDE6GGI31Gk0SRwuPyuXbwIk4G2woUitj/6XD6eN?= =?utf-8?q?Bu7P9l9Pfwau9fllN/02ExN4KrB+HwyO1nmZ8dvCv3F38c3n+HHcgFTb4kDapycaH?= =?utf-8?q?gDK2tZHozg3Z7Vd+aD1eTqzcxFFXaX4kDdJwozBjI5BF2tDiQp8R9RxSF3rws0Mm2?= =?utf-8?q?2k38E7P4MxT3jvM1god7YQF2F31KHhiCq/Sw0NZj7xe0A/wyWuOcNCjtbprnj7XMp?= =?utf-8?q?WfA1mkZcj+aSpp3yBalJF3o54WIr/mgTohQSCtWTGB6jt0NPrABRxaU5SOLVzCeQs?= =?utf-8?q?ghpUre1rsAX?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee7fa7f1-9d66-47df-7391-08dbc4ff6695 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:02.1734 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oxqjaRYIJIJCh8UUWHXpByDAGqyqSfgzthxs9By7LykSge+hRlaZ59Bgb4anKLCscTwt0m/2fYDzIu2pBH8pRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The device ignore the rx filters during the scan operation. wfx_configure_filter() acquires scan_lock to reflect this restriction. However, it is not really necessary since mac80211 don't try to configure Rx filters during scan. However, the things are changing. The scan operation is going to be used to implement remain-on-channel. In this case, wfx_configure_filter() can be called during the scan. Currently, this scenario generate a delay that end with a timeout in the upper layers. For the final user, some scenario of the EasyConnect specification end with a failure. So, avoid acquiring the scan_lock and just return. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/sta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index c58db2bcea87b..cb03a5cf7ffa4 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -96,10 +96,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, *total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS | FIF_PROBE_REQ | FIF_PSPOLL; + /* Filters are ignored during the scan. No frames are filtered. */ + if (mutex_is_locked(&wvif->scan_lock)) + return; + mutex_lock(&wdev->conf_mutex); while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - mutex_lock(&wvif->scan_lock); - /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and * beacons from other BSS */ @@ -126,8 +128,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, else filter_prbreq = true; wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq); - - mutex_unlock(&wvif->scan_lock); } mutex_unlock(&wdev->conf_mutex); }