From patchwork Mon Aug 7 15:05:42 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: 132209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1559559vqr; Mon, 7 Aug 2023 09:19:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMQGUP77ifHZFUN04mUK2a7htxxNXnWufdrvb/vkKEGzLdLR+DztDhl5urYr3pcy5CLHXk X-Received: by 2002:a17:907:7b88:b0:99c:10b5:7650 with SMTP id ne8-20020a1709077b8800b0099c10b57650mr9627697ejc.1.1691425150563; Mon, 07 Aug 2023 09:19:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691425150; cv=pass; d=google.com; s=arc-20160816; b=Mdpeazx5Kdt6FI0PFxOLNyVQucO0qP7KwTRtky1q3km4PsglOI05hBrVHBr6dYrfKC q+AdaZZzwczZkPM0PPrnAGb1CF1nCtKrQ0xfVCzoB/RdFvzT4h3omy1VT7SBsn2HD0Ci UfzWq8tAeMVSpgL+1pxmK1zKQMQP+63yc6H8CZOJijxiFjkLgSwA9yAryn9gbWGrxU9M tIg5OmkeHrEh7EXaTeMi1DoZftsdVkDAm+YKggfN2ssXniLEbjVn7D7ipQQALOkSXJTP tOJH7+agRMOXh0LR6MzOv5tPVhzfDyS1KhxJgrcGwS+Pax6HLAtHLUbA5iHcHjtaZIK8 2Ajw== 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=ZPRftwa/5INHUuf/U0IO6DYv07+MkuBCaxGoh+MZ00E=; fh=JxyQ9cOxFJCXit3b6bV33e45OVX7DLo5Wt+gwsJ5HK0=; b=jZ5mW1Aplm+sSFlHK25p6pYehXprrvsO3X5fKNI6UWB+oaSJFPzWg5WX9XMoYkH4yG 1FTzno1xaAmWO/uTrDjiDqulHo3OhReSm6oCoqcR6+oejlnrmGJglyhQYKVqzrQBFLSH NjHKX4EuN05reOyoOQHtm2coXT2wDrAeEEC03VQaWWRzQotLahUJNKihu+NprE8nMJoO rNXGlWm++tzlHeS2qktxpBt3ydtNqn4urTxlr2rzIk3EDy9WhgJq2GzkCmkuzQv8Q74p 4NF1nq8TuEAdIj4nTcrJAnRhNjD53jZEWWotM73DQbkBRo+M5qehCGEEfdImO/hMX2gd w64g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=alK9AcXW; 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::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a170906848900b0099bc80856f1si5792038ejx.219.2023.08.07.09.18.47; Mon, 07 Aug 2023 09:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=alK9AcXW; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbjHGPGk (ORCPT + 99 others); Mon, 7 Aug 2023 11:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbjHGPGR (ORCPT ); Mon, 7 Aug 2023 11:06:17 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADBDA1701; Mon, 7 Aug 2023 08:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vy6NHgGMLQRyzVl125bxezpjl5OSwWVFl2G5C/8HICLvHaIQCDIPqtbPitUC19nSy9kxM3HbtfKYMSX1qG/LpjGSytwy+MgiaaiKoPA0FEvgeVp8yWzngTtloDloNfJ45HpqAKunfr+GGQSHkYlBnKPBJPw7eFRffZOIAefuW6po7GxeXMSuju+nawaocLMkIn11Q6RtPs2iPcOXnj+uD7OEElSAa7sG7BHKeqE/fAk2ipOMORUmJm9mJuDqL4GsJa6UASnddiw3Ym73N7fxYTfyNApbOOpphPUnpBsYJNe6l5/dtPENqxm/qvDvIbqtE99wH9m/1I5AUYnkKXuwQQ== 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=ZPRftwa/5INHUuf/U0IO6DYv07+MkuBCaxGoh+MZ00E=; b=I2ySPq75AtXbW2qYUG4G7sozx70ZIEvq2wtfCCqe55RkuHNvl6V+m3zx9B7bpsvsUieE9qi+zftXWDcDsAyqEGyGt8offvjighRiIQx/lBzZc03+7C4GKdXQUepkfb2cDkEPzLl25hWSGivQlNYgh8ECwSKUzMqARhzSLLouK53XViG4G/7FSwvc74gvYIrIbhbVXte1fSod+yTpChm1X+lbRTThdu+jpnhmuSy4jmWKiJhU/YAviQSZMLEiWQLs7NDZTDmukTO6PAR/ZZpB0XzH552yofZge6nXQ1rce7Ol2PZlt7ZG46IFX3xWPGtVsvf6bArQR3tzAOz8HsPoJg== 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=ZPRftwa/5INHUuf/U0IO6DYv07+MkuBCaxGoh+MZ00E=; b=alK9AcXWM4JWfOVcWoGfsxba6SA6KaHSgO0ESeAyzk9IA8G4zPNvkeIH5DsMfqZiLvEY8LeqB+SxTBvFXss0uLG9Wxgqdn553kequ490iap6+8sq/bnbC6ojoOJgSBqYLoox9aNg058+4xL4WxXoOiFfk6pcsQNdm7YQ5e564zU= 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 SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:11 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:11 +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 9/9] wifi: wfx: fix possible lock-up between scan and Rx filters Date: Mon, 7 Aug 2023 17:05:42 +0200 Message-Id: <20230807150542.247801-10-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 62c679e4-8df1-4146-9af0-08db9757d62b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pYE8zqrqxp3sscWQ2ZMasbkAXC4XLpfDl01/lCigHW7nElyq3H1x2PmTiGnoHNAzIwSZ7wGmXOj7Ld3mS2DloGLg9s3Im/ykWNWIVGyKrhV3LIkrwGLMvNgtRC92Rg8iq4k8NB4cEc/XzsFzkvybz/4yapzOdI0DgnyX9koiAAtBPq8YbkGAa7L0YmM21PAFmawfBvOx+Wm/KQEsE8QV9F/COcIlruoeVDXMnok3OCE7Uj5YYeElokOxYnuc5JoYrsWB6q9M+ZVfkV8p1r/MuCGBgRw5zA3k1WM9sjd+KqTdz0LZH1JB2tRYFA5cPTg9hWazwbakP+Z6mw6iooXGmIul4JhzjkkzZFJS1CZwCBykfrqswb0DNr72Utv+uSmHVmzpCaM/UjXEYYFTiaS/yA+FrT409UaJiPU75mhnDNVGGoFWOMkQjgzYIxlrG9K+f6hB5/OEZl4lwjHV07RXACVV78JNGdpdfcL1BCxs+rtPAaPUToFJOpGp8zirreH5VcRSKE/pXxx7cXdxENQMpP+0AXMVEcm38zrSUHfIz1KA6ECQvI+pZ3303mMreKrnUnE7IuEoMisIXQrBvXOAL8dDZw+WhmGWg19bnfPeKjr1dhMXfPW+IjrbyJU3GYi7 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:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?x4zFoaH4sGglWJ+pKlDO5cdEEHix?= =?utf-8?q?g9TE1MV+qjN3P8PPegmCucBkOVA6xd/Kp2AI2czI2CShvoCEUjZvrajgYQwu9Ed81?= =?utf-8?q?SHiAXv8fGLJd6YhZ7XXA+kYc923QMxLLv1ugzSo4gdpjieTYVqji7rnmrcirAvh8X?= =?utf-8?q?DlG/HXFBLN3RJ0NEAZjowQx1dQ2XyWPo9glHmVIl0XX+Bx4FSGs1grOIPuQddPGMl?= =?utf-8?q?CfAnFwKLJRdxCjcQETgVrcDcJAMpm3NEdUHT10ZDL+p+FFVzFTpy8xbns2kMiX6xm?= =?utf-8?q?Nk2le190c2yzYyys+hMXh/QeJob2NzxzEJoqYuTYTKZGNEzOGxIYu0vJoM3TEUtlw?= =?utf-8?q?sg5fozBNy2oTEblrEES4+5gc/U+lWPp5xDpYUK+HnZNh4lk5fNPnMCaztm2ofv+4m?= =?utf-8?q?L7afD16wyjpfuxomfUwHiCfSxw26NtE+cqzLx4oI5rw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DrwQej?= =?utf-8?q?QSkVLEZV45A7T72wFQT9MaGIkxuzScZjXsk83pwvCEzpZriZLLRzdrOZBAdWXYM93?= =?utf-8?q?36I/+8TmlJz/lP+auGIRPkY9Zo8ABnwW1xgXJC/Pni99Vk2cWR/9Qqx1kEWVaVh6m?= =?utf-8?q?H1hoNFRwm+HZbxVwgnoecoRj7n+z+BLPsQE+BFJZbuoZY9eJjt6ECV/BKUpzm9mwx?= =?utf-8?q?k4baUU5BjC5j?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62c679e4-8df1-4146-9af0-08db9757d62b X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:11.5201 (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: R8q+QPp6zj6S25Ii+K42rh19ALr1HObFvvzYY7Hs1TqGhom/omlrp7ncLBGpqYnfNHXqAcsTW/pz4jpAR1Tf+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_BLOCKED,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773587818703099415 X-GMAIL-MSGID: 1773587818703099415 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 also 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 496b93de3ee58..1b6c158457b42 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -96,8 +96,11 @@ 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(&wdev->scan_lock)) + return; + mutex_lock(&wdev->conf_mutex); - mutex_lock(&wdev->scan_lock); while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and * beacons from other BSS @@ -126,7 +129,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, filter_prbreq = true; wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq); } - mutex_unlock(&wdev->scan_lock); mutex_unlock(&wdev->conf_mutex); }