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: 148442 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp292690vqb; Wed, 4 Oct 2023 10:30:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBPPGUhHJmjdD4Ad2BWbd7oEkNwk0L2ulkbSaBx0P/behpupX1y7nmdDrQ+ksyQvdlGS/4 X-Received: by 2002:a05:6358:4297:b0:135:57d0:d173 with SMTP id s23-20020a056358429700b0013557d0d173mr3041837rwc.20.1696440631277; Wed, 04 Oct 2023 10:30:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696440631; cv=pass; d=google.com; s=arc-20160816; b=tKKKxQP4F9KPGhb0NWG+LFpeOO0SwRh5r3eoCTvPIKqvkcms5dGq0uXW0SbQLJuTsk fny0TJSu60wPGNlJav2h9s75mR4IY+ORWzwQndHMo1N9ojEXghXJhm9bVv2ywxzWFGLx 9pXY4evEMxNwv//Re2oHPmO/WOlOLAtbqhqnl52St9UeN9jaTtMhNqQhJPDXJ9Wz9GeK 0T5Gy/ODDlBPkwKtq1je7BJL2eAFv7vCyI1VpLmBv/+8CU5xCfIJcjXvG9xccptzWFxc 0JqudRiTIkLN3b7yM5JNJI5uH3nn0hL2lAFxavkMzfLqOuypAA4KpNEqriRGCJj2SwQT jKPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uFAaoOX/wsVCx+7JK4GuOCjNe4Hcm8a4PR49uuM5L30=; fh=l0GbbulFVEGIByrdVk2PDAYC0467jisoj0AJEvNmoTE=; b=JOvEt7YPQ0xA8orAsCbDmQhRKp9KSelJr2EZqyJODirhobw8uoDA3OisssLO/93v3K KH1Hj71ac3zJnalu8rI/kV/ClYPg+VsVEnvm9j1kc6riOWLd7aymJI3Xx8uK+p8EeOMY t9R7WE1AkvalkGll+EC38Y2az9OyX9ninOhHcWD9MPZ8H03M62XxMPhMeMeLzrjPhWzl iaTKTl799FtrWieJfWcROUcSNQDoCEUYHuQ/3N4nx0c8ApoZCbbMrlGpWAsbmxfwzm9H xDuGAk7pHSiui+AQy+1tHBcBryAANQBb60B6uTcLaNEB2slvQYHh3uzvNM2Q2vldZ6ww zqtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=RY4Urxma; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i62-20020a638741000000b00578d6cb1a16si4372951pge.178.2023.10.04.10.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=RY4Urxma; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C311580DCA5E; Wed, 4 Oct 2023 10:30:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243708AbjJDR3Q (ORCPT + 19 others); Wed, 4 Oct 2023 13:29:16 -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?= =?utf-8?q?1Rbd9epIQUfbX1KgijCaQ/r4GXBQjgqdHl/1cOuFFDq+P7KLgl1WjauoHlLSbh7UM?= =?utf-8?q?5TSzvKavY+KlbsR5/s8STfpEsKOHQTX5c8oPfQ/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h0A8n/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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:30:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778846930986769865 X-GMAIL-MSGID: 1778846930986769865 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); }