From patchwork Mon Sep 13 08:30:19 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: 510323 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 31C87C433EF for ; Mon, 13 Sep 2021 08:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15F4F60EE9 for ; Mon, 13 Sep 2021 08:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238321AbhIMIdo (ORCPT ); Mon, 13 Sep 2021 04:33:44 -0400 Received: from mail-dm6nam12on2048.outbound.protection.outlook.com ([40.107.243.48]:60019 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238239AbhIMIdN (ORCPT ); Mon, 13 Sep 2021 04:33:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1sxZ68h92CAs/G4ibADC/jmmbP7enwjpALaJ3Ye05m/lGlboS8IEexZAbA9JkAwjXsfvQ9Ri7YMRE67eEwqUquvgk4KmEuNy9SMmCEkIGT9jL8Dm0ts26Q/oXjYVKFK3Y4VDpNcpFW+S6tGLzgwVcXo2cM4L6d8CdDHMZ6JfuaEWyPHJ5m1uA7zxL1ZwklnaXPC/rOdHQnDAifo9l0vWdcoBV2HVX/KDyQiC67pctXmNA0VV2YEUXvQse6kw/fmjnSYRNgK56WCqVDaqicvkpoQkgtutP5Lfk1EndzpOwYegKocezayYk/aqV9zIxWhOQto8LpYgOgshXVzGf0N4A== 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=AGTXtyow4mo9ENf2vvCwWPwv8CRkwvmsGu+rGvufi0ZUPZpmJs7WfEpFmTtfLKuc13oI1E7ZxbOm+gxytXOjfRR0//Lmj3/IR6tIE61GuLUbLEiHIpgTwC+4TXfBsFGdvSTXqbw2rlGvDeqdatkc9QXl8ezPcOFo1qq9gSDSBQKKtSq84h5jThjOw7x9TfqsIBA4MhAi0FLy4Bp0dRn4PUjbfVzTcJ5CoKcqMWFxUQliDQEnkb5PzjHDoTqVUSPi/u/jCA7A7NSdLSLhsepbhkZKb/TDConZt639vt8dRsEajCsRA6BWrbVXo2dzJUIPTHleCDd+h+05gvbcwje7Ig== 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=QqTxgbsLDZMoLsjir0E763d47zN/GqfuXSJ3+d1W9yjUO45PEVlDT6VY6F2KQsChIZPJGt2Q7Js5wiw8PvHCO7z7zvMXCpn3+2Spuvq3TZcTTdXAXZ8Sv+5DXJ1qM0N5gnVmbdmwERIzRTlaR2jVqKsrTNHWY0RLAkivX7WiKl4= 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 (52.135.97.18) by SN6PR11MB3263.namprd11.prod.outlook.com (52.135.109.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Mon, 13 Sep 2021 08:31: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; Mon, 13 Sep 2021 08:31: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 v2 07/33] staging: wfx: fix atomic accesses in wfx_tx_queue_empty() Date: Mon, 13 Sep 2021 10:30:19 +0200 Message-Id: <20210913083045.1881321-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913083045.1881321-1-Jerome.Pouiller@silabs.com> References: <20210913083045.1881321-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PAZP264CA0067.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1fd::10) 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 PAZP264CA0067.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1fd::10) 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 08:31:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ae7e1df-960e-44f7-713d-08d97690daa0 X-MS-TrafficTypeDiagnostic: SN6PR11MB3263: 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: suHJp/PtkfI7et1wbWLy2wyMWGbkngKLdaima1MCo6FGmEKqy0pjf6bDUz/p4XNSvt30JosL/oaHCZf8xkXVgg+3TLy/4J9kc6KBFqhQ+W2jGF2E10NrDXh6D4gktfvGoebYkl80Q0p4KU3GEhrV3YyP8wXwCLek65rAyP/i97SXfFNK0/hFZr9mHpc8I1+GQ1Ifc8jQprCicXgQ1aX9peHtzSKGEgPjMQ+9W6GJzs27wAAoVUkJXxU+kUDFTryHKJiJDh1+tYGcOoXhyfJYSgUjdFCy+P4TLfunXVn419P4I3v7CtnBv6r4KnjinlwUJHPlW/1g1bNpK+jh0ku9zc3kIBCewcEAFiIzE0SLG+xa6uciqDo7NLmrCAIpLRQJ2a43r6AmaVUPa0p027emRfclp1R0bxBkFtACUsTqZtZ7MhVx1860T8ZsQyW6D/1B5O6Shc+OG4u8rZe6i9XRwFFaFi8uXyIYK5za8urrlBQvZXBQF5IOipL554fOxNBiMKqbRY8ZZInMl+C8+3bC6sEmptgvJq9CyDRTwSvS+apso67HUmfWWL+fLGoRyvjMnp8vb6TVNkEdxGUmCtV4xbA+oKmohi9KTqoymxXDSrkjtmDk28fxdNqJTVPe960IvZBmEf9RoWcegUzn4q5OS5G7jdkLh4GDBcvusgienivDrjEkh6JU7439wc+siVYW 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)(83380400001)(66574015)(107886003)(956004)(2616005)(5660300002)(54906003)(38350700002)(4326008)(316002)(38100700002)(66946007)(26005)(66476007)(66556008)(186003)(8676002)(36756003)(8936002)(86362001)(4744005)(508600001)(52116002)(7696005)(6486002)(1076003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ny0hBu9rYw2nioaZ1CXwRFu3N?= =?utf-8?q?Jy1eS1iEGsywXUf7h/PzPN3u7CAa3QNP1ISwt4Vkke/sCTMaT+MYYdqw?= =?utf-8?q?g5vI/OujGhofsVGG6KZC8RNlZvXBGgAfEDpvgVAKr3YYHL69UeQp7JSG?= =?utf-8?q?4dm3IHE1NToXqGugFVol3P1g9phFwGRg1L66S+9ieGCu//Q1Xw5tjgaX?= =?utf-8?q?EFT2a/ecbfSk4GVsTRaL42qipQgtZjTaxf7V8qaK/EAm+eq82SWaxae8?= =?utf-8?q?N5a9ZGepltHkZegSRGauWBaR+KvNjs/EWKHZ6fjJ7B0Qi2M1tbBHMZ+x?= =?utf-8?q?38GMny8/XX9HCEGl8iFZI1GlYb3TRqBy6F/GzZGbFKlgDwHU1FYKajEc?= =?utf-8?q?p4DrAk65Fg1TH5uH9MRz+frr/1xM22w2ekUXJiqU85+zDXHxEuXV+eI3?= =?utf-8?q?Bh47ovUyjQLI3c5TIFBrWLv6cVylOTCHw0l8a2+K7FwuIkGprdALfwiZ?= =?utf-8?q?F6TnOUeK2hAK5vS73qHoo0itzdmA2iVB3G6SYgGAjexOSHPaPxozCcAY?= =?utf-8?q?p4aoJPCHgJGOXSkXj+GvtRQDXZUNtAt/V1NcC+6XpmgwehpzTgTYVmLA?= =?utf-8?q?xK3htYwgPtpO8chjTYS2I95qICnxEuLnkNTFMUd/i4iS0zZ5+bpHWsb8?= =?utf-8?q?rYhgIWrlGHrAcHx/Yvdzeh928Mqb9o+YQQoJ/q6cngxnG9/qpyx25I7S?= =?utf-8?q?tgwyQCjeeHnm9hY7XmvrG+Dua/TiI3IFXIU77g9MmVEq1jdcjPdhJ1ms?= =?utf-8?q?FM7uvahcByG2NlMrZDzDBCyX4GrVp9M1DvLaQ3cj9OSq9MWjs7pSMPnZ?= =?utf-8?q?6p8RtNF5b+WN364b4vgh1pfUijqfVz5lNxtzZ7Wb1fhiLRXw36RX9wMQ?= =?utf-8?q?dgfObUMOD5rJz/lxVMq9hIn1aCUTaiN9r5K6fGgPEFlvjD931lfSSg6B?= =?utf-8?q?aBqbjUVNcl9Fd/HAubI+WuLnPSD3iMMYanKKqkmySM96qCPnb2fAVQgp?= =?utf-8?q?avRli/IjlSiJ7bFZD4EvSLfdBWPfCKY396LmbSxmH57aJbSMHl3MGEBz?= =?utf-8?q?F63o2p+KYcpy5m9wH3ZacugVWeB5t54gzgwSc609H/KDzlC2O6Ksi0m4?= =?utf-8?q?rdcgl7yHa4Ze2yBYNYeM6RqAXIzkTtVokxfqOskVHIFeucHZMq5/v3wy?= =?utf-8?q?2o87MrMhZzYOfDh3pYPkFpJ9qQR5GeeJHpp8WwEgQW+VNAOO8aGQ73dO?= =?utf-8?q?SqWHXYa37twmMlKmSlED4XsK7yVRcVrifjWpyIOVaIuWFDhSe7Dgoqv9?= =?utf-8?q?45k1czirmCqpCf20az3I2ZGnugkICqRiwibDYQKFeXcilgn2MT3LncYw?= =?utf-8?q?17ySfQhRaSaEOFqqekumpSNUMArV4VU?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ae7e1df-960e-44f7-713d-08d97690daa0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 08:31:16.7570 (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: o3HFfRCAKjHstM4vp92X8EHmBwwfo3+XN9cYzfo4d6EMMW3IR5WhqQpHW7AzcpMDlES/kuiURyWIXwzIffG7/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3263 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,