From patchwork Fri Sep 10 16:04:40 2021 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: 12485407 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66E32C433EF for ; Fri, 10 Sep 2021 16:06:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 400B9610A3 for ; Fri, 10 Sep 2021 16:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbhIJQIF (ORCPT ); Fri, 10 Sep 2021 12:08:05 -0400 Received: from mail-mw2nam10on2082.outbound.protection.outlook.com ([40.107.94.82]:58752 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229702AbhIJQHJ (ORCPT ); Fri, 10 Sep 2021 12:07:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R21C4FFyUrRM7F7LuwhZcmhylN/6QrITi/bQ0E/BPU/uxRe/TR3r46WAShq5EzdoOjp9ZV66KCQW1n2/WkqaHZ3UscbDJe52JZwYe6+QjqDX6DUpWdJQPnN+K/G/6NpazWkVDg0DXpBCyK7cOWlz34fiwZwbE4LWjCb4sCoQd8n5WmEPgUL5Lt8zTGnDSwjCaM+GQXVqQzfDyKMGwO+OwGJ22gLHtzawUa0ouMw92BNCbjULSVdin351Sh0mYEQK08JoZTUlDjiQVMGY+rfUMasqZTC1g2cRKQ78/7yBh2X5s/f58ppdtICC/NB/9oz65gAiWb3qEVSX2/OkjiQVdQ== 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; bh=6X5C8iiyie5c+H0xNzgV2k5OxRmd70FdYQimieF/nBc=; b=eOqgOiaWj7gmkxCBoSEh7HpDRHls75QKXTI3UZtjjkNdjzbfGsJxUZlB6LmzG7SDUrB5CpG3FjgRqtFelasgVWxX6SpsRBoHn2SXbjA1f/rKgaYlvAsqC0jpylIwdh7eUfJW14hi6rTb8Lvzl3S4/sVkLhgmdF8Op9iC5tAweZceDPe31v5O/WPBro+/JrzbkNbXzVf7RJbnvYrLpKv1IKUWCnBoUN5f85/XVaW/e5IJ/EtbUyZ6fS9C9jjQDORuHjJ+7EIJfbwbenYeto9EDSRzK++aLTVMICFWL5GSFbN92ToAEqqjyTsbsGPvF+1hNVZ+olXm28I+r2VkQIE8oA== 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=6X5C8iiyie5c+H0xNzgV2k5OxRmd70FdYQimieF/nBc=; b=oaxGJrFr5Cf0H73XKt6gLirhRJ5D+ICgTyZP8KJGA/Bz5BA9c4liTKWd/fak49aRa0Zb1rH6/g8SDEaQ4yXSNyYb4UGAHN609JTM896tqJvN9WcqSv7jreWgiqSJGikNnsG8Qaocu7oaPpmQ3UJpSR43XUni0pWCwtvkU6lzcFk= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none;driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB3118.namprd11.prod.outlook.com (2603:10b6:805:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Fri, 10 Sep 2021 16:05:46 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Fri, 10 Sep 2021 16:05:46 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 07/31] staging: wfx: fix atomic accesses in wfx_tx_queue_empty() Date: Fri, 10 Sep 2021 18:04:40 +0200 Message-Id: <20210910160504.1794332-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> References: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (2a01:e34:ecb5:66a0:9876:e1d7:65be:d294) by SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Fri, 10 Sep 2021 16:05:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4869edad-414c-44b2-232e-08d97474d960 X-MS-TrafficTypeDiagnostic: SN6PR11MB3118: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DpAl3jaT6JaVsb4Ikaz76qFCRn2NvFzAQNXspZjW34l6WVsN+zGZco1MI9NsZu0oPpyHd8xay8I5k2N/sODq87eEc0zRk86wtAM2a2Yg+b8ZOzEiy0ecJXkYl56sgBRagQxJGX7Q3mTtoTO5DvYsSjSzalrUa/a/qQdGxkWItYKOZlQLLcNvhjGAsBpcj9alvIADfMkrRS4vTO+vfLnHirFoob2aq8/JJmGcI+12k9eKnHk1/ZZkJtxJQv9Da7nEy+8d4+/AWGEoE2FnhkBcQ0a2Pu31CkpUs9XKXcAlbeEFDrMS1eoEFxM1KZd5revWLiR78X3V4jn4kXlY/7cY5CdSpR6ZWsZvC/VFGljCFZ9Ji9VOZu286BTP/TTfjVVtS7Jal/FakIHlmQ7eHBM6Yy013k3/1XXEpUks9powoD592SVdOEyFrqM7RzhJt+F4ielKGWhvt52Lv5nwd2iGntH7C5e/tICYdnZ9B8bz4r8XS8musXCAG80dxBhbJvv/LhAjXKLYWwGrDSRufiOB9T/kEcJs5l9HFnSixUAicfpsS0vCFOnYc6uNJzx3/gS/qb2cxVUW3FplelorP7043PrqncJh2sxW1E/snNOR6r3TPDCbL+QKYTMuw2cVOmX+nstRM8Zwo6iKCxuCWl3UaQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2718.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(366004)(376002)(346002)(39850400004)(396003)(4326008)(66476007)(107886003)(36756003)(186003)(316002)(6486002)(66556008)(8676002)(6666004)(86362001)(2906002)(54906003)(38100700002)(83380400001)(8936002)(66574015)(5660300002)(66946007)(4744005)(1076003)(2616005)(52116002)(7696005)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Mtov+hg56mHAk+ET5frwlfaJRj9D?= =?utf-8?q?+SwrfEYaDVJ/NwuEzpXpIBQTNfbJcZpFsLFFixbrF9r2Ui0LX/yVy1C8suYeLXKwG?= =?utf-8?q?xldE0og6vR18dp9qjF+BF8F4Du8/M4bMy6rg/dGuIxSj35UlSy6LE+eZMU2CoUesk?= =?utf-8?q?PluoYy9kQzCHhESpqidM09ZNF62WPetA/CcjemKOWOPx0wQWefFacY6xZdB0LVoQ+?= =?utf-8?q?UAt6Y7NbuaQ5bMUJFSv9W4/r0h0qjbD9YqrjMMTgdzPUodddhTJVRZWobn3RAGKn6?= =?utf-8?q?LFkZt011xAkEoFOsRV0zrBXcQLsjKXSAKqzcySaXqOv6yHUbUlLhvV6duLeZQzCHe?= =?utf-8?q?1kvayG6KR9TD5x8/cCvKJMq/RLVt4zDEs6WQCu5dTnhD7ZT93WCImQ2bGqO+GhqT3?= =?utf-8?q?wmqtQNvyolFAL/rV2jBa1WR4j9kz4a+5t22QBtJBipMuNGVsxBs4eAQSeskdDa6Na?= =?utf-8?q?P3Vxmd77m/gsWWdAaSl+Xb5zjX7eZkjGYwBDFBkO7xh/QICePCGoi+ZjANyrkLiHu?= =?utf-8?q?xtExtJpiu7FYauP2YiGsqgcpnQeA8AESsvhij+35u9EOpBe9wxVxbXJDo2w9ReE83?= =?utf-8?q?fqNL0DASPDZt0zpg7NQoIKxDrw3ivGtuJsFBaLXrirqlmpNTo+vfD8gIq8fhSWNFr?= =?utf-8?q?uy032GCKK1hj9dEe9n4+vYfZbQyuPlYFsk42QZi3kPQa+8TeGXkTMYlSkJOgYY2rW?= =?utf-8?q?tF2//LC5k3cIBe8vTXnx9mUYXZTjj4rMd/Vtb1QSjqeVNCj0eJH9A7mRV3TfA6nh0?= =?utf-8?q?5knkYLMybvGTAGLoM6Stvi9Blu8ImM746MVihV+tpgfjEtSUxTEUJO1P0apLqMkrs?= =?utf-8?q?LtydFXV1WhZ8KMd23IRgqPmKf3qAwFuLByU6q2NjrjGbl5I8DO2uyUoYzD6EXRpP4?= =?utf-8?q?MRtyClKdCOyarVnFh2vUIRw74ESsuYbH5NnM84fowJQu+yDjyue2Zwd8SYUnZbk9q?= =?utf-8?q?pw8IkTPG3D4YqQshDfct8nQwSzVr8j8svitLcij/pPOteUzoi/t2spK8zxviPwmqx?= =?utf-8?q?ixcSUmY8gINiuJy34HZQs2CHzHlt3YJDEgOZDL+5MY0YBEN27OKr5D2nVScaFsEGg?= =?utf-8?q?gl1rx4249Lvep3I0EJ9oAs0Fu39saqF0zyMNVohGw4XSN8rvY+PupGhjj9G2jHQvR?= =?utf-8?q?oOe2GKuosdZnk77pJvmYl5iXVHuNt5SuUYdDbi+SQGMEgzLY81Zwb/b69KZG7HLjD?= =?utf-8?q?LZwN9DQAl1V8sAuSR2DL0kqttl1cRaatQ1grB9oCe6zabTzvKqTLbAoUqu7eyuFdb?= =?utf-8?q?xGJo92/Z7QTjdI1T4d/jq7Z0hYpSDgyCNJFYsF0qc2aawlw0jAybdol5mqKpQEO43?= =?utf-8?q?MhPPz1IHx5i+HbF?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4869edad-414c-44b2-232e-08d97474d960 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 16:05:46.4109 (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: l/MeefDJBVoGTz/+KK9//duYOmUbPf9hI42bPpYynOHluLOcWAm6qlUVHfFPX04w3tkNBjmqhkVzR9sdw7IKOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3118 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Checking if a skb_queue is empty is not an atomic operation. We should take some precautions to do it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 31c37f69c295..fa272c120f1c 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -86,7 +86,8 @@ void wfx_tx_queues_check_empty(struct wfx_vif *wvif) bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue) { - return skb_queue_empty(&queue->normal) && skb_queue_empty(&queue->cab); + return skb_queue_empty_lockless(&queue->normal) && + skb_queue_empty_lockless(&queue->cab); } static void __wfx_tx_queue_drop(struct wfx_vif *wvif,