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: 12488185 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,URIBL_BLOCKED, 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 C4269C433F5 for ; Mon, 13 Sep 2021 08:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABB0660F6C for ; Mon, 13 Sep 2021 08:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238253AbhIMIdn (ORCPT ); Mon, 13 Sep 2021 04:33:43 -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?ny0hBu9rYw2nioaZ1CXwRFu3NJy1?= =?utf-8?q?eS1iEGsywXUf7h/PzPN3u7CAa3QNP1ISwt4Vkke/sCTMaT+MYYdqwg5vI/OujGhof?= =?utf-8?q?sVGG6KZC8RNlZvXBGgAfEDpvgVAKr3YYHL69UeQp7JSG4dm3IHE1NToXqGugFVol3?= =?utf-8?q?P1g9phFwGRg1L66S+9ieGCu//Q1Xw5tjgaXEFT2a/ecbfSk4GVsTRaL42qipQgtZj?= =?utf-8?q?Taxf7V8qaK/EAm+eq82SWaxae8N5a9ZGepltHkZegSRGauWBaR+KvNjs/EWKHZ6fj?= =?utf-8?q?J7B0Qi2M1tbBHMZ+x38GMny8/XX9HCEGl8iFZI1GlYb3TRqBy6F/GzZGbFKlgDwHU?= =?utf-8?q?1FYKajEcp4DrAk65Fg1TH5uH9MRz+frr/1xM22w2ekUXJiqU85+zDXHxEuXV+eI3B?= =?utf-8?q?h47ovUyjQLI3c5TIFBrWLv6cVylOTCHw0l8a2+K7FwuIkGprdALfwiZF6TnOUeK2h?= =?utf-8?q?AK5vS73qHoo0itzdmA2iVB3G6SYgGAjexOSHPaPxozCcAYp4aoJPCHgJGOXSkXj+G?= =?utf-8?q?vtRQDXZUNtAt/V1NcC+6XpmgwehpzTgTYVmLAxK3htYwgPtpO8chjTYS2I95qICnx?= =?utf-8?q?EuLnkNTFMUd/i4iS0zZ5+bpHWsb8rYhgIWrlGHrAcHx/Yvdzeh928Mqb9o+YQQoJ/?= =?utf-8?q?q6cngxnG9/qpyx25I7StgwyQCjeeHnm9hY7XmvrG+Dua/TiI3IFXIU77g9MmVEq1j?= =?utf-8?q?dcjPdhJ1msFM7uvahcByG2NlMrZDzDBCyX4GrVp9M1DvLaQ3cj9OSq9MWjs7pSMPn?= =?utf-8?q?Z6p8RtNF5b+WN364b4vgh1pfUijqfVz5lNxtzZ7Wb1fhiLRXw36RX9wMQdgfObUMO?= =?utf-8?q?D5rJz/lxVMq9hIn1aCUTaiN9r5K6fGgPEFlvjD931lfSSg6BaBqbjUVNcl9Fd/HAu?= =?utf-8?q?bI+WuLnPSD3iMMYanKKqkmySM96qCPnb2fAVQgpavRli/IjlSiJ7bFZD4EvSLfdBW?= =?utf-8?q?PfCKY396LmbSxmH57aJbSMHl3MGEBzF63o2p+KYcpy5m9wH3ZacugVWeB5t54gzgw?= =?utf-8?q?Sc609H/KDzlC2O6Ksi0m4rdcgl7yHa4Ze2yBYNYeM6RqAXIzkTtVokxfqOskVHIFe?= =?utf-8?q?ucHZMq5/v3wy2o87MrMhZzYOfDh3pYPkFpJ9qQR5GeeJHpp8WwEgQW+VNAOO8aGQ7?= =?utf-8?q?3dOSqWHXYa37twmMlKmSlED4XsK7yVRcVrifjWpyIOVaIuWFDhSe7Dgoqv945k1cz?= =?utf-8?q?irmCqpCf20az3I2ZGnugkICqRiwibDYQKFeXcilgn2MT3LncYw17ySfQhRaSaEOFq?= =?utf-8?q?qekumpSNUMArV4VU?= 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: 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,