From patchwork Wed Oct 4 17:28:41 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: 148438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp292059vqb; Wed, 4 Oct 2023 10:29:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFygFbivi0yZzPC207/ATOVKeOdY5buzEan0PcnrQ4Q1uyaWJUzj6umB5PfMGNDMJeKIRqU X-Received: by 2002:a17:903:230b:b0:1c6:a0b:7b9a with SMTP id d11-20020a170903230b00b001c60a0b7b9amr3998785plh.3.1696440570193; Wed, 04 Oct 2023 10:29:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696440570; cv=pass; d=google.com; s=arc-20160816; b=0zyaFAnGmW0CqjvsypeAoxmOK2ZF6/4Zsygc7U2NyHD+5XRKIwD/bgNCbpSIPFZBiD CTqPLRJExHbIPoVaC5ZusUG2XgJpTt3j7jleLTUI/j3CyZpOnbm1QoEl0fD3mubSE93u IDaPH+rW+5ziUhwVAgVpmh9BkH5Xt25tQAUCXKZvwSgraiQsZ2H7j2uDvKHh1JsYAMCu uRFmOO/OvezEqpYXdY+VRfdf/xNNYsmO6g+fJtWsn+pBKIqcC+dLvAh9tmZwSt+FaT0w PfoZ5q6FaeuQfcjGioD5f4Kc5YyxcNMzM80U/Qn2z31RqLG0CpjwmKSTrsuEE8B+kGEs dy+Q== 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=jAXF46m/CPJayObdo/yO2Zf+QM4FW1e/fwL2cbCAoNA=; fh=l0GbbulFVEGIByrdVk2PDAYC0467jisoj0AJEvNmoTE=; b=y9WJJRfjj0EyczF1nkejp26JWhi9rKVK8WSdyGF4p25ruR/0TTqDqlH1scmz/nkgkb enhPMHKZoLd/ykrqSf3hmxDE8s/s2uDvIMcT50LSdKiaaaZCg6zwT40KD5izTXFunKBB VOwvMbxu5z40PBMhYDgSuxYLBwSHn0py2qJG01+gWCD0p08xSLTnHo9LCn6E4fnRcdBM DZc5J9JRj+5kwaK43v7f6fGu0qdsOc+veu4E5YK5n6geUCPR9boIP1e7b5zM5qc85Bzh Daa2VDruMwbAbS17oDv8DYGzBp43g8DBE0zzqzKl4nlqJVxJCEBbSP7v8AQhNBLhgAb5 /oQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=YKZyRrg3; 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:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id kr15-20020a170903080f00b001c61bd9db5csi3864457plb.317.2023.10.04.10.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=YKZyRrg3; 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:4 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 howler.vger.email (Postfix) with ESMTP id AEBC68374397; Wed, 4 Oct 2023 10:29:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243729AbjJDR3W (ORCPT + 19 others); Wed, 4 Oct 2023 13:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243659AbjJDR3O (ORCPT ); Wed, 4 Oct 2023 13:29:14 -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 54FCED7; Wed, 4 Oct 2023 10:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQ44YiThTT1WwfjpCgYQ2+2bNS8gbkQykFeQzGAd8q4ED2XJtEokrWEQFqQKiNxu9cVoJUUt8NQ9OGSlq07YrJRAieAYCT68R6C2PYo3F76lr/LNrkY/RcbivoZnHd5CkU9FCeWgzMpAMLSXzfBeajKpi1Wtzd7HEXp+DQ6ctWNFfVhczNoXCLvagrzmcfvvVZo9yFUELtpnaJXGRtBPW+s3EaDaTceadaNprUdjIMOJuzcXIpzIyI7HlZ67lAbQDI/kEu08gJ0Vpgn/L9VgvpKvALJeKyUTntSbCv91nQpYw+6kJjM9Mv38wf6Hwur4X13R3rc+irRe+XyMI3thUg== 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=jAXF46m/CPJayObdo/yO2Zf+QM4FW1e/fwL2cbCAoNA=; b=GZE+P1iJX3jwVpym3Uz8/4iYmueTjzH05jxGdbMhOzAcXpYEexyWc713vSje9C1Swu8r1TK129fZJQ2M7eTVEHh7g7g0hNfZYKtGdaDcTRh8d3aaHu8uTKHmVNFYyA97FoVbDgpnAU79JK6KvZgR5rM2rAJNa22+FQmPFG/llBu3xgj7gyJ11e7xfPA2rxyOG3h/k63e2mzIk7sRcZiG3Ijo/t1mnCBIcoqen8CPML/ttQttQmIyJbDCEm8SYpqQVw4daUDvQgh2RmjHHQm+Zj2SslsTvt9ggBkA3rFndoZZavvDyqnRL+zeU89ibuLk0o+eJxQiy7GlLE9nxIPk3Q== 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=jAXF46m/CPJayObdo/yO2Zf+QM4FW1e/fwL2cbCAoNA=; b=YKZyRrg3FcPlhUnKuLTkGktpzeAuSp1oW7SCSSDhnVf9Ai6s6vWPHk8d39kJtpYHuVrHheftecrMLIkmBaiXsr5B2B8+N3vcFvrIkN+yeNABIqV7sfnAkhoRnnzXvieg9ez4qXzfry7v/LM6AI85qI2yKPz9RB6h0yzknXL1GtQ= 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:03 +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:03 +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 6/8] wifi: wfx: scan_lock is global to the device Date: Wed, 4 Oct 2023 19:28:41 +0200 Message-Id: <20231004172843.195332-7-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: d599b826-ab11-4ed4-bf1e-08dbc4ff675d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NdQkG3GFtGVgeME77MkkfPA0KZlDX9i2iinEZfnNXbmMLZy7h/e2RCy3t3dTknSluHXSCuObLvok1SOlz+DISjwPFJT9vgEwm8THYJdv964CSW2u9mJcGjmYEf0Ft2eEY/6eKKxzRtfKJSEC123zQPvsG3FgRCoCy45+26wwIGge82QZ25QrWk05VQ+aAbCgCOnFJ3Q5obQSrk7cYXfO97zxB2xbyXOAnGoZ8wlCxgxC0pLH0RmJtqDfanV3pAjqRYfjoaIhHpm373Y+0SZhQiyI2Nka5qjOG7dqeadTo3xAwzBYizW/sjNg3MomnB51S04daBXBfyzXOFWJLWpn9JP+swuqUJ/zYd/s14Z44dSpwXepufhYbk2DHuTKoKKkP1e6oXk4TBzfltG9P2d5KLlwyH8oAIJ4kZ0g8hRXxN9ck2uijrLYikWzdXAgoQkNDXsEI7P5BupPz2rton+lxU5Uh+knQmNxcHIjBQoQljlc0yKWBEnzaFHXluRI2v0mEgeJdgJB/SsAvjZBjQOJ1tR6QcpvKVEfl4Sk7NSVWIotVHiMERqYch+72bfsyimd 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?4k/HgQ+cWFZaCOvSDU3C+6XPzNR1?= =?utf-8?q?JsYO56uvGgE4YC+ghBnXtmjiihG6KFhh/gcgEb7H4gu8Me40E5VUXEeQg4p39U/e0?= =?utf-8?q?p2N+vfb7ICXnDrK6/hTxymBERmRVk3Airv3Twxuk4pCtvz3oQPMj8dxXgGrFY4fWX?= =?utf-8?q?JKW8U526mVtjd+R7Xj/NbYUe4225+eL37tS9cWfAVw7gZSdTJcRanzJVO3KlSZMmf?= =?utf-8?q?rG+86ZrnbTuCNlqz+4gLWCZUP8D4DvlfTx498kWyDgVnKIkHIq4wLFgUEMwbA/HzD?= =?utf-8?q?zYwzW5+krzwAafqqlyyhbdJDivqSyHcAajs1sAz1HQFeY2H4xCqPVELbb45ePKWnt?= =?utf-8?q?RBzPFrx6SG2PDICYNFx8QeCpWJX3IfsT2xLbAYAtGd/a2AqCJRtAbn0QOK4x3n6aA?= =?utf-8?q?vuPVbUsjsuf41p+NfZEq22AgXoNIxxkBxYdPHt3pXAedJewG4JmNJWzEeYHa3skSA?= =?utf-8?q?CMLNxiuY5PmT5QuG0pWot8gbkkJDt2uRgO1rO4ZbL/w3yAX/+MRIFiSlhkjVb3Epv?= =?utf-8?q?MC3gz7uwSOtvuJEtrw0ghJxDDYvXNIsIAa9Zl4Gg9g8rE/7oT9Fm9NScHzwdHYN0A?= =?utf-8?q?rbbRWiKm5dSnul7zSCOCBsP8guBNSsrsb0bdd1O9zN6BBuw9t3WgiL5RDcWG/6l78?= =?utf-8?q?24KkyWl0fF8uWtsKojR/CA3CGfTit3CxZBvt2qfv7TNXNoLIfqN7MUEa1fBgBDMK5?= =?utf-8?q?ZN+w0zyB+/ckmb/pjqqFkfWvmXYw403Kvx9t+GQ8PkKDawkQv4SFG0gvZEg2tbs3a?= =?utf-8?q?4It6a0E2QxnTV6jbtH55bCMhPc7NLpHWYCjvKQklEETYV+6Xijo5Y581EGi57BkhZ?= =?utf-8?q?9dgWEQ+2X+mFaQ6GJ37QpEbrYO9g9W3iYO1VQZ4W1ZoxcLdCFj6jJqAdkrkuuv7Z7?= =?utf-8?q?vWrCvJFHgPlnW+hfzu5tLDfjjHBvJ2qDo0yHN7n0WUiNI/JG2WH0WnG+/fD0vhmHt?= =?utf-8?q?efwMjVvHa5qad457mVLfKBmfd5yDvM6N5iHFeYTYhuxtPj/GmYc1WDkrN0411VrE6?= =?utf-8?q?FDlknjSIez087x3wX7vpOVJFdttKJaMXiLjDS8hsgj00lE05hdrHVGlySY1QaLBJ+?= =?utf-8?q?UesXafJY8bYwYQb/1IjOwMoZxhojiOTLBUSTl38/d5V9mu9kiTU/vWBZNCopM5oHR?= =?utf-8?q?1PqKgaOwk4IBvlkjrdkrCVYxLajdZrP3cVQiLbzIpxAEaHwHok07/TTTDBMFBA7Do?= =?utf-8?q?DkbPLUajsTW8+JAzxEuF1/lchD0G526JcmCJgSsufCv7aLN9loNmIUvOPmHObY+Z9?= =?utf-8?q?BE2fSeXbfzxpCmtQwKo6jovxvpaRuULsPDwawpe8qXaex0JRkw1ZrYLBM3Wd6QOm4?= =?utf-8?q?pijrXuodLjNxUfoL4b31l0bxUwVdweBLRjW7IjIxGdYvQd8h//Tgdhc5SOD5vH8me?= =?utf-8?q?rZYLaL+39PBuGM0aQjTTam36WyMWjafj1ALkPdUfFd30A+98kHztWCITEQ7AJ/0As?= =?utf-8?q?L+coJOel7KCnaLQ23lV7LWmVTU3FTZudtO4IoUGbQabGOVXHMAXypt0WbQht/RHDU?= =?utf-8?q?ORUCBosBtd0vTZqTmU/LkBBD0f3i+SA9kHUtfh6sY31WThEwe2DZzviYWQBr54btw?= =?utf-8?q?OBBQdwa0k7U?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d599b826-ab11-4ed4-bf1e-08dbc4ff675d 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:03.5136 (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: 6sawYa2969wMq0db4fkZUaWgadFlgdx9+gu50yiHV8RbkgjwxZOvTDFqw77B192wvyloPDh/Dph4UB8lU4DoFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=no 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:29:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778846867048742605 X-GMAIL-MSGID: 1778846867048742605 Currently, one scan_lock is associated to each vif. However, concurrent scan on vifs is explicitly prohibited by the device. Currently, scan_lock is associated with a vif but it is always locked with conf_mutex (there is a case where conf_mutex is not associated to scan_lock but scan_lock is tested on all interfaces). So concurrent scan on vifs cannot happen. So, this patch relocate scan_lock to the device and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/main.c | 2 ++ drivers/net/wireless/silabs/wfx/scan.c | 4 ++-- drivers/net/wireless/silabs/wfx/sta.c | 11 +++-------- drivers/net/wireless/silabs/wfx/wfx.h | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c index ede822d771aaf..4bf16bceb0bbc 100644 --- a/drivers/net/wireless/silabs/wfx/main.c +++ b/drivers/net/wireless/silabs/wfx/main.c @@ -246,6 +246,7 @@ static void wfx_free_common(void *data) mutex_destroy(&wdev->tx_power_loop_info_lock); mutex_destroy(&wdev->rx_stats_lock); + mutex_destroy(&wdev->scan_lock); mutex_destroy(&wdev->conf_mutex); ieee80211_free_hw(wdev->hw); } @@ -314,6 +315,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wakeup"); mutex_init(&wdev->conf_mutex); + mutex_init(&wdev->scan_lock); mutex_init(&wdev->rx_stats_lock); mutex_init(&wdev->tx_power_loop_info_lock); init_completion(&wdev->firmware_ready); diff --git a/drivers/net/wireless/silabs/wfx/scan.c b/drivers/net/wireless/silabs/wfx/scan.c index 16f619ed22e00..d6f98035f6844 100644 --- a/drivers/net/wireless/silabs/wfx/scan.c +++ b/drivers/net/wireless/silabs/wfx/scan.c @@ -95,7 +95,7 @@ void wfx_hw_scan_work(struct work_struct *work) int chan_cur, ret, err; mutex_lock(&wvif->wdev->conf_mutex); - mutex_lock(&wvif->scan_lock); + mutex_lock(&wvif->wdev->scan_lock); if (wvif->join_in_progress) { dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN"); wfx_reset(wvif); @@ -116,7 +116,7 @@ void wfx_hw_scan_work(struct work_struct *work) ret = -ETIMEDOUT; } } while (ret >= 0 && chan_cur < hw_req->req.n_channels); - mutex_unlock(&wvif->scan_lock); + mutex_unlock(&wvif->wdev->scan_lock); mutex_unlock(&wvif->wdev->conf_mutex); wfx_ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); } diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index cb03a5cf7ffa4..8533bad6caeae 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -97,7 +97,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, FIF_PROBE_REQ | FIF_PSPOLL; /* Filters are ignored during the scan. No frames are filtered. */ - if (mutex_is_locked(&wvif->scan_lock)) + if (mutex_is_locked(&wdev->scan_lock)) return; mutex_lock(&wdev->conf_mutex); @@ -621,18 +621,14 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - struct wfx_vif *wvif_it; - if (notify_cmd != STA_NOTIFY_AWAKE) return; /* Device won't be able to honor CAB if a scan is in progress on any interface. Prefer to * skip this DTIM and wait for the next one. */ - wvif_it = NULL; - while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL) - if (mutex_is_locked(&wvif_it->scan_lock)) - return; + if (mutex_is_locked(&wvif->wdev->scan_lock)) + return; if (!wfx_tx_queues_has_cab(wvif) || wvif->after_dtim_tx_allowed) dev_warn(wvif->wdev->dev, "incorrect sequence (%d CAB in queue)", @@ -730,7 +726,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) complete(&wvif->set_pm_mode_complete); INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work); - mutex_init(&wvif->scan_lock); init_completion(&wvif->scan_complete); INIT_WORK(&wvif->scan_work, wfx_hw_scan_work); diff --git a/drivers/net/wireless/silabs/wfx/wfx.h b/drivers/net/wireless/silabs/wfx/wfx.h index 13ba84b3b2c33..a41b2c35fa415 100644 --- a/drivers/net/wireless/silabs/wfx/wfx.h +++ b/drivers/net/wireless/silabs/wfx/wfx.h @@ -43,6 +43,7 @@ struct wfx_dev { struct delayed_work cooling_timeout_work; bool poll_irq; bool chip_frozen; + struct mutex scan_lock; struct mutex conf_mutex; struct wfx_hif_cmd hif_cmd; @@ -80,8 +81,6 @@ struct wfx_vif { unsigned long uapsd_mask; - /* avoid some operations in parallel with scan */ - struct mutex scan_lock; struct work_struct scan_work; struct completion scan_complete; int scan_nb_chan_done;