From patchwork Mon Sep 13 13:01:38 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: 511627 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, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 7E906C433FE for ; Mon, 13 Sep 2021 13:05:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 673CB6101B for ; Mon, 13 Sep 2021 13:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238132AbhIMNGO (ORCPT ); Mon, 13 Sep 2021 09:06:14 -0400 Received: from mail-mw2nam12on2088.outbound.protection.outlook.com ([40.107.244.88]:10209 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239037AbhIMND4 (ORCPT ); Mon, 13 Sep 2021 09:03:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MW/ndlIjtDKpEoNUEvvqcsVO5u17vRH7uft8BcLXz175YY9ZV3M05CCnGsxhAh+Ln/ml94quFCQWZefnH+H353crUNWHdOPaJ0T8ZeT2k5/sVyQW8m9wKb0Tv4dbzQYftE6NzatdOdCZ6EWestvu7wsYLk20MLFHOZm2k9tSe5HfmpuCVCs432vmxJgPQt7K7JSFLdygh4nRh1TyN65m939Gr1H8KIumM5Rmv2HXEzlo7iSUCULrsxXf8WnqCPzwWBr82O0Wh2TIWiecRy1YZLbRzWY8n1eKH5zyMs9xHJB/TpJtkV9n+WZk/CJ9vG3XDh7mrkaiwaNsDB9t9ae/LA== 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=VOCYnJe8/MO2WGmVSqGLE0Y4+W48wJTciVpbYRO9riPsELg9eYOzhZOEyk7vCt4wL3efBDpT4Ka8IbneKKAaRgLJQMryPLHaneoDCt/ciOpwUkH6uKeyi8DrUfrTV5U/qObftU+96mKZle3HiYS/IZ6oND05tV3MWdcSWk0K9l+zcrbaxaDYgQiD3N6BgGXY1b6YwusUkvs6qpb9ng4c9WkRVNyHcafs+/D0eqQYv0m7gqBhr7d6ZUPIBhtUkkLj5Dg5JMTSBs9dVgk0K8xvG/1xuqZKLVwYXkR2GgeGFGMnoPXMgVKh2zrZFToR+GGVvIe3M+0I2pdAUa8B71ckqQ== 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=LA3tzN7pjwSCxr1orVpxyRo1bKx1c2zoEytGrcYbY5qmjJG29XPc0XnXPZILV2PaBuQRl5g8cRJ+WGApMvz6z/WwGBoZo4AsYZdc3W2VdW9J+zqesz4l6CqdH9nqkiPCEj6u2//DGxSz6hShZt068o6H1Kw0wgLt1EK7CD5Kvd4= 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 SA2PR11MB4860.namprd11.prod.outlook.com (2603:10b6:806:11b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 13:02:30 +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; Mon, 13 Sep 2021 13:02:30 +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 v3 07/32] staging: wfx: fix atomic accesses in wfx_tx_queue_empty() Date: Mon, 13 Sep 2021 15:01:38 +0200 Message-Id: <20210913130203.1903622-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> References: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (37.71.187.125) by PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 13:02:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 276b04a5-0473-4858-14e3-08d976b6be30 X-MS-TrafficTypeDiagnostic: SA2PR11MB4860: 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: 5lKbEAKEdrwmpOd5gsk3k2cvcqQwwoIVtAp4fto4PaDlEieG9su9q0lhfgR9gQDA10RseSL8+O4yT/wT2tNDw2h6S72ypJtT3jUQ2YmPVHPDL/6MLNrgGzO6WUlAXMU383vGLrEOWz6Nt3ybJespeRiSzi+z+V0OUlM36DrYcTst/3FvscWFoC2Bwwbp/ejgts5zoYkua1hf+ICZ/D2UVaSaTPBEEZSBwtscr+yN0KHokypmR9DQkpCPzYoFfKwnLZz1Wgc8Agw0/dfG3xa00wHfaZ70RDDBYqbiLbGswv4YYyHhvaqytCt76gxO2mne4bkGIfPBbPHkzMY6FINfDia346zGnQB5I1N9geNLv/E4dKwvBi8PXr6JbBEWPukQxDuJ9NOaJxzgDzgl8HIg5tZvdXCwcDsMaG4MlNBb/jmN++GkMPe2CzciHcFPfdiPngb6BBI+K9vhXjRfOT132b0Ji1tGIeAYk5o1vf0YuNzqcQ0KjMj+lzyfCD0a0lMWvjx8iwl/Gseb0uQKX+HYIAtewxZhvNv27YqT8Wrc7URXhD8Ps0AdN8PtsSBawcG7KCzOxxWf4EGBVUX90IvsnGH6724KXQV2Ev9gJMZUZm6Q8IVazo1tlAnarFwiamxoD/A/8rNZhOEqXQebfn/n3AkkWTFbNALUpr2/dxeLlxDDl0mWNwOUM9uK4cxHr7MIdSPSgQjOrD4oet5HW8/xLQ== 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:(366004)(956004)(66574015)(6666004)(4744005)(66946007)(2616005)(26005)(36756003)(38100700002)(38350700002)(316002)(4326008)(107886003)(7696005)(54906003)(5660300002)(52116002)(66556008)(1076003)(66476007)(6486002)(508600001)(8936002)(83380400001)(86362001)(2906002)(8676002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?m1cDrHsCqZMPoJe69MZ+1e0q8?= =?utf-8?q?0YacEpUsREFyL2rJ7vqShXPraqVvgiyeR2MenHAtQvjdbl33cygfNyaT?= =?utf-8?q?OTNeMHFq+t7e0snQ9pZf53tBxZqevYbCa0kZGoUyAPdhUpfHBjglJeVe?= =?utf-8?q?JAnzj8DOXv9RcqLoN+eQml4K5E6pwLTfNIGYDStmks2ClM/U4mlDIlmb?= =?utf-8?q?0dSE9SLs15i5WgwBmg0DK/PWRV1FMGO8qFeYk3IrI7F7Nly+fDkvEXiC?= =?utf-8?q?VfROwW/5J0aBRiXwa9ni/tpKpj/1q0hFZ6LGuD6DClz26fGyrj5kVfmg?= =?utf-8?q?r6aLnyr06tHG+G46Jt/bbJ+FIv4bOznZdnArNbZbq7YCA4jLjNxOsftb?= =?utf-8?q?NScKvTtzzOjSlIvI8gEnzA0nHZpGXAiyRYKEMhTTWF0SEFqrFiD12CrU?= =?utf-8?q?TU73a42h2exuyLGEDWQb2s4c22UEJtmPZhdrs1RZ2S5e9LxTsxv8yTv/?= =?utf-8?q?70YiHN7v7SwPF+dZG76CWcwim1RvT3Sm0648lzBV/55mvru1ORYi5Tao?= =?utf-8?q?jvP24L6xgYs10RP0VnUTLCtVFoz8HfaEhMmKUWTyAsCAns6geRWR3AZN?= =?utf-8?q?1rJNU/LiaCsXKm9egs5Wr92REX5znlvD/DM3+5dtxjFXRdvYFo7PAW/q?= =?utf-8?q?wj0sq1c4ESJBk5qE+wpcxkgnhXojyVNyy1SE1V5+gF3dio9f2o73TAn8?= =?utf-8?q?negwDIzi0rLC3++15rez+78uoC7pc1ai9GN4wZjn0UG9wwGIQ+0/APG/?= =?utf-8?q?kiAnqoREXUrC3TJ3leTEl5oiBUnIuPrQIyAzrNsC2VHhTzsZPaB0KHCh?= =?utf-8?q?qbLtDaSNS0iZUTmPTtTQOIt972IZ0SEDqsJSBroC1evJ6id+B1kzTGkg?= =?utf-8?q?whUHjJICMMwaK4aT/qTVgcOzXtAMzqHlGHKoOnMzSkKYi2+qtYnqBpva?= =?utf-8?q?RFOE18MMe0AHU0IPrWlz8fMKiwHeFSgJxy5AtLhfF5bw5wJaU1W4cgiA?= =?utf-8?q?SyoBuwF+lfA8n4PNB70S9ogQrV+pG7oKyYqBjf0+hAaiX0lgVZa+a+Lz?= =?utf-8?q?FfQApZfpjI9/l3fgwNg7pbTLkWZbo0EHSur58E6UDt9JMYDJpq/M10gp?= =?utf-8?q?wHoz13tIPxCxp9ouXlw5qODbgGlfovGHFDWKldvJo4UUJYoLcEUtgK9Z?= =?utf-8?q?PvldkpaIQdhnX3/MY1wRZCVBrrCF2ijlCLNfYH73RwoGW/UL8moZbVkG?= =?utf-8?q?6faptogCAWyAiMXoDMQbVY3fto5hD8UHfQJCIHyZsnLJd0DaVLDdz4c8?= =?utf-8?q?fGT8JHhTIKXLNI2GZ/dfl39u0tXocti2e8ekfMyCtwdtFvdFIqJSes2h?= =?utf-8?q?7s4yXLCcWhi3mancQakYUvHrA57t3fn?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 276b04a5-0473-4858-14e3-08d976b6be30 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:02:29.9571 (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: j+zh0bJpb62siKqT2swhbwlnNhtDFz5n9p6bSMuQOsqCnvfNrdvr9uJGYpaFxpWHSf7GtA7Pd7YO0R8uAQg5cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4860 Precedence: bulk List-ID: X-Mailing-List: netdev@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,