From patchwork Wed Apr 1 11:03:34 2020 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: 216147 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 A784CC2D0F4 for ; Wed, 1 Apr 2020 11:04:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F0B82078B for ; Wed, 1 Apr 2020 11:04:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Qk9w0KfN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732243AbgDALEl (ORCPT ); Wed, 1 Apr 2020 07:04:41 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEk (ORCPT ); Wed, 1 Apr 2020 07:04:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVNBIsIgCpFXJvz39yXlQFDEOwgCdWYMUYaEPzP2He08nig8W5cqN3Tfmhdz/GgrPTTwB8Pv/RiDnfqgHjNgXf+FdfRBcpv3N2hQYJJQq/nSJ+4v/0T5MsV5/LL+zz+9YCgrsKonCEgRuatcpOIxgAqP075AGJBkuAcBJoFmbOjkxTwRi5/ZlTS0wJEvrRF+rmIzk2mYEZ+ZskA9MpAbkBK0Ie8/IOKvBT0z+hRhagwamWXBciOEF58ijKmsMuufW/lxb63bDtP9qVjgw7Qa+pzevIxOieyoniH5rwZxrUo1gXU5r7cTN/mgX18mMOptmq4o5nIo+ljleJfWMUuX0A== 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-SenderADCheck; bh=XKWHCiXwAVePoLiZHsmPvjQy5vpTGJ11DHBgMJItd0c=; b=XzjLdNefl9o5Y+ZaINRsMd9gEe1JszsuyY5KED7uKkQzMdhNRBAcNR9eKVl4A1ZOKhoTHZK3XcuCdpBDLWyd/LbZ03yMNSbBpuYJWj1e+SNX/n3cBCbS506Vh4Sajo16IhA+hhU6MqtlU7IfiP+5FZOAPBn15FF4AQCDOToQYQ1D6k+oyQgqdJSDHP0XIqpXKX/GaNwYJvvDQal3Sp/we20hNvD7LdvnldDgYRp9Qoac80OuWPUPhUHeFmy5bpW5NBHA5YoovQHaANnAtKrNQ8C0O5BZItYlTFPpzf05VyYg6G+SEQQ6i6PwN4WiGcH9duuNDBFgEPL1PAvRtVYC/g== 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=XKWHCiXwAVePoLiZHsmPvjQy5vpTGJ11DHBgMJItd0c=; b=Qk9w0KfNZV78dgOt9ib6x085BGggFk8FnE/maihvhhxAcLE8Q2WdinY0H/5WXmcCJo1d6BJg0JJf+CxhMKt9MHAq0uGIyiFBfwkMhWZA8JSJCskAhTfEgI/W+ZO/SJPoHB25EZlvaNokL3jpE5dY4SyP93arI6zXSXX5p43UvJ0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:22 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:22 +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 01/32] staging: wfx: add sanity checks to hif_join() Date: Wed, 1 Apr 2020 13:03:34 +0200 Message-Id: <20200401110405.80282-2-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:20 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 667618a1-ec55-4c5e-2991-08d7d62c6e98 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:419; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(4744005)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /wMH3dPz/F6D+1K5xR75GLLj2MI/qljaPv7Dy5aTzBmNYvZKKh6aPM11C+OFwi6WDtrCJVEK5Hu+mzaZ3iXx7HUCWu6lYptTiSiEoKt2OOq436BtVhk3mfK54feMWc5xEsj6HXqC8462oX8dxEGqmfOY1Oig4WUrpICHQ+3mT/eATvufGdnG8zl/6X6sA5Dvm/5uktNIYnI5csnYEjCxxBN0LVp6IsEJO6NHZQRKaXKPVF+ueisEwhhf8fqYGMBZ2Y3a293AUGoFCpmP0ofRLGoHPG6LOqLVs/92ZaCHNXE9E7m0qR5TDeifa6QQPzY65zGPYkwaGbJUFefb+mWlWh+jeTcuiR7mR1xMNSSn0x1+55aw4L3gIo5yXgLlY4LTcWcK2XG0hbVaMxR+ftLwdhltYWpq4fsC6abSuCg0j1bEuz0JRvOOas9kk8uNzq3H X-MS-Exchange-AntiSpam-MessageData: vi4fU7z6gvScGST45SvgmnP4uZdVW/CEBptYDPo64VZLRhDw6cu/iYyqCB+LbeTTshzOx8qBEYB26sbLWIRCvA5y6NZY3aiyXpHfhLnu8N6xOdKwv1KSVJGM9BN5ve5kzcGra15N/D4pofrbxzo58Hz4whgvdoBdzxacr/3Gg7Cucw34D4NGmIdOR585+jWL9Dj618zaoReBQ/7rew8rzw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 667618a1-ec55-4c5e-2991-08d7d62c6e98 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:22.1333 (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: KHekGTLPM8El+ZNhoSiVTDx9fNKWqgJDxcrrwqJGXm69s+e3xO2BAMWPgpJTKvRhg7/16IMYuPwHJSTZ0jUF4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Add a few check on start of hif_join(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 77bca43aca42..445906035e9d 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -297,6 +297,8 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, struct hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif); WARN_ON(!conf->basic_rates); + WARN_ON(sizeof(body->ssid) < ssidlen); + WARN(!conf->ibss_joined && !ssidlen, "joining an unknown BSS"); body->infrastructure_bss_mode = !conf->ibss_joined; body->short_preamble = conf->use_short_preamble; if (channel && channel->flags & IEEE80211_CHAN_NO_IR) From patchwork Wed Apr 1 11:03:36 2020 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: 216131 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 D5BC1C2D0E7 for ; Wed, 1 Apr 2020 11:08:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C2B52078B for ; Wed, 1 Apr 2020 11:08:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Tz5G7Bia" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732288AbgDALEv (ORCPT ); Wed, 1 Apr 2020 07:04:51 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEu (ORCPT ); Wed, 1 Apr 2020 07:04:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ezgj0X5ANhfgCwKx0tPEZPLj3zPO3qbcOkXD1ZqpNZcNKAHZnVZgBkEHB6Co/PyNsgVx7h3S/UeyGhEMYMO92DKO/vg5Y6517LXDyxZb3QkIyKQ51cpb84xIL98MEud//6IZzgRnAPKWYGty9HRybHOlj6FWhSwIdTibba467maoMFfypUgIvf4K+GoI/o0+PjT7bsSrY0iN62e7IfF9IOIHiqYfil4Mddo29oMc3daRkA1Q1uqv7GP/dXn5eIlPWynYTy3OdYWbCXXG0NC7Q4rL9YlTsxGGKaUlGMCGLdbUH8gjUvCBJzMLyfVl05mVVIGKRvzVe8mhaqZAxf3aDA== 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-SenderADCheck; bh=DWgc3yIgT0IVMqNtnriEBLSEOQ8hIKhrblewei6Q9IQ=; b=XDKno/hUHHaeBD5BQfvJtVojFwQ3FKrVXgP6x+lHhp4fFAidOWUTAD/TAgl961o5rAeOPx76WtLrfvTtWxNcgbKSIAX2HwJSK2qgXzm2iEz6oXGqAIloRPzcPe6+MipiE2mJxF2MtPOv9bh8kmW5E97z3GMZmgR7gG3beO5+T2pPHGi+Q5qnb/n5V3Sg/L57l4eXwOLMyDCofnrunoZLpgLB+aFMAS98egXxBL4h47ITzJaB/Kr6gJ2kdkLIeP6iFpKhak9rv18MPKxYcEe8cG7F63KtS0gIsma90Kp9+5474Y5Tqal1pHHa9a6XXcF5voKMT59w+19M5BILwBqMDw== 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=DWgc3yIgT0IVMqNtnriEBLSEOQ8hIKhrblewei6Q9IQ=; b=Tz5G7BiaxIHSJ8pia+v14JwZWvfw2oS/Y8mWGTXpyEc3DWqK6V+3F0a9LW9DRBpgtq3uw3TwMb1cF7BTANO8Eeo3ixV8V6L8w7gOQIw2KB2Bi/+qHgnL+pxmsgiBO1VZbU/rAsBoFfYgIZ/EmPC3CPGdHtJDb+QvRvf18yGphoo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:26 +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 03/32] staging: wfx: take advantage of ieee80211_{stop/start}_queues Date: Wed, 1 Apr 2020 13:03:36 +0200 Message-Id: <20200401110405.80282-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:24 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 265bff3f-e095-4528-7de8-08d7d62c711a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:334; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V77DDpPb5NcZZWoZRwVQvj/jjZpF+Wi8gH89uidbUpSXBYIWNc6tg2lsUrvVayqMdgRwIenGWAWrkjKD8BMHc3Jtl1jV7jY+lOLSu68Ps0qQmkOdXDbuupvZt3XWC3fziDw6GkYeaa5fEaoshEm45LIToESljkU7f/iaGUuAIUTM2XNVMAVdSPqtIYL9nQYigap/NMjCPN9gnN3eSFFIWX87OX4AW1ymRkEJgT/o2Ae3oK+VInygdQPABDf021u+x4A4q07MuvdpxJNN62zRn1bSEpoQLNpa2Skmzm9qFkrfFJD3wYb8W45uPCblPXkGkXSV66E0oNkA7KDIVS0VDHOqs9epTJqD8YkVXkuwvhyev/slsFbyQCZNIUc4joxiKzKs2dciCoG+ryqx9AT3qfl0LTOKpOWEl1z2jGNjgnBJ1nkXawC/lOAt+a0tTtji X-MS-Exchange-AntiSpam-MessageData: Iyz3vNLgDmF+Q1qT2A45+P3e2wr8+RBFM/CXF7sLig3SwIV95zWQ9Nf6rtRAPn//SbzTh9BGG+sM7SsCx8S7NTgSDcNr3yDiUXLDZP+wPb4D29LhYWXEKJlLtd3za68L/SXYHgjgKXQesu/COpqcjZm9XiN02JU0Eaqz3b1/QrVz8nd/x8RdS+O9CwbOwALI3W4H1mYXJKqwYW6qWoeEAg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 265bff3f-e095-4528-7de8-08d7d62c711a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:26.2839 (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: r/4orkbGu00YpjLEkadQaMn8ppx4Jb0FG36LWZMH5ERN8uaQh5RLsESxEY/n3VAl7z3c6lhqpF0XYvzmMCpYhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Instead of maintaining stop status for each queue, we can just maintain a global status for all queues. In add, wfx_tx_queues_{lock/unlock} are only used when no more tx_policies are available. Therefore, the counter of recursive locks ("tx_locked_cnt") is useless. So, wfx_tx_queues_{lock/unlock} can be replaced by ieee80211_{stop/start}_queues. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 12 ++++-------- drivers/staging/wfx/queue.c | 29 ----------------------------- drivers/staging/wfx/queue.h | 3 --- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7a7c2518f6cf..889ebc2f5d83 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -189,10 +189,8 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, idx = entry - cache->cache; } wfx_tx_policy_use(cache, &cache->cache[idx]); - if (list_empty(&cache->free)) { - /* Lock TX queues. */ - wfx_tx_queues_lock(wvif->wdev); - } + if (list_empty(&cache->free)) + ieee80211_stop_queues(wvif->wdev->hw); spin_unlock_bh(&cache->lock); return idx; } @@ -207,10 +205,8 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) spin_lock_bh(&cache->lock); locked = list_empty(&cache->free); usage = wfx_tx_policy_release(cache, &cache->cache[idx]); - if (locked && !usage) { - /* Unlock TX queues. */ - wfx_tx_queues_unlock(wvif->wdev); - } + if (locked && !usage) + ieee80211_wake_queues(wvif->wdev->hw); spin_unlock_bh(&cache->lock); } diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 39d9127ce4b9..e3aa1e346c70 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -55,35 +55,6 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -void wfx_tx_queues_lock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - if (queue->tx_locked_cnt++ == 0) - ieee80211_stop_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - -void wfx_tx_queues_unlock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - WARN(!queue->tx_locked_cnt, "queue already unlocked"); - if (--queue->tx_locked_cnt == 0) - ieee80211_wake_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - /* If successful, LOCKS the TX queue! */ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) { diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 90bb060d1204..88ee2bf56d11 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -23,7 +23,6 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; - int tx_locked_cnt; int link_map_cache[WFX_LINK_ID_MAX]; u8 queue_id; }; @@ -41,8 +40,6 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); -void wfx_tx_queues_lock(struct wfx_dev *wdev); -void wfx_tx_queues_unlock(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); From patchwork Wed Apr 1 11:03:37 2020 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: 216146 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 6FC1BC2D0F4 for ; Wed, 1 Apr 2020 11:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30C6D2078B for ; Wed, 1 Apr 2020 11:04:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="d4WcK8K9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732307AbgDALEx (ORCPT ); Wed, 1 Apr 2020 07:04:53 -0400 Received: from mail-eopbgr750040.outbound.protection.outlook.com ([40.107.75.40]:63459 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732286AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VOFEOEjVD+QWLRay/yiAxhJvmhKuQCICWdl0aISmrDOqiliTGVfTI9RKhe35ofL2jaWu0/S6OnADSwFlL+HhklZ6zea3jJu3xMdRK5ym7ATul4b6LBPSv8/HHB8k1IJGRjhhXqf0FqYejHDyFeIUpgP1RAJ7AOJ8jqPykNxGQEB+allRj1BtcE/4RuRUFOdwbur/GDpgH7DIrvXSJ3AhjyMbQWVZhD4JxA1dgb1sWV3HZURW15puFpau3eM1dbP+eMjIA/39BCHnW3DMoqTa4YbEUPMPa8ei5OhMWV7PraKHESZhwKIMjybKtgbvSxM1xSMUYI/ngtUaTB2Z6X0f+g== 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-SenderADCheck; bh=VCPfkgAy3PBH9pmlJ2GN6+ehAcOpqsxtHV6Sw/Zy33U=; b=jWF0xycvMpj5TQwVUq0+p8snX8SjyuJbaEw+JWSysrQ1Y1+iYBy+zotWiU79noQzMGTg7gwIt3QP3xi7CvYrkPGnF+HICvlkwBWw27xGliM6VswGSoaJTmDZEr/D8f6zLH3Yluc2Ogc1VEg8cKsexIgVH5xJghj+tiOaIFqk2qOy1RlZW70R+z3DTUNSHo06p2JUDA+cs61Ttwe0dHOFRUfOQfGn0yYv/EHIGQrfqiapWunh7Tw92szgl2syyd5i8NCzT9kBhKxCqVzEsS49jNLQk/CuJgQ3SUgBSgBdWHO1y1/mx7svGfn5cw9xICvEuLuv4nQ5xDthXRJAbmcsSA== 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=VCPfkgAy3PBH9pmlJ2GN6+ehAcOpqsxtHV6Sw/Zy33U=; b=d4WcK8K9Mno8uQsFQdWNlY8wMiZu/CdTvAAYfUlPJjqQWqquhLh6a38/ecA65oavCchAE+Af6KYzOZ3xmwBkkSPmXSG4926sTce702YWG1D9GwGAwX/GPekhbbsL1dRli2sPvqtdLEQlqHI/OWLZXhp8EvYYxya8nMKtgMq4oIo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:28 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:28 +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 04/32] staging: wfx: remove "burst" mechanism Date: Wed, 1 Apr 2020 13:03:37 +0200 Message-Id: <20200401110405.80282-5-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:26 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ff242e7-ae5e-4d69-5e79-08d7d62c7259 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +AY4YG2a8dOuFd4ioDfku/EX98dB6qTeLmwCmln+/BGpR6opoIjHeO9leB7MOj2gtTEavd5tXLhDxdNAAonQRClgFJ9FWYyh7QoNGzC969Y+SxYvpGllFpaAf7BmZY+s3Mg+es8okbx4FjXHjwd28TW2InndHzNduQmkMShjJ8KtwOnFSigzVNfa8kSEl8ptxeMRrOh96f2nGfSfPKfTQekesfcmT9ZhLtIZWBQYXZd65qXjRFz3r1kdFDPSVQ2KMQTEUoUoBva/f+qxpGZ/nN+gzj/zsFIu0NSU9h1dpaGWGr6FDwnzI8rSpPJD3la5mzCOWre9vbI4BTnx+n0AKfjeBqp/EROaGH2++AcFMmu/Dc/fpx3hhPiN/if6q/Yp0YGFPFT089VSdIAurr1zFkjWSjMbNy9oJXNNilQHbAkK40swxjFO/GAh64ES6xhf X-MS-Exchange-AntiSpam-MessageData: xXe0dl6NfpvRM9BLYGog+973QAiCd7yl19sl2HLy5bsGC2cie/GAxzb1CdhlTbTe4u7qAd+32QCpTJX/XhiiTnp4lA7rIB3QoHVME6FoMHaihHkKtq4YzJ1Tqojp36oII4ZMK7Bv9VmtbzJnCOLazATkuaSLZs3NZ6J9Xah+xnvWnYWlAiR9NpyGmMZW+E1gSBC6s/05Dz9c4j3rJfFiWw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ff242e7-ae5e-4d69-5e79-08d7d62c7259 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:28.4317 (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: D0yk9RTittMVyxHYxdafRTCt6xcfC3Z9XSoNm6X4Be1n+NZ8eDZ9ZEKLaWX4W81nOKhbayuNO90KDjbFqgGwgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller In the old days, the driver tried to reorder frames in order to send frames from the same queue grouped to the firmware. However, the firmware is able to do the job internally for a long time. There is no reasons to keep this mechanism. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 23 ----------------------- drivers/staging/wfx/sta.c | 2 -- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 26 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e3aa1e346c70..712ac783514b 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -363,8 +363,6 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask, int *total) { - static const int urgent = BIT(WFX_LINK_ID_AFTER_DTIM) | - BIT(WFX_LINK_ID_UAPSD); const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; int winner = -1; @@ -389,14 +387,6 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, } } - /* override winner if bursting */ - if (winner >= 0 && wvif->wdev->tx_burst_idx >= 0 && - winner != wvif->wdev->tx_burst_idx && - !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], - tx_allowed_mask & urgent) && - wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[wvif->wdev->tx_burst_idx], tx_allowed_mask)) - winner = wvif->wdev->tx_burst_idx; - return winner; } @@ -454,7 +444,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; int not_found; - int burst; int i; if (atomic_read(&wdev->tx_lock)) @@ -518,18 +507,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (hif_handle_tx_data(wvif, skb, queue)) continue; /* Handled by WSM */ - /* allow bursting if txop is set */ - if (wvif->edca_params[queue_num].txop) - burst = wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; - else - burst = 1; - - /* store index of bursting queue */ - if (burst > 1) - wdev->tx_burst_idx = queue_num; - else - wdev->tx_burst_idx = -1; - return hif; } } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9d430346a58b..a275330f5518 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -531,7 +531,6 @@ static void wfx_do_join(struct wfx_vif *wvif) wfx_set_mfp(wvif, bss); - wvif->wdev->tx_burst_idx = -1; ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen); if (ret) { ieee80211_connection_loss(wvif->vif); @@ -624,7 +623,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; wvif->beacon_int = wvif->vif->bss_conf.beacon_int; - wvif->wdev->tx_burst_idx = -1; ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); if (ret) return ret; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 8b85bb1abb9c..116f456a5da2 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -51,7 +51,6 @@ struct wfx_dev { struct wfx_hif_cmd hif_cmd; struct wfx_queue tx_queue[4]; struct wfx_queue_stats tx_queue_stats; - int tx_burst_idx; atomic_t tx_lock; atomic_t packet_id; From patchwork Wed Apr 1 11:03:38 2020 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: 216133 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 70844C43331 for ; Wed, 1 Apr 2020 11:07:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B1212082F for ; Wed, 1 Apr 2020 11:07:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="WSt+Ctn8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732319AbgDALEz (ORCPT ); Wed, 1 Apr 2020 07:04:55 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732006AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LV+GGhhN1PfZQVyarp2rAuF2N0/5pyOdkXKcasWfDZI0NrqUI1eskowd/IwqtdW6l5kkCZukkC0+HjBYpaXb2Ax3Z/W4aWqKhKr37/dYj1GP2RVBa4UALOsHNVYo6OPAhHLS7O1lyAlkMzBpV9Dg0Y11U68nK66OOwcm9nIhN2WO0tTyQAlCdlxhN3UMErzGEc+ncyi4wb0L6Fakp2p3J8J+dVXfPYUQ7htVK15d2Emyy8P6wyzb7Iu4ONnehO7Psh4GxKGFEQIUVgKg3jQMvyWx7uy06wPs0bMb+0ppWWD2OiD3kYCoEskZ3EPezkt/mGEubiRppov4GINyXUnzfA== 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-SenderADCheck; bh=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=BQ+gH+GiyEWrasPSNZnALUzI9TrPyyXoe08bPypf/4cTheRVbC3d3YBO5v1GwNZ+KGr4wiAlGcZf5y+9lfi1aZwXnylGDgON3ZKUH+l1NCytEl5DzpMVgQa4BE6YNnsv3mC0Ey0i+GvoOsk/ii3wmr80c9oQWgJ8l2HTjQbAYBCiH/nyL8KMVTf3+CpMKf8fAjjz6jN0woM70obxNFwL1ES+aJCU7VcZcOsY1RDoj560s+WstPUYm1ae+oa2vE+7H/gle496yvJTGgkHI3hUdVuECoeG9gNfLSi2DGc73I8jKT7xRA3/ETTnwFgRLqiZEg0SaYu3ezHYYat6aYZT7w== 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=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=WSt+Ctn8mdWM5BsemkEDUyUzbswdAFV2OaPc/yRs/i3Y3MIpF5I8L5wD07P2Ef4AY61NwfIoHUDXkQ3pzW4QHU2n7oywMeNBc76HbpfNRHSW8DEq7MkPmGL7fg+zYcPA/aGIZPorJUf3TqLEXxpyBPw81K5PoU0wht2LoOPK9/Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04: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 05/32] staging: wfx: uniformize queue_id retrieval Date: Wed, 1 Apr 2020 13:03:38 +0200 Message-Id: <20200401110405.80282-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:28 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VBwNRmTRajLY+BRz45GtG05M22OMZYBifqWQr9itaZYIK1DDVjkcXP14FHMJ+DCfd7/dN8VDkIjdTsxaFfmlwa+oVq/1KmuGgiUb4hps4qwzk8bZ4UcCnRTrif0WGagW1djejUTP6zDnfqKYGt6Yx9/esetp6t0bKOdTGJZ6UkIDs4celrcUEdO+6RfbhaWo2Xu+Q9iBj7/oHvxB8o4Jih+Ltisq2ymkuKjG4jcxADfZeK5rVtrnhJxU3WF75kxGkSuODbS1+F915VupWt5Dvfz8xX7cMv+V/LQ66lPuu92//65bO8IGQChh4fQxDlRhOb1LBreS5x4v9hg5ixi1+ja2BCmAWLYPJdXj3NG8DGrICCZ3bxboPfdcOxK5WBopWgs2/FBPb8FBohiCx1gX8jEssIYYpFn9G30CbTLU6uKCUORFmPUBWBegUyMx8Zq9 X-MS-Exchange-AntiSpam-MessageData: y8f3sTb/7OndmjxeMPrechCp6v96URdKMCmH47vvOKFiBaTT0cq0J+71P+nSSSULzh75W9gS7LXzK8j5T3Zpbl4hBxOniYUG1edAYEWJlj4kU5HEiWRLiTU+ryOSmQH19mK/3mGt1uSGDde+AwDLwAk9FNYJodjJYfAyfgpu4PsLkFhhApZHstDCLq5ThyOBPoCAJj4xaconXTwoJdt4Kg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:30.4316 (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: NJIgiSsRErFSIoUlGcfFJ/gbyj8S5HpuOog6O864WCKjICJlOKOZyyv+OP4uaF/7yCG7In5ks3briHD2DHoVuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]". For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it is not the same semantic. In wfx_tx_inner(), we want to get the mac80211 queue index, not the hardware queue index. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 889ebc2f5d83..8e4c3e1aadfd 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -417,7 +417,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - int queue_id = tx_info->hw_queue; + int queue_id = skb_get_queue_mapping(skb); size_t offset = (size_t)skb->data & 3; int wmsg_len = sizeof(struct hif_msg) + sizeof(struct hif_req_tx) + offset; From patchwork Wed Apr 1 11:03:40 2020 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: 216132 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 E0277C2D0F1 for ; Wed, 1 Apr 2020 11:08:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B758A2082F for ; Wed, 1 Apr 2020 11:08:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="fLmgbxpW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732759AbgDALH7 (ORCPT ); Wed, 1 Apr 2020 07:07:59 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEy (ORCPT ); Wed, 1 Apr 2020 07:04:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fCuts7Esk0QK6OgjulZiff6pUJKK1lPwEuM3w4JCULnsdquImgSwe2DsPvGw9dWMjjWGRVg0b8mNagzX/kB3gDFthE9Jg8nXaRIlu7keIC92YtKVWJ2Z8YVLIwsDJf4nxQOT3tnoBx3cdjgiMiaOsPp8gKVLta0npp/fiXPjoghNNiEb9TV8DuOAes01k7KIuDlvuWfeDb72o2QBvosfUL7eAezamqszig0itNbTzz7sBPlom/zY9iJr15Z3sSdidsd0/lcxvaBqPtiHCREsM3J4YizVf1AFTnA3j8Gd7u6YQxS74DcQQKl8ozfKRgG3+A0TXGpRc7tYUHIIzPCZ3g== 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-SenderADCheck; bh=nJVaYPTTz7XNAS584fc+n8puN+xxXPzKeuB+iorTlwI=; b=Vdvnv6hN53CptSc2KF/vWbnwPcEdOnopYwxh0ILizoeiXPksZ2r8CXioG2gNUtwr/e2e1+3gQNCDUx5I3P3W3U0bxUUldoj8LoJ++cMhXhBCvmaHm8ukzA02y4emMp9lTeoe8ORZf1jd/A6nmf3boTIJbsCv3YBffYS0SbFQkd+Y5/n6g9rCOTENzNemqkDXrt41MN9aRDOMY3qxpe26RbLKEHIMwlcn2G8N3I6V6Sr9vWtbbfNMyqD58mocY0h5CAH5d6ztW6yjH5UaBnbTji2vnGM3KUeCWkbnLO0ZaZrAnI5rw4ub73yXbgY4csTqRm6elEO+cjAM80c9ekFHBw== 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=nJVaYPTTz7XNAS584fc+n8puN+xxXPzKeuB+iorTlwI=; b=fLmgbxpWRCdzzeind+o5O1/nOc1CbKvcWlYAHWC8FHwYPgR85+CQKxofLq7fAZmj4pGd7gqO0jzGkCJ3q3hxYS7oejp8r0pKAiuqmDV5ExsapkNO2TTxvE3SsRHt37R3q/BvZp/vSmOQK8VGXDJyzEOE0DgExd4lEO1oeNKYzzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:34 +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/32] staging: wfx: avoid useless wake_up Date: Wed, 1 Apr 2020 13:03:40 +0200 Message-Id: <20200401110405.80282-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:32 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd05c000-c114-4b59-c9c5-08d7d62c75f9 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ArJAtIy7VHKDp5zet8JMwOH8u2u+JpDDqI/50b3sihKxYgcP9P4P6ThARsT6+z6Y+ykTEZxS93WwOl7SlEtP/4SbXsppay1vRj02VtSLPKoe7JDj91TPNZGeuer2YUM009O2lbnlBPKOHRk9OzalFmiZD+AzWTG6j4MrwghH7mjV2kCHVUTiWjJyqqQ6s7kubJkmJcLFagcbDZt35GCAi2jWyLHlfbEk70T2N0E2srw3Wg1uoMITtitYDaUmtIx04C7CIpnXp1EkSdu5jWbr4vvt4v9kmJ+PtOUBrSuu6j3ElTBJgZrMWEVLB1gt2xYA5coQUzmHMcYMyVPCoteZD5mfZz+qUJW6Eae+f3ykEAcnYyhY+fHX5GNtu78KB0dhe3IHtDXA14kcRyppSwY5uZr7R4lsNUQWnr2PhODnG2399ncV9YTbVoxLH/+gMDz7 X-MS-Exchange-AntiSpam-MessageData: g1IjWURb5emZg+p3tiR/ohcb12FoQXZJbHQGAIL9hYASgGujiQt4jd+/C2EvsLUBrh3QQhFvwWJ09NK9+JESvmse4u9PnoL63vZULMHhg4udiXmvVf0jACx3Cj39+TxQ8U89Y+TTfsISAQoL5c0PHEdsgZg1rzX0fZKY5QCRAtXztSwxvLogdLVDgkOEaBxuggoD1vNQCmk6rCFo4bZEbQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd05c000-c114-4b59-c9c5-08d7d62c75f9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:34.4832 (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: 8dO0XJOUY5b9hNgQBqrK1+bUCAxko2ihiR+vleUnYxBuvz2V0kxt3LSVQpthu/tNkXrbQGhsPwd8lyBWiJ/rvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller __wfx_flush() wait for all queues to be empty. In current code, wait_link_id_empty is wake up each time there is no more data for a station. We can simplify the processing and avoid some wake-up by raising this event only when the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 1df3b6f28c67..2553f77522d9 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -190,7 +190,6 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct sk_buff *item; struct wfx_queue_stats *stats = &wdev->tx_queue_stats; struct wfx_tx_priv *tx_priv; - bool wakeup_stats = false; spin_lock_bh(&queue->queue.lock); skb_queue_walk(&queue->queue, item) { @@ -208,12 +207,11 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, spin_lock_nested(&stats->pending.lock, 1); __skb_queue_tail(&stats->pending, skb); - if (!--stats->link_map_cache[tx_priv->link_id]) - wakeup_stats = true; + --stats->link_map_cache[tx_priv->link_id]; spin_unlock(&stats->pending.lock); } spin_unlock_bh(&queue->queue.lock); - if (wakeup_stats) + if (skb_queue_empty(&queue->queue)) wake_up(&stats->wait_link_id_empty); return skb; } From patchwork Wed Apr 1 11:03:42 2020 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: 216135 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 4A995C43331 for ; Wed, 1 Apr 2020 11:07:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1262120857 for ; Wed, 1 Apr 2020 11:07:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="JkRezrZF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732361AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732336AbgDALE7 (ORCPT ); Wed, 1 Apr 2020 07:04:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EXpNqxVZ36DKGXSO4zUy6HJII2UTmqpgYtmHHc5vF2vzycgIxxIG84xLs+Y7r00fn/ttXekr/HZEsnRo4S0xALBpdqxrMZeLGcldpT+iO/JBhXSjuEnWkVZsOmKUWBaORAmAox3Kh4j7scLPXjsAXHBTLGFdAI5rPMV1rY7XUkIx44OtKHtxKEwUVsalYjcEOpN97DiNUXmwVMYiUrCmyS9rlRg5FQnA7eMtcJTrDZYryulAx3o+s1g9d9HLiZDkbwVwlfm4dgoU7Sx8D3JdZQ5BcssuRSp6r+sVG1PaBhiWVC3ok5W2sPnsKLI5FLWrtkn36m4vlbA2CPU4JLqWvg== 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-SenderADCheck; bh=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=EOWq9n8zYJ0n/2PtF7llRg38kqrDT8fDWto1smtC8JCdDWBjL6nvkIrl5iIjBcsjqPswyBj+QNv/UNcDq4Pn8R4XGEkzLAMmTQV6JxerbkBEPuo78I6T7jg6r+nAvS2IOiPHTaDEh91yUDXqzArCLWO/vM/k3t3x9WYMRxwXvsa3HKTHqaqxhlpKlROV1QGeBE+xSSUMfGEorJTLpMO4s6M68lL4c5X/zefUUFyfLHtcyYvUFO4TYl6cfo+HjGEvEOUXWOB/lBbldklpZwFQKAvSOaO+JqvcT+A0nW4t7/UTwLao194IJMfxwYSrZMgo4xgMX42yyJRdpVPP0kdUVQ== 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=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=JkRezrZFi0T8U20gHfu3OTHCwWTrS4U5vU34154jj/XLcdpl7iUw0MlPnwXyuDGnKsHvGYRiHhh6dCkR2jUXTc5tR8xEOCVSg64aoT77p0qtsWhaeAHBAfz7Xz05O8wnCLg4ldL6sigZCGSsw2JCRNEXSYQlJ1Wx1WxWSmczPi4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:38 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:38 +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 09/32] staging: wfx: simplify wfx_tx_queues_empty() Date: Wed, 1 Apr 2020 13:03:42 +0200 Message-Id: <20200401110405.80282-10-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:36 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iN0tFBjk/Ff/Imcr0m8ioARP9oqpF6JFePGGsJw137nnI1zrjx/QZXKbBToEQVUTYlbTplRnGiAoS3eimYyo8VHEQmnan7z6jcP3NLhdSXBWZKNUBqpzBgjq407Ig2NVwY6yU5PJklidHvZj3T3UrK5SwrKwHLnG8uxXO+ZySBykEzh7DdqZTfLu8p271TvTrlnF4E+dlbGyirFG15b6i0WZfBvJA+oUeK0fxnYREZ7hmz6ZTDrVVH/8R/i69+HBzxBS3QDcMk06yK9hKeM112AVH/G06Hq3VCGCRCQgyKlsaHDvxC/0DTNGFLVt6zoNplXmel3E4nfq7OVv3oeSzq3PeSJuHCZ6EqUyVNVGRUPXlpikagxJB65MMxdpqKQPByyHy6zmuRkNFi3e6AyY8MVxit460ulNyP4d1a1vwtcB4ZXvfhoY43XxD3LuiwMK X-MS-Exchange-AntiSpam-MessageData: 0tl48AQxG9HbRamJmOO/lLtYySxapJK/1fijyp7SPfELAmCbtWzansTV+lE9fuTO+iopeaRQuXYVnr8weWz0T087TgFhsuSz5a6qIaLcdUpJT1BMevKa4VKl+w0RJN5E/JK5WHJ/Bsk5o2vf5vyid6nnRVGyH9TMEerLuOA+ZIrRWK0uTo9gtvY39emfFtfGFXa8Gxx2KDfssFDLmIEbXg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:38.5489 (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: XRa6XDyMQlaqq1PJxZMRF1c43d6kAHeNYaneluqMTnLz+IKj2Bq03MKJ5VRQ2g1+UDg9JCXezqw0ADHXMiWxQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 16 +++++----------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 8647731e02c0..09f823929fb6 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -303,20 +303,14 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) +bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; - struct sk_buff_head *queue; - bool ret = true; - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - queue = &wdev->tx_queue[i].queue; - spin_lock_bh(&queue->lock); - if (!skb_queue_empty(queue)) - ret = false; - spin_unlock_bh(&queue->lock); - } - return ret; + for (i = 0; i < IEEE80211_NUM_ACS; i++) + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue)) + return false; + return true; } static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 2284fa64b625..5a5aa38dbb2f 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -40,7 +40,7 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a275330f5518..be493b5f2b5d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -325,11 +325,11 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) if (drop) wfx_tx_queues_clear(wdev); if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, - wfx_tx_queues_is_empty(wdev), + wfx_tx_queues_empty(wdev), 2 * HZ) <= 0) return -ETIMEDOUT; wfx_tx_flush(wdev); - if (wfx_tx_queues_is_empty(wdev)) + if (wfx_tx_queues_empty(wdev)) return 0; dev_warn(wdev->dev, "frames queued while flushing tx queues"); } From patchwork Wed Apr 1 11:03:43 2020 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: 216134 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 D35C9C43331 for ; Wed, 1 Apr 2020 11:07:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C5042078B for ; Wed, 1 Apr 2020 11:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hOTvwm/W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732351AbgDALFC (ORCPT ); Wed, 1 Apr 2020 07:05:02 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732335AbgDALE7 (ORCPT ); Wed, 1 Apr 2020 07:04:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWEweFxP8RflJJVWA1cp8SZjkDPllXFmen0QHeZGAfTm2wVXL0Ckm2wRu8EUKV8ftuGfgYrY15DaLeImd2CmhdCvx+YhDVigux4zVOlHTqfltCt2G1zsCch5Hl/FG75r2xlncGNag+z9HT6hXtXl1BfBn7z2rijYX+RSPNGH2XbnaiHN1BD6X6yNxkHAH8F+tC33L/GRVQpaX0WF4cXR6+1Lswu7tUlfJbCrXsss7SNkYh4LgPBO9mojVkoCzPS8T/X5IsjpEbB9ML220jK3DHzc2gG3Pe/YRibRTTs8yQCqY6fmeRp5NPEiSpbYHJW5kz/cWGvXrYms/4pAkEyjqQ== 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-SenderADCheck; bh=+PagPWzCkbCX2OEL2UTnVfEMuWRkvSgV+q27nmCjK0c=; b=OsIfBnr343ELacbhqr3VyvOfhgL5gYSZhfOYIG7JWC9NLxH/pl6ItuQtj/vRm04Kooosxl9HXpa0Y8I1vBkomQg4MAtjmDj/9mfWFM1FHK7X8h7HlIX+NsbAbn21JJgzhLAaMHq/nYRkhotIJn1neJabS/I/CZl+KIql21vBmWL3Ra1cQ/OFaU1mYczpAjkBfilgaRqfoHMgAxYbmBBTTNE2g06tA9J4DdPEiSXQyAKbBDI5d9y40geTxbpR8GCqTwIa0FqGS6LMu2zO78ntIfHSkRVbngiIcPYxTLmNQ1uh/Lw40Un4U4G29/8ClVv5PihuQAs1LvFNFXrVW5btOQ== 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=+PagPWzCkbCX2OEL2UTnVfEMuWRkvSgV+q27nmCjK0c=; b=hOTvwm/WTOu87pcv63FAM2QqgmQ/eKLvSxzMyEnJpvK+QC3C8TCUM4RWMO4TQOv3geOcLqr57/feQx4w0kIadDDTnoXZfMGzjTNJbMF2/pXFnG+UrLxCtOZj+mClG7Wbe0LCn3gQ3Ts9SbgMm1CCaAAp4y9RuPOFOFZAEEeQsiQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:40 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:40 +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 10/32] staging: wfx: drop unused argument in wfx_get_prio_queue() Date: Wed, 1 Apr 2020 13:03:43 +0200 Message-Id: <20200401110405.80282-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:38 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 618bdf62-16e4-4f0a-8cc6-08d7d62c798d X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:350; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xEuvXvVE/+Tz0lLp94EZRk9RJ679sjNbPKe0K9WGp7V+tMx6vTBe449RoqgBTnmUoym/imY633wE+JFFtqaNZLtpf9r5MXImWvDpd7+IdVNag/4vP9uVtTOt7t5rbluJdTUhCwy10oiFB/bqtZX7pcjJgwXTfCe1l1T7zF9QZNp6xZYXQQwzDGETVFkYUULVdmbzQHFJAzKD7ISaEOEdJgcETpJW7/awRiq5ExCtoMMlXzNeZz9NNjj0eMvFs7H2JAYkdxadfvN4Wi5LqmSqeEzN/zddlsEemxYWUVAbxJMMfXjytT5Mw3rwuXjnsfQX0aEBOq3sC+IUHnJ6BIJjPyGdyTCnE8Q3BN46PdqQA2gTIuaBF9oYoKuM+mCeHz7BWTWJ/Y1gEQK1xUcQEnOEdPLMYCJ9qLh5ilVk8Anv4rTNwcztjZM2e511PwLao/D0 X-MS-Exchange-AntiSpam-MessageData: 0eyCTxWLkrtAZYOo7FMivaaYEsNs1FDNk9ibxdJIHxLMoiMXIn557iBQh9cfNrHeX0BhjfspPeqbTKwqeEkIH9+xCgT0RNt8b+aRIsmQJAap9zbVNmn3iL/+LasBPMyp1x93ULCMa7w3sOKw97jzyABq5vFbuWVwPq/pIc1bqtsi7B7kKepBITGKOClwm5KrHBz043a02GvBn/ym4hWBHw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 618bdf62-16e4-4f0a-8cc6-08d7d62c798d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:40.4728 (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: Gh9anUq6+mEcNY6CCcwbfnh2IQz9m3iczXdM7cQUx857mLZ0TI/jdzR10i0pey/ppBaR4FNu4NgoXBPiUHjOcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The argument "total" is not used anymore since commit a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM"). Fixes: a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 09f823929fb6..bbab6b192b0c 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -354,8 +354,7 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static int wfx_get_prio_queue(struct wfx_vif *wvif, - u32 tx_allowed_mask, int *total) +static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) { const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; @@ -371,7 +370,6 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, tx_allowed_mask); if (!queued) continue; - *total += queued; score = ((edca->aifs + edca->cw_min) << 16) + ((edca->cw_max - edca->cw_min) * (get_random_int() & 0xFFFF)); @@ -390,7 +388,6 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, { int idx; u32 tx_allowed_mask; - int total = 0; /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; @@ -399,7 +396,7 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); else tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); + idx = wfx_get_prio_queue(wvif, tx_allowed_mask); if (idx < 0) return -ENOENT; From patchwork Wed Apr 1 11:03:46 2020 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: 216137 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 B18C2C2D0E7 for ; Wed, 1 Apr 2020 11:07:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DB532080C for ; Wed, 1 Apr 2020 11:07:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="a7Xk/QAo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732386AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732342AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kqwDvwWpu9EOyjjL45spTvaufqYvVAEdMRDKfq4E0g9JteIy6liea/orSsOn03zobvFBCLiWBFYqSuEjwTyDMhrKIEWiWRG+MCi15ocJKSumFMYpFnUN8DMDS/uEiOzqxkkTLzXbaFSQese2OXRvHf8GFVju7muwpx4810Pcfyy+aK88tCh4P+BOpDZhsMkYAeVk7e1mJZ3HcSw2ng7FbNJLl7pBB5Z+tlAvJQhhvaOlSLRCM+DwoU69LTZiipQF2kVEXAzhooxDC9OJrzMdhcC/Y+1xRLypxG2xuWogOO1xAzQtXaHGD1PLYR+W4oeAe2d3g3VD2wRmVf/G0tLD8w== 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-SenderADCheck; bh=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=gDw9bdur37DNPZK1kUDsoq/8FZOa0/GpjNT1OsaxWdBTpeidh39FbsChzuMiz/kOTIWPKt/uquVw+d8kVapYlBP8g93qKFArAQgD8juy2DUnW1Cg3qFO3mDOcUT5DdNrsQI98tT+QFTEDyi8Df5ZkIvOHmls+KJaJWwNwd7I7+u60GqrNR9aEnEejU9xXltnBZwJT5ObKmv1UBjL6r6/Lxrc12QsAx57GDM+VWeMLqNaY+w8ynbBY+lh7k8Irgw+Z/+/hFx2yDpA454XX85udryJ5TNDPhrF/aa1LHirs5m0MOpRPyPC6++J62YG6FjK96TNmRhgL6SAmiLiEQXQ9Q== 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=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=a7Xk/QAoo3uua27vCJ/esbFjzIr38NBX07tgzT9s9l/fIncQPQ+9+6o+69QulQ2wDs4gtIjz/VN6/EE3sERSRFUZJ/Xy8uPt9822qwt0vFc52H8MF2TM9Ja0gbO1zxtQ6+vksbdBDkVUwOnhnk23vD2mv+tVoEKvgvbkX4al7V8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:46 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04: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 13/32] staging: wfx: drop argument tx_allowed_mask since it is constant now Date: Wed, 1 Apr 2020 13:03:46 +0200 Message-Id: <20200401110405.80282-14-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:44 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D9YcBb/cPXoCz8WKacl2zAxaW+wS9bD/FVyieYLC5D9p9BqDo43hpxnzAQ7YV6eZSjY7UmwuG/PWcjHxbabr7Bo++X4rpPcD4PXnRnhJiHjHMjiyMPaG0fL3QvczUet1gDty3fgWFc3UnLZtLWyj6P1okPS28wogo/6U7aKgZvust0CVLiWFsDl6m8j2YQVEE9XNq/EeiAqViXU/LzHPUo8xXxS8AhZLhQMzRqJ5g4R3HsKdzZazNQsFN4DOxQgWe73vHq2ZUFnzfwoXY5psQgdxa1jtUq1FFgh8Le8LFC9NMuoaKW+XOM0w2PnwvDw+QWIu+r1M6au7OL4gyAJdbCUKFHvdrdKm+YjtluIhi8RZOSrQ0EcHATtTWXKleN4Ad3e3N/N4TaqJEzLXxotYkHCnlfdxjiM2mEmw9DCiaYceMBbUGHxpjGrvgupc1CoW X-MS-Exchange-AntiSpam-MessageData: o4/B18IYZrKVQshBLlqeZ/bseWHsPBiBP22IpK6rRD5KHkjLXTM+tvwFIJ16VuxmgjtQudp5iBzXMIJJ5bzD5d8TWKBr+DfXr7J89w2shYsbKfOUKpw7j0Df4zZ4euiVa1Gx7JFr2YxiIanPpMUbBYMHnDkJlU6rLRsNhalfqsakZgFcZs5S6//f6DGDtOhGflR8wy/DXmHrXIXTbB3XRQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:46.3184 (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: pyU8L/9m0q9tiZqwj/IaefHJTATMIVCmyCS6ysC5CnA5wMe5CtKNSRbug+FpPZRzwbHRW5u4KSnsq5DqkLIzHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Following the remove of asleep_mask, the tx_allowed_mask argument passed to various functions is now always the same. Drop this argument and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 48 +++++++++---------------------------- drivers/staging/wfx/queue.h | 2 +- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e66debd60e3f..cecf9aa7b3ca 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -144,22 +144,15 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map) +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { int ret, i; - if (!link_id_map) - return 0; - + ret = 0; spin_lock_bh(&queue->queue.lock); - if (link_id_map == (u32)-1) { - ret = skb_queue_len(&queue->queue); - } else { - ret = 0; - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (link_id_map & BIT(i)) - ret += queue->link_map_cache[i]; - } + for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) + if (i != WFX_LINK_ID_AFTER_DTIM) + ret += queue->link_map_cache[i]; spin_unlock_bh(&queue->queue.lock); return ret; } @@ -354,7 +347,7 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) +static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) { const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; @@ -366,8 +359,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) int queued; edca = &wvif->edca_params[i]; - queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], - tx_allowed_mask); + queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i]); if (!queued) continue; score = ((edca->aifs + edca->cw_min) << 16) + @@ -379,23 +371,9 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) } } - return winner; -} - -static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, - u32 *tx_allowed_mask_p) -{ - int idx; - u32 tx_allowed_mask; - - tx_allowed_mask = BIT(WFX_LINK_ID_MAX) - 1; - tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask); - if (idx < 0) + if (winner < 0) return NULL; - - *tx_allowed_mask_p = tx_allowed_mask; - return &wvif->wdev->tx_queue[idx]; + return &wvif->wdev->tx_queue[winner]; } struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) @@ -424,8 +402,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) struct hif_msg *hif = NULL; struct wfx_queue *queue = NULL; struct wfx_queue *vif_queue = NULL; - u32 tx_allowed_mask = 0; - u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; int i; @@ -459,12 +435,10 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - vif_queue = wfx_tx_queue_mask_get(wvif, - &vif_tx_allowed_mask); + vif_queue = wfx_tx_queue_mask_get(wvif); if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); - tx_allowed_mask |= vif_tx_allowed_mask; queue = vif_queue; ret = 0; } @@ -475,7 +449,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) queue_num = queue - wdev->tx_queue; - skb = wfx_tx_queue_get(wdev, queue, tx_allowed_mask); + skb = wfx_tx_queue_get(wdev, queue, ~BIT(WFX_LINK_ID_AFTER_DTIM)); if (!skb) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 5a5aa38dbb2f..58da216d47dd 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -47,7 +47,7 @@ struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:03:48 2020 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: 216136 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 3035EC2D0F1 for ; Wed, 1 Apr 2020 11:07:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED8C12082F for ; Wed, 1 Apr 2020 11:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="FzSP18HF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732535AbgDALHQ (ORCPT ); Wed, 1 Apr 2020 07:07:16 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732360AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWOLof8BeUkcAShp8UtzVX3QWAvw0/wvLbjIA/TzzqcE/wA12p1UiPFOKvUvdngvWskKpv4g/A7aMiqqFq+oVGzaKAFJRkq8ky41q8VIom/gOxFZhxtQsqBXA2U4k8AV8n8E+YuAyWWTsCj4IYeyhqe2KRgj6XBm938WrEDUquCwJxHU/Vl1hKYhvPQKSrToRmuxMR8mDbzduVFFQSGt8MByVDVj1vIiYzot5zngZUK++JnY4l74GUt33VJlgN0CyWpKyTT6psTCVNjPtUxkbaDOmlUNAtu6VCVkSXOiEf82BgYl74wxlFr6xaMFdenGxtnMrsVEyVR1+1SkSwj//A== 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-SenderADCheck; bh=Zwnnlp0rg2bPpdzDiOZIrKpP7GITQwa8v5Y5n3ZgLMM=; b=gECgh3m+3hzPDMKDxrzUCystlp+oyeEQkJlVjERpR06GgMgMW8mBOEzX5oAI3H+PWKZWNOF6IoEnrlgT/TNyqQo1A39j9H4eDAlZzK1qqbLKXev74g0b6jbB4/oda+fvOtm8V9qVF91u4w/prR96yJ9FpF7EQ8psfh55vOXIrr2WYpgoe8g15d4AxK0ipT/Zb+9paU6pm+kfRBiN7o/7ex4txkyS/ZcJ/x4/arNyAH/S/yIEe1Hzhe4MNFx1/51Nr1gZl0gIyS22EOg9Mn1KBDAD5umgkmijQG8hn34lyCn/gYxfs1QZOMZnCvOONf+qxncBfUd2DFvfkJiIb/JO8Q== 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=Zwnnlp0rg2bPpdzDiOZIrKpP7GITQwa8v5Y5n3ZgLMM=; b=FzSP18HFStzfflJ8FOBKnByETLwdMXwvZK1mC+xyPyhj04EnLlOAqdof/b3xkWDQ3iQALZ3Y0i2j+MHiOOzFoIbygH1ElvH8YuWMjECcPNOfBkolQaZox2yXHMPb9pmxDfdks/axDrVRgimE2BdBQ96AxcxC0qBSyYlenXcrr9c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:50 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:50 +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 15/32] staging: wfx: drop useless link_map_cache Date: Wed, 1 Apr 2020 13:03:48 +0200 Message-Id: <20200401110405.80282-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:48 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9415d82-8b5a-4082-742f-08d7d62c7f6a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPgPMW7QC/X9UXQ5QF5Mc6H0uFKZs99yEaRKvfc5SaGR5rbgFEykn/7/8P4B5Qb2n9pEXEBlls1/NdhaDLyDHlCPL/r6SyIkg1SczLV2KcSl62N3RrMHqDGbCHHsUvCsFCI8sFcIBQaQP25Yfz9/6rTwb0f6h0bCwbuHae5P3w5nuIeuXfHR96+LfZtIhJ1sPsSqi4oQuQP0Y1HjOc3JYHGOPz0JTp7PqpVJSuNn+AQa42c7MDh5NYyB0WKhDcNzYiOauWHKbWCk5TscHLssoXIgPNA1oFvr9vVGpQvPygCXSNR3Ga1e3m1RCo+GVDIjBRm4FBTMNgKKvAfOLTXr5Kb652x1RfGc8QNQgjwT9Bi/wxO2dISDWL+78R8Uusm0wLKpdCR6kpmq00hRkfwe35Ir/a7S4V333ouCryOLOpnwUG9lXQG2TaKznosSfYw+ X-MS-Exchange-AntiSpam-MessageData: jOB+flDVkLIzuFuEJkZAvwjzoq3vsb3gGI1FRPUv0qAZ37+LE89JVS2ljsYC3rQG0X95QpKwyBBra9pUT0Ow3rdsN06ffEMbvc3LQC9UqTTZDOvAnOUrKxnem+O1vY9zlqNJKN3nAQfoL7OkqpbfR5/BAalStn65BAeZsVY2FOYT8zXVPSmNAQ1qlnt6kdHgKcoKDkhXLU+VR96AF3lFsQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9415d82-8b5a-4082-742f-08d7d62c7f6a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:50.3051 (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: Q/DfLUB9YtTtRUfpAjg3Hjw10HsYiWHvRLX0aO0eF4AO+dU+XZ8TMOskyHH1IeYeDjTERB20O4jobIEh6X6/YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Driver does not use link_map_cache anymore. So we can drop it. In add, we do not have to keep this counter in sync with skb_queue item, so we can drop explicit spin_locks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 60 ++++++++----------------------------- drivers/staging/wfx/queue.h | 3 -- 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 6fa8f4e083d3..82c2781b1f78 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -94,20 +94,10 @@ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff_head *gc_list) { - int i; struct sk_buff *item; - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - spin_lock_bh(&queue->queue.lock); - while ((item = __skb_dequeue(&queue->queue)) != NULL) + while ((item = skb_dequeue(&queue->queue)) != NULL) skb_queue_head(gc_list, item); - spin_lock_nested(&stats->pending.lock, 1); - for (i = 0; i < ARRAY_SIZE(stats->link_map_cache); ++i) { - stats->link_map_cache[i] -= queue->link_map_cache[i]; - queue->link_map_cache[i] = 0; - } - spin_unlock(&stats->pending.lock); - spin_unlock_bh(&queue->queue.lock); } void wfx_tx_queues_clear(struct wfx_dev *wdev) @@ -163,28 +153,15 @@ int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) { - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); - - WARN(tx_priv->link_id >= ARRAY_SIZE(stats->link_map_cache), "invalid link-id value"); - spin_lock_bh(&queue->queue.lock); - __skb_queue_tail(&queue->queue, skb); - - ++queue->link_map_cache[tx_priv->link_id]; - - spin_lock_nested(&stats->pending.lock, 1); - ++stats->link_map_cache[tx_priv->link_id]; - spin_unlock(&stats->pending.lock); - spin_unlock_bh(&queue->queue.lock); + skb_queue_tail(&queue->queue, skb); } static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct wfx_queue *queue, u32 link_id_map) { - struct sk_buff *skb = NULL; - struct sk_buff *item; struct wfx_queue_stats *stats = &wdev->tx_queue_stats; + struct sk_buff *item, *skb = NULL; struct wfx_tx_priv *tx_priv; spin_lock_bh(&queue->queue.lock); @@ -195,39 +172,28 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, break; } } + spin_unlock_bh(&queue->queue.lock); if (skb) { + skb_unlink(skb, &queue->queue); tx_priv = wfx_skb_tx_priv(skb); tx_priv->xmit_timestamp = ktime_get(); - __skb_unlink(skb, &queue->queue); - --queue->link_map_cache[tx_priv->link_id]; - - spin_lock_nested(&stats->pending.lock, 1); - __skb_queue_tail(&stats->pending, skb); - --stats->link_map_cache[tx_priv->link_id]; - spin_unlock(&stats->pending.lock); + skb_queue_tail(&stats->pending, skb); + if (skb_queue_empty(&queue->queue)) + wake_up(&stats->wait_link_id_empty); + return skb; } - spin_unlock_bh(&queue->queue.lock); - if (skb_queue_empty(&queue->queue)) - wake_up(&stats->wait_link_id_empty); return skb; } int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); - spin_lock_bh(&queue->queue.lock); - ++queue->link_map_cache[tx_priv->link_id]; - spin_lock_nested(&stats->pending.lock, 1); - ++stats->link_map_cache[tx_priv->link_id]; - __skb_unlink(skb, &stats->pending); - spin_unlock(&stats->pending.lock); - __skb_queue_tail(&queue->queue, skb); - spin_unlock_bh(&queue->queue.lock); + skb_unlink(skb, &stats->pending); + skb_queue_tail(&queue->queue, skb); return 0; } @@ -235,9 +201,7 @@ int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - spin_lock_bh(&stats->pending.lock); - __skb_unlink(skb, &stats->pending); - spin_unlock_bh(&stats->pending.lock); + skb_unlink(skb, &stats->pending); wfx_skb_dtor(wdev, skb); return 0; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 58da216d47dd..dd141cb4bf63 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -16,18 +16,15 @@ #define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) #define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) -#define WFX_LINK_ID_MAX (WFX_LINK_ID_NO_ASSOC + 3) struct wfx_dev; struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; - int link_map_cache[WFX_LINK_ID_MAX]; }; struct wfx_queue_stats { - int link_map_cache[WFX_LINK_ID_MAX]; struct sk_buff_head pending; wait_queue_head_t wait_link_id_empty; }; From patchwork Wed Apr 1 11:03:50 2020 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: 216145 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 55417C2D0F4 for ; Wed, 1 Apr 2020 11:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 211C92078B for ; Wed, 1 Apr 2020 11:05:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Hszff1kA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732409AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732371AbgDALFG (ORCPT ); Wed, 1 Apr 2020 07:05:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BTBCDlXI+zA7cFT5E+ifbDyWTUdmiynArXdH2xGwHS1nKdizyvzDoQ81T1/rL50/tPTYk9OB63E4iMt2lQe2yrjyfMdTjVYrTyp+SmPco67ZLj3jR/bQNUJQvW5YKQ1HBsBDWDMAIyJyNF1FKGAbRMVKGYE4UT7iMuySx6A2G/pc4R5vPfTZlp0rP/IsgkdD8Wbllo+P9HRSfKaPv+XIM2CgyZMObRYRyn+wf71nRy8Ez0DLu6A+NGFJY2o2x+f8LqCehymwmhbUQgBLjZhdTUZQUaobK6dtOGDr7MuQS/NFsU6kcO3yv85gpsTaP2AynoIiNK8WQRTyYZBzstQssw== 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-SenderADCheck; bh=xQ7YYdW/7wdJYTGnqtNObTowuAlDxIcPNkAKBaBDW2w=; b=D9jsXmCn3nKL7NXE6qsACmCjLBvvpbR7rXN+vTU7I60PH7gLuPaHVShj3wMOhC42gkBtA/DnNvzDVCEwptFdvXccMKeZT5zIY6ttc+B1AE/gNbhYvDAlpiAzfYkAitdtQxryskTE3in2wJnsETK1phpYm4Nk9aqT1iViHhECZskmWol/zQvtQSo51OcKAwNbI58zq9T899uDDvo05yoqb0CgG1nZkbpFCl3PZnVk4EWF5Q8vSiiwCfUGGKBPveoJBAsvpAY7oHg28DSAkOQmJ09lhom1iJi2V+d10Td5NgUnY0LWSc+uSTiIDqr+V231M7dZBe4nXBA2B2D+tV+Kyw== 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=xQ7YYdW/7wdJYTGnqtNObTowuAlDxIcPNkAKBaBDW2w=; b=Hszff1kABiaIVEwlgQU3casYo8wg0imDSg/eV9TPH5mXL+zbszjEUtRphbg8xaiQFVBfWb+xVq9kmY2b8mmZsirxdHFXNEyc8ZBP2rbHixKS682DIPtUtyvmKLqEFIkjLY9hW2cN0fg+Mkul0t7tXBxseDdFChXSwn6v/APvQps= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:54 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:54 +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 17/32] staging: wfx: drop unused link_id field Date: Wed, 1 Apr 2020 13:03:50 +0200 Message-Id: <20200401110405.80282-18-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:52 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 882a91be-f4be-4538-3a7a-08d7d62c81dd X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nH5nLn8Z2GvzYZUtAkvlfuL27YNTX1DrPgl9yoc0K0wcnOXfbjBp2Q3i+zc9jQr9HaKaE5i6LDJEoOU+zwSIj8aGB0lfZo4nt8LcaVye1IQT/K7Wl3XcvromSlfPenjmZ7n//CR1u3Q2AVbLBJpPxGs3OLQE+KvCBhS58aw0TzQlcfTpMety7aX/IJoD36sVQGc4+o0lEjmCFNtXDnrOgFfQS8x2bIxGa3UH8rJDAHgWJWzfpWAARQS8Lq2xoDSyC7jZb+jeY7JNubYgba/3eHuauFwSz8lUVMFm4yQ0Fe1ASpmItS947kocZYgSYCeGJOUp4I6dejN6HT/SQ8NDgtU8noH+fZubeV4B6Pz8qnWwRCWHkErS3oZJgda3zTOVHCuYZW1Os7WI24XcQEK6o8uh1S2h0Ba1XUhVpunb5gbtsxYiLvydaJaWZCfY9s+E X-MS-Exchange-AntiSpam-MessageData: sUeLyMOVLHInnwxBcso+5DPv+t0LUuY8TBbNPyTBLvL2XTYh8UjJz6J3vjavF5guKLdaZPIzQ8C6PYNP3Vqcyl5gmPyjShaXq1SUcPB6oJd4WP2KvTRCGzj3eG0cjBfYRze5XWvprNKr08d1ZSWznPZ+uoq/Q+nJ1Y8BOM6c7NChhZUysLkJn9snz7103lLA+ZQ/gBDxahj4JVzjpyvuDw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 882a91be-f4be-4538-3a7a-08d7d62c81dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:54.3977 (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: 6RROmdASlC6TMrFEpdSB5dmamjBs/Y2v4wxUtUUe1ICeYVPcZp7qMBVOgk9r3mYYDH1dEY7jiZVxjLN6w6Uoyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It is not used anymore. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 5 ----- drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/queue.h | 2 -- 3 files changed, 8 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index a53e6d15031b..f794212f42e2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -424,13 +424,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Fill tx_priv tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; tx_priv->raw_link_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); - tx_priv->link_id = tx_priv->raw_link_id; if (ieee80211_has_protected(hdr->frame_control)) tx_priv->hw_key = hw_key; - if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) - tx_priv->link_id = WFX_LINK_ID_AFTER_DTIM; - if (sta && (sta->uapsd_queues & BIT(queue_id))) - tx_priv->link_id = WFX_LINK_ID_UAPSD; // Fill hif_msg WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb"); diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index c545dd75449b..b561bbf9f16f 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -36,7 +36,6 @@ struct tx_policy_cache { struct wfx_tx_priv { ktime_t xmit_timestamp; struct ieee80211_key_conf *hw_key; - u8 link_id; u8 raw_link_id; } __packed; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index dd141cb4bf63..39c265e4b86e 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -14,8 +14,6 @@ #define WFX_MAX_STA_IN_AP_MODE 14 #define WFX_LINK_ID_NO_ASSOC 15 -#define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) -#define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) struct wfx_dev; struct wfx_vif; From patchwork Wed Apr 1 11:03:52 2020 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: 216138 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 C611BC2D0E7 for ; Wed, 1 Apr 2020 11:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91EB02078B for ; Wed, 1 Apr 2020 11:07:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="kUGyQSZj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732684AbgDALGu (ORCPT ); Wed, 1 Apr 2020 07:06:50 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732385AbgDALFK (ORCPT ); Wed, 1 Apr 2020 07:05:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JxfSdp57Nq9P/jYpqx9XaKnWBVffmbQkY7aRCRV+5k4TIJ1izReozZ93PEtWY4+x7oN5xCzTw8kMmG20bdBY/1OoxLzu1ldlfHFOnff4SeTYMcuXwDb5a00PfHXhiZrZ48RIEG5XjoGLvUe6pdxqn2zdhFKSxqwHBa75kFQgfOps6ukh6DJ1UaQItyxvaUwtVmwPHtAw/68yVXKWIsiByordJymrJd7mSyl6qKWAvyM5G+nHztR3apDdKDUWXgL8E0QI5Gn/LukQsv9I2gveR18TtKdNpA87xcfF8XBKuyf4rJ2z2BN8QaN5znAW3x7+vXMCb6ur6iv18yBcMMVJaw== 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-SenderADCheck; bh=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=NeGo4z0d0c/rsyMjnNWVNSdmqj/gE4B6Gk9TajDPSbEG1QPbE5frQ/W1TB3Rsd0j7oJHz6IeBMspSOHvy3h2lGRWH+G4Ly+s59y9od4SKp37mmjx77SCnvYgpqL5IqgS0AmB3ucSHJSAsmITUJUd+eiyabbggKCBvBbzqwcQpZyF7WqCbzvVq5hBolCV1AnL6aRsf0uxsAK+RwZppZqVa1h7h9Z8bufwbtXqdO8XOEQz2Mso5cCzIgLMBgBQtMjqXs+QGr0slTZWpxxIDq8crnrhUzJG6wWSKaypgLIhZmlb2o7IcPT6C9f35xM+fSH+jNsWwvyC01Hqu4mjGrRKow== 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=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=kUGyQSZj6XrveZvStbiTZeiKsrQ3zRDz2HJlZFHBWdmgMWW+CeLnsZCuzrwDzlTAVV9dXQIUTdf1PpXw6e7tU9XP6XSkBh1/eflQDxFkC8nDVluNWklV+t+oTZVKvNn5kUyGWiXklsF9hxHCdqoPPoEOJmL6qbLiOyxfXJKnJ7I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:58 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:58 +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 19/32] staging: wfx: rename wfx_tx_get_raw_link_id() Date: Wed, 1 Apr 2020 13:03:52 +0200 Message-Id: <20200401110405.80282-20-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:56 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q9zUhpqgxqqv8ZjaFNhaYMXt7WrZ4GuYgSVd4M0wAL1wqvyGv93PT0loDcZn7P9WCdv+QamHuHaI68x+apVucqYj5j5oV14pJCcEpXncPFwHJ3Bh6bb+6y/d5Zbb0n0eIgutooJtEnTfOGVcmeSoNlMagkcjrpeq/LGep0/ZguaueX2diNIontXTw4xkRlHbBwQSMHo7jSgSFcV2HSYUCBhgharNJYWuMtUpa2TLBK5lW17GF+WLOdemhS5j+ibEfLMcmBXtyHlkNyGzEecVOUAO29CTg1cSQFpJUQXzEol3w/sFlcEVmbw+sge55v1RQ/n2IWtzS3h2bUS96RWROIb0DgQcE4pLmm1k2Ku0QcMapraywjcXnW9Yd4KXo2Jt9RKzn4w2+E/Pb68GtorTnJt2EMBVfVVpjZ+kxzaz4lUdlDMw46yoTKDaFyMPDVtT X-MS-Exchange-AntiSpam-MessageData: Pvz7a6q0XqtwnaQ5tjvPVXv7TK3DEAMy57hvDsaNvQfrmyHLEJtYTUdwEvOzU03VfJLQv1hUO7eRhawpyy9STf7dAY6uUQ7dif7aFRnxStKmz7VMxMeGNJgQGPgzq3jO2ZhhwRmvhD1d1rwJLGYO37mRdCzaV/LOTrpEPVVwrfz2HZB7cC/G7uGwaXYbDRDFCUmgWYSXyWgSxa5tIVWSXA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:58.6613 (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: TWKqyKnNVh8EygrHsI4t0lsmLbND3oBWnRJgPcENrSIwJ1mtWYujRSa5x2+0ElDfbXcTPYnW84Rt2yHJtSAUag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 57afabc102a7..2533d4f53f83 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -287,9 +287,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, } } -static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, - struct ieee80211_sta *sta, - struct ieee80211_hdr *hdr) +static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, + struct ieee80211_hdr *hdr) { struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL; @@ -454,7 +453,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; - req->queue_id.peer_sta_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); + req->queue_id.peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); From patchwork Wed Apr 1 11:03:55 2020 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: 216140 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 5592EC2D0F4 for ; Wed, 1 Apr 2020 11:06:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18CEA2082F for ; Wed, 1 Apr 2020 11:06:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="iUvtOZKL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732659AbgDALGf (ORCPT ); Wed, 1 Apr 2020 07:06:35 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732412AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IU1KLuT+XjnOvOM7FyShH9zSPM4yozWCwzMuiR/WKHVY8kv2kkYyb5/8c9qcCRqs4DTDyOsPq+fCZbXiZm3yB3p2vAGNyLMmLLBUxryFoX9uc/4R3C0YpEJPnd0FTnuquBC45/NovEHpvtGGw8jNkRPnCH179+dI4cYsDwHy+QtDjJx4xlVQpZ2Zz7vpq41twiptL8pscjZLkwv9JwV5IFciQ12aG38xoADcQO2+tCGjwOKgt88kR4pvnCXW0fLrJiYdw5D8Pho00kO3ZlvfMPqxX27eqxBPuM97tRNevtb7aD6Oq56RsJ79aOqR2TLEwQcsnxkDdBL+KkM39IcXbA== 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-SenderADCheck; bh=5afC7/e2E2WYAJ4SwTxjg+t8JqdclpcyhV0d8Fdr3ss=; b=MbBlO4QQ+Lp3VKZjm+tZe9iuhNeH5ztVb4s2tALit5mwlVOwEWOpZ3qBZ8W4ck5S2cNZb/tS1y7roHNhF8Hbx7/DPFW7qTUJz/GheY+S36hZpzeYI07StdWzgtogIr5EAnv3E1XAXA/k8xP0Nm1rWAIUZsmxnMjkT9deFbQBUY8yYRLUayLFobL1lAfYjyvXA9PZ2ZDWZxM/VqBGyTPNbveD8uJQb053iUsMO3DyxVPH+vLoSv7ff7bOhXFatxoma+km+r0dg8JMh/obL9TceLm0PNHA+o6zDitJY3oYYIKlt0pCPY02bmq6mI6ncwd4A57zi01A6PZDiHcDZZptUQ== 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=5afC7/e2E2WYAJ4SwTxjg+t8JqdclpcyhV0d8Fdr3ss=; b=iUvtOZKLHqCg2lJIEO+Ddt2eHqzKD5MjGcCS74810FKuziDMi4cVd6dKbxsZxSEKALcdfn+Br20kX+wYUvCPlC+W/yY/FWY/RDZQief3LbhwLyzEyir+iMLafTKV23nYJ6VSlqCfQ0j1J7vZ+fCESl1OylicnG0xoFSbFpFCQ8A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:05 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:05 +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 22/32] staging: wfx: change the way to choose frame to send Date: Wed, 1 Apr 2020 13:03:55 +0200 Message-Id: <20200401110405.80282-23-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:03 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9aed5a88-ca27-4147-6eb8-08d7d62c8809 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(30864003)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005)(43043002); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2B4e0fQ3E/Bgqk+G5UOl+1NAT62eEHLa9X9ownQ+sinbVsuUqdm0xKdtfvCmOFSYiSiaSybzvPdpnLG4xdqbNOLLG/d5ksQ2lIgvl4zdDfJ1nmckEYLQyY6qaWe+A/IdxpxSbVZ5tvgV/VUycqWe7u3B/GdMPoq3O1q5oZDPWp1sEYg6BFJEf8x7yFE8bgXoBUUHdWoRCt4uINgJQblDY5XfY7YQcq7hQ3DLjz1aP9Qv81XUs/j1e/uYx7lyv5uzWTuPPCZPfbbZk+An6Y1BvwZKqYK1ir+j78S3vpIRZWNXll1fT94QCefkUlFmzV7boYkF7r5N/+NA1HLVaHbwI8QDYGg/pvDSPfSeWzTvGdv6nVk/5ASDtxPkqb1J9R7UXfB0qJ4HBkaU6HpsH9M7LeOTNwB0sjE7eEVHFV+loux1tyo8JAT1Xy4a4wEt1EBDcpHQ/AVMsoo+gZNAhEavE+Y4I90eHnAEv39ZbkDq21UJmlxsnToLszS5GZq1MW89 X-MS-Exchange-AntiSpam-MessageData: QfFAk8RoP033863JpAgQRfXTLWqN8sH5qOtcQyopEtxC8yXgOLp0KUp0oqYIaLsA3IrkgwZDSSz6Sut1lImjPyEko2gzn15XUhCixWdhwHfyDKlSBYjsSSaveyFhjleDStHR+VYjSC/wWtamSIopK5ovLBwhrwqIPwLNrP5+6mxROgkmVrxRhJi1PpHyAhII8dKf03ibm1JZDiNDLjuflw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9aed5a88-ca27-4147-6eb8-08d7d62c8809 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:04.8687 (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: cZJM4w1Th/IBphaOc7TKg5fqYkw2IShH1u/cSTYvguPpHLzbMMY92BJICvKlS/eqj1ef5zXAjt8zT9+VIvot7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The current code computes itself the QoS policy to choose which frame should be sent. However, firmware already do that job. Firmware would prefer to have packets in every queues and be able to choose itself which queue to use. So, this patch sort the queues from the emptiest to the fulliest (thanks to the pending frames counter introduced a few commits earlier). It send frame to the least full queue. However, we continue to be careful with frames that have to be sent after a dtim ("cab": Content After (DTIM) Beacon). So, this patch splits AC queues in two skb_queues: one for normal frames and another for cab frames. It cares to send frames from CAB skb_queue if appropriate. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 238 ++++++++++++++---------------------- drivers/staging/wfx/queue.h | 4 +- 2 files changed, 94 insertions(+), 148 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 21a2c8aabbb9..b45fb837f1cd 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -83,13 +83,20 @@ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) wfx_tx_lock_flush(wdev); for (i = 0; i < IEEE80211_NUM_ACS && done; ++i) { queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, item) { - hif = (struct hif_msg *) item->data; + spin_lock_bh(&queue->normal.lock); + skb_queue_walk(&queue->normal, item) { + hif = (struct hif_msg *)item->data; if (hif->interface == wvif->id) done = false; } - spin_unlock_bh(&queue->queue.lock); + spin_unlock_bh(&queue->normal.lock); + spin_lock_bh(&queue->cab.lock); + skb_queue_walk(&queue->cab, item) { + hif = (struct hif_msg *)item->data; + if (hif->interface == wvif->id) + done = false; + } + spin_unlock_bh(&queue->cab.lock); } if (!done) { wfx_tx_unlock(wdev); @@ -103,7 +110,9 @@ static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, { struct sk_buff *item; - while ((item = skb_dequeue(&queue->queue)) != NULL) + while ((item = skb_dequeue(&queue->normal)) != NULL) + skb_queue_head(gc_list, item); + while ((item = skb_dequeue(&queue->cab)) != NULL) skb_queue_head(gc_list, item); } @@ -131,8 +140,10 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) skb_queue_head_init(&wdev->tx_queue_stats.pending); init_waitqueue_head(&wdev->tx_queue_stats.wait_link_id_empty); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) - skb_queue_head_init(&wdev->tx_queue[i].queue); + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_head_init(&wdev->tx_queue[i].normal); + skb_queue_head_init(&wdev->tx_queue[i].cab); + } } void wfx_tx_queues_deinit(struct wfx_dev *wdev) @@ -141,57 +152,15 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) -{ - struct ieee80211_tx_info *tx_info; - struct sk_buff *skb; - int ret = 0; - - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - if (!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) - ret++; - } - spin_unlock_bh(&queue->queue.lock); - return ret; -} - void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) { - skb_queue_tail(&queue->queue, skb); -} + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); -static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, - struct wfx_queue *queue, - bool mcast) -{ - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct ieee80211_tx_info *tx_info; - struct sk_buff *item, *skb = NULL; - struct wfx_tx_priv *tx_priv; - - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, item) { - tx_info = IEEE80211_SKB_CB(item); - if (mcast == !!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) { - skb = item; - break; - } - } - spin_unlock_bh(&queue->queue.lock); - if (skb) { - skb_unlink(skb, &queue->queue); - atomic_inc(&queue->pending_frames); - tx_priv = wfx_skb_tx_priv(skb); - tx_priv->xmit_timestamp = ktime_get(); - skb_queue_tail(&stats->pending, skb); - if (skb_queue_empty(&queue->queue)) - wake_up(&stats->wait_link_id_empty); - return skb; - } - return skb; + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + skb_queue_tail(&queue->cab, skb); + else + skb_queue_tail(&queue->normal, skb); } int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) @@ -204,7 +173,7 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) atomic_dec(&queue->pending_frames); skb_unlink(skb, &stats->pending); - skb_queue_tail(&queue->queue, skb); + wfx_tx_queue_put(wdev, queue, skb); return 0; } @@ -282,20 +251,15 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) { struct wfx_dev *wdev = wvif->wdev; - struct ieee80211_tx_info *tx_info; - struct hif_msg *hif; - struct sk_buff *skb; int i; - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb_queue_walk(&wdev->tx_queue[i].queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - hif = (struct hif_msg *)skb->data; - if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && - (hif->interface == wvif->id)) - return true; - } - } + if (wvif->vif->type != NL80211_IFTYPE_AP) + return false; + for (i = 0; i < IEEE80211_NUM_ACS; ++i) + // Note: since only AP can have mcast frames in queue and only + // one vif can be AP, all queued frames has same interface id + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) + return true; return false; } @@ -304,7 +268,8 @@ bool wfx_tx_queues_empty(struct wfx_dev *wdev) int i; for (i = 0; i < IEEE80211_NUM_ACS; i++) - if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue)) + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].normal) || + !skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) return false; return true; } @@ -350,95 +315,76 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) +static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) { - const struct ieee80211_tx_queue_params *edca; - unsigned int score, best = -1; - int winner = -1; - int i; - - /* search for a winner using edca params */ - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - int queued; - - edca = &wvif->edca_params[i]; - queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i]); - if (!queued) - continue; - score = ((edca->aifs + edca->cw_min) << 16) + - ((edca->cw_max - edca->cw_min) * - (get_random_int() & 0xFFFF)); - if (score < best && (winner < 0 || i != 3)) { - best = score; - winner = i; - } - } - - if (winner < 0) - return NULL; - return &wvif->wdev->tx_queue[winner]; -} - -struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) -{ - struct sk_buff *skb; - struct hif_msg *hif = NULL; - struct wfx_queue *queue = NULL; - struct wfx_queue *vif_queue = NULL; + struct wfx_queue *sorted_queues[IEEE80211_NUM_ACS]; struct wfx_vif *wvif; - int i; - - if (atomic_read(&wdev->tx_lock)) - return NULL; + struct hif_msg *hif; + struct sk_buff *skb; + int i, j; + // bubble sort + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + sorted_queues[i] = &wdev->tx_queue[i]; + for (j = i; j > 0; j--) + if (atomic_read(&sorted_queues[j]->pending_frames) > + atomic_read(&sorted_queues[j - 1]->pending_frames)) + swap(sorted_queues[j - 1], sorted_queues[j]); + } wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - if (wvif->after_dtim_tx_allowed) { - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb = wfx_tx_queue_get(wvif->wdev, - &wdev->tx_queue[i], - true); - if (skb) { - hif = (struct hif_msg *)skb->data; - // Cannot happen since only one vif can - // be AP at time - WARN_ON(wvif->id != hif->interface); - return hif; - } - } - // No more multicast to sent - wvif->after_dtim_tx_allowed = false; - schedule_work(&wvif->update_tim_work); + if (!wvif->after_dtim_tx_allowed) + continue; + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + skb = skb_dequeue(&sorted_queues[i]->cab); + if (!skb) + continue; + // Note: since only AP can have mcast frames in queue + // and only one vif can be AP, all queued frames has + // same interface id + hif = (struct hif_msg *)skb->data; + WARN_ON(hif->interface != wvif->id); + WARN_ON(sorted_queues[i] != + &wdev->tx_queue[skb_get_queue_mapping(skb)]); + atomic_inc(&sorted_queues[i]->pending_frames); + return skb; } + // No more multicast to sent + wvif->after_dtim_tx_allowed = false; + schedule_work(&wvif->update_tim_work); } + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + skb = skb_dequeue(&sorted_queues[i]->normal); + if (skb) { + WARN_ON(sorted_queues[i] != + &wdev->tx_queue[skb_get_queue_mapping(skb)]); + atomic_inc(&sorted_queues[i]->pending_frames); + return skb; + } + } + return NULL; +} + +struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) +{ + struct wfx_tx_priv *tx_priv; + struct sk_buff *skb; + + if (atomic_read(&wdev->tx_lock)) + return NULL; for (;;) { - int ret = -ENOENT; - int queue_num; - - wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - vif_queue = wfx_tx_queue_mask_get(wvif); - if (vif_queue) { - if (queue && queue != vif_queue) - dev_info(wdev->dev, "vifs disagree about queue priority\n"); - queue = vif_queue; - ret = 0; - } - } - - if (ret) - return NULL; - - queue_num = queue - wdev->tx_queue; - - skb = wfx_tx_queue_get(wdev, queue, false); + skb = wfx_tx_queues_get_skb(wdev); if (!skb) - continue; - + return NULL; + skb_queue_tail(&wdev->tx_queue_stats.pending, skb); + if (wfx_tx_queues_empty(wdev)) + wake_up(&wdev->tx_queue_stats.wait_link_id_empty); + // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) - continue; /* Handled by WSM */ - + continue; + tx_priv = wfx_skb_tx_priv(skb); + tx_priv->xmit_timestamp = ktime_get(); return (struct hif_msg *)skb->data; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index c24b8cd41a78..8e99bb2792ed 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -20,7 +20,8 @@ struct wfx_dev; struct wfx_vif; struct wfx_queue { - struct sk_buff_head queue; + struct sk_buff_head normal; + struct sk_buff_head cab; // Content After (DTIM) Beacon atomic_t pending_frames; }; @@ -44,7 +45,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:03:56 2020 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: 216139 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 99555C2D0F1 for ; Wed, 1 Apr 2020 11:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 655F82082F for ; Wed, 1 Apr 2020 11:06:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="RgY7f7V0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732672AbgDALGm (ORCPT ); Wed, 1 Apr 2020 07:06:42 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732431AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyuqE/tBDSZxMzwEkCKdSiIy+kgsn0n/RLXKFXvnXHoSgjte5T4e0TMHUgx9CEfu/hvYW2vje2l+RwS3ra32EOV0QRzkcTfv/Wq90ez4aV0a0hr/K/KIKf+lg93Uuc8cPtN40AWr3xEE1M80csF2+aM8Mm6CdUF0Nlvtnx2zMN0SoXiJ+2KgPctX+VqdARCOga/6uj6OkVsZb9BUklgeZH+b2uwBNfn+sLgOX4YF/uoLHB7iTXpgv1f1fm3jERqznnW3Ywfo750Szh0NRGst6uC48t2WffJ3mcPyDvzczUPz5r+X7x++7uzZXiaPxtNn66qTcM52bemEKZAUz9hMrw== 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-SenderADCheck; bh=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=ItZhHK9MYMcbYRxfT05dNZI7KrM1iQQ6ThhOQeBVnVsCzkG6iOm/6xH6y0OCmCK61qA3Zav8FlV1uhLjIhsqj4oZdZag3krPUzCSOr4cDrMjh1t2y8hpqhyBdHHFafS+lki2wMunGZHgV7p2AD4K3KCKgalmRRgk5SKWAZLATB4jYxA10YkD6yeAECRClYjNPLPiDbczxsv+W5p9wkBNdHiK2umVm2kK21SPHQ+z7Y8+gpm+b1iC2jiQFGbRbLYNsbhuNRdoDaOoAvO1OG9xHJA41/zGRRBposZ0ScZyoOC3lq/GYicaes4w+HPv+BZ/KkqHxzbHRnV6DUh8Qavvvg== 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=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=RgY7f7V0FiTRJd9W1erFykLxXLWZ5XDIudtghoUCfe1rkgUK62D3TFTeMXma/xbG2dWR9ihOUjY3xwPhUXpdGQkthct6JJjLZkAtiLF30a5mUl5Sc1aN+4+osoP6er3znCh0B7/o7tAvHdbdiouMhgVSk7hnhIS9NPav3UqURqY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:07 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:07 +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 23/32] staging: wfx: drop now useless field edca_params Date: Wed, 1 Apr 2020 13:03:56 +0200 Message-Id: <20200401110405.80282-24-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:05 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hmHILPmTYSTaHZ8WCEY0xJi70LX6RPxqUb8eHFO7R1SHZxtB0Kv5ndwefKGwxSmvySX9ngx0QqBL45AiGyK8Awhs4yPWH3+fGPl2yzTZzRHMHkd1PfB3pIW4v81gQJDdYFszA4YZzxB8TFi0zn76UIjvG2TljU2af+e4J9pk0JhnpgvKE6xEzRhENCSIH0KZoetUvNeGRCvn+joW/zbXvI+R/VWgTP38aIP8R9QZbKFo3p47PfPDah0T+dJcsmzTsJCoAyQII0HSoHQfGbXOV/hPEqH0+moT32FtkEaryfvWJZqn2rNbbcpURjIcyZQVmUuOagvjhGg5uc2psTz3zia+zd8MTpxr7Gw3I3dc76ltEHtAh6EnQGTjbjREjPQhY9QTVZWvZ51zGLTz5VmKtt/ogTzNwY7+C5JJczu1rkD+ex8JKJM88X+iAkdXx8wk X-MS-Exchange-AntiSpam-MessageData: NKqazT9u1bmKhdCmpJENthVZlJjuMjbOEPzNiYIs5EcloXEI1uhP9+CKn7N1VyM9WfyhzI3Ps3RATvyUsbsejHXn0PrqVINCbKMmzrVa237R+4lXXxjcc7LCgbosDQMWgSVA2st2t7/rQJc2zJTZzKP4FfCxw5UdOlj0DsMfsHZFVrvzNNw+1Y6WKNUCR0pp2rX0QjRQJ2GJ5zEzfvvAXQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:06.8915 (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: RGq1e84p6mbXbCkAJARsHLnfIWN0AyAo6/+RkoBnu2PPkNs6on2mbFFbOxZ88gIFBjfXmgNWg8vM62+pdHzjiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e1d7a0670c9d..15f00ea84068 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -298,7 +298,6 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mutex_lock(&wdev->conf_mutex); assign_bit(queue, &wvif->uapsd_mask, params->uapsd); - memcpy(&wvif->edca_params[queue], params, sizeof(*params)); hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION && old_uapsd != wvif->uapsd_mask) { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 61899cd7942b..6b5b95a45e60 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -94,7 +94,6 @@ struct wfx_vif { struct work_struct update_filtering_work; unsigned long uapsd_mask; - struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; From patchwork Wed Apr 1 11:03:59 2020 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: 216141 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 C24DBC43331 for ; Wed, 1 Apr 2020 11:06:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8405120857 for ; Wed, 1 Apr 2020 11:06:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="lDoAZBtF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732638AbgDALGR (ORCPT ); Wed, 1 Apr 2020 07:06:17 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732478AbgDALFQ (ORCPT ); Wed, 1 Apr 2020 07:05:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiuOc9UUKb2YIfQYsT1sQM1b4h6rDJcMqqFS1bKl/n5I9NBxw2+EjlijqQfmen+QTXhgwFFPIUeLEWn6O0yT5iaz6ScCBxxzx+6r2lP5YnVZcuVrq/1avTAAAnfydAxS4hIg3GIL2QFA+4O2m0Rjla6jd5r8xNRkUcd8sKasCRPSNV6W6ic/NCQeW96cX5Wnr+JhoPcdA6UztKgAXxL50JuLniqOW63+sjyhS8RlRrVdSyt4+ZQwqDXcPTHmg8dlcTqNswpvZG2ePb1/Qbnb6jX2I4wEfuExGN2HS6AtMTdeYZus8QZn7LFDnhIimMDNYRcaxUPoHOFpIgyo4j9qiA== 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-SenderADCheck; bh=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=hbMMmN1mhanqW0eVozOPCYKmNE6eiX5xdjStQG2LwxVpiWyjIgIzJI3hA2J/YHrOA+ydlmu3LTA5j8MQdT6m6TCAZuKL6sF578KEmVWn9jo5vGlvxW+0PjNbpKNAS+nFz4e3+rk7r9YB9ij3pDAaokP9ucveaCW41VqEow8nnufU2QRKtvE7swEU9APxh7XZUwll8IK2tmpjN8QFnLmB1nhDhbCc1IFrC8Zj0uURfjDG/ZwZLvhBcepUTnykJmlbicJW86Aq7jmlwNfiEQNOW6sSvPS4mOaSJ3Fi2akPBDRjwDFj5eg4scWILj6Gwh0OPb4a7OC03NDqmD137G/1TQ== 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=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=lDoAZBtFGGcMdA0kfRASUGKxWPZ3ctMXJpNMVS1XVfc/rIUcqMjgtipX+WW9TipT5kRFDzPP5Kv+52rYyiUPBhNInnqENBsliRq2dQDSVJEPSbm3KClpJNNvcvlb+T2LwRQdpmA1R7VW38PN5ksK5dPAppMFBdfhnrkN6Tnyuao= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:14 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:14 +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 26/32] staging: wfx: improve interface between data_tx.c and queue.c Date: Wed, 1 Apr 2020 13:03:59 +0200 Message-Id: <20200401110405.80282-27-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:11 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ctcs35DUbRf2jjxtaIJt/OZH50BOMMP/3GMj37QfEFi8DhsXm+u3KmRY1jZNhI+QDE8kZfvdlqo4kAB0by0IU0FaYSXpxf8rhD6aMR7tOTEQ2pBrDJgdtrK+u3XdIWDm4R752IhevIMb06R2+Vyp7jNwEkjeb2uk0BW6eliC39aeJviURE9FnLH6vuFJKeyEMdgei67/Ye0xmy684nQjVAFE9QIPmWusCAOCivRxYpA0ufCzgJbfE5WXIr0yu89t85KbM4zQ9XwocBJ3wUo6yShJw8DkoWoJ/EW+ZzOUx9fYO0Ksorf4Z4zyh5KzjrW0WKdtYzbdz8huzXdiziXS0rkRzSduw3B2QXv51K/7Ndg4zR2aIZdEIzJzJWCmHwEdh35QjrIvgNmTyP+QODcguNVi61ZmBvr1Xy3kxCvo9oFGMT8dJZkxM4nIs8rnPWVO X-MS-Exchange-AntiSpam-MessageData: o1fbsVfMdt7w74HbnjKvV1u9FqGuaCryNJ/XBVbfyR6LYOYhaBwe57Uzv11dG2UrUYw5BSIwhySgfvq8ESKCMnBawFfL478iTp3TFYlQLcDPNK/Ghx1vMW3/LlPvZj4aYWGCtRUWGU7Cin7jSvIeb5EkW7QVH6LiFCEgLRphr07e7JGW19WoMS4UU7bRpXLNTK+5GFxU0R8dh6cAfRaT8A== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:14.2343 (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: xIEKb6xF6ach2a3TxsvXYiEBqbkVDrWNlRVjoD0JqGKbt6nJdfwDS8+6wMVQ99nEc52KHiMrql+p/por0eungA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/queue.c | 22 +++++++--------------- drivers/staging/wfx/queue.h | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index d2e925218eda..17209f645e4b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -586,7 +586,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) arg->packet_id == wvif->bss_loss_confirm_id) wfx_cqm_bssloss_sm(wvif, 0, 0, 1); } - wfx_pending_remove(wvif->wdev, skb); + wfx_skb_dtor(wvif->wdev, skb); } static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cc89bfe1dbb4..a1a2f7756a27 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -174,30 +174,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } -int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) -{ - struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; - - WARN_ON(skb_get_queue_mapping(skb) > 3); - WARN_ON(!atomic_read(&queue->pending_frames)); - - atomic_dec(&queue->pending_frames); - skb_unlink(skb, &wdev->tx_pending); - wfx_skb_dtor(wdev, skb); - - return 0; -} - struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { - struct sk_buff *skb; + struct wfx_queue *queue; struct hif_req_tx *req; + struct sk_buff *skb; spin_lock_bh(&wdev->tx_pending.lock); skb_queue_walk(&wdev->tx_pending, skb) { req = wfx_skb_txreq(skb); if (req->packet_id == packet_id) { spin_unlock_bh(&wdev->tx_pending.lock); + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_unlink(skb, &wdev->tx_pending); return skb; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 4851635d159b..9bc1a5200e64 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -41,7 +41,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); -int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:04:01 2020 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: 216142 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 AE46BC2D0E7 for ; Wed, 1 Apr 2020 11:06:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BA6220857 for ; Wed, 1 Apr 2020 11:06:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QeQL0PRe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732597AbgDALFy (ORCPT ); Wed, 1 Apr 2020 07:05:54 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732335AbgDALF0 (ORCPT ); Wed, 1 Apr 2020 07:05:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYwJuLeIjzyHei4R6hp8da/xyM4Px2sCIpjCHvIfxa8DyrvIwHFoV1eWvc8LWR+MdhnxEJ5M9T8IWBvnjLFmgmWnP1Ze4mn3tB98mPAHw6c6DZEa7lxnPkGtVaMr2GuvX8+uJU7GCxhoQziagm+sZju1TAUbfFqqkhJSC80KAMEnjNEuZg1FoHQ1LdaZenEa2GTnX7bxMvEvYGg9iK/4lMS4cVGU2fMBl6QPe1KfMfOd/+MC47oIEoB118iuH+7YuHCTETnqKiY5SDyUjQ13+q38cHEK1p8h/RP2vouCDZ9tD86MOjcKeRt0TUrb1IHSD2qNgndO6lNRBWzyXS54Mg== 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-SenderADCheck; bh=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=hMV1pl9pYRbdja1pVRfoVn9rEeP+8Sls+ankDCl53cmwAraXCThNpVOb41CGt3gMIhrtQu7i2mHjcVhvh5tjt0v4wQS0UxcMdJ2Ywt8L6jRSwVLwZGAw/oGG1TMYdpMVPK5eq5JldGaUZItD0TPnbRSba3VH5cGp2MbSKDcXO/cJOZJjCJ5RW3Ml7dPPAAxWk1vBgsaT6BDaZatRnnsBkfrAzHoFfsxAW4GTU7fhiSJaD+zjDkpxFg6uFs4psWwge0LX71MzqFgdPDkwiI9wysB+K6qSbLjdbaxE/UrN15XwYaOAX8ASZW99H6fXrgy2R+i6SrUpQG+WunvwQANqAQ== 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=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=QeQL0PReTdid74e7ikpvvft+CbU6a4YJoTPS7iBvN1KcY2C5WTUPCKBeUYCvJQY+r+yZ24wOKxlh/DYnju/9okvnJbqIV1RWlbUiD5IRXLlR9ur38EzhSSBSJvG7JYbVyvmQrLleRmpjgeGnBf0qCPSVFCVmPRGGsgD+xkC0Z/I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:18 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:18 +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 28/32] staging: wfx: repair wfx_flush() Date: Wed, 1 Apr 2020 13:04:01 +0200 Message-Id: <20200401110405.80282-29-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:16 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(30864003)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /fepGjL8ioX+pJ3isCWbu1pQm5Qex5fi+clOppf8Lnya+ufxBCQhvD3+Tz7KAMpsrvasScQAH+FSfcj6aSDxsOG8aC2XW+NrvrM2U6Mc+MXbH4eDetwAcCjv3TH2yQDnCTYXT8EePaF50ZIGJGksU6dwhr7nJs4QUfRgrK4WhPiVVZuGY3vDk/oXOgWrIDRkejlvb5M1iw2q6T8lAU6VuVaf+okxI03uNFad8QSCUBHHKpefQn2v2gRDNNZ6Cvh4AeLyLqO3kIruOrO5XP0trtixesNUdgl24U0Fin3zfmdFdaUs03B64QzRBbwITUJIN1vTCK7Nquc+pldv3fnnXz06Dr0mpzjclOWQApkNRna/PEbAQANh5x7w12yD6E/jPd9X1Aki73+LhLGpIetAza2ssjw2f69txUDF4GLhDNDGGfnOMVlDt3Bi9fFCzp8R X-MS-Exchange-AntiSpam-MessageData: lsRitfDkjNZ/rO2AZkNBOoWxnWRr2t/XbdAY7cOOEc8s4uzBDUvOAbFOXtheEYxA30EtNnoFBa2q8QoozDoRM6+bNNGAWCSNVerwekrb9nt89/mDCNTa/E4DhkMLndgQ9wqt+5W5OotxYxf6mGZ1Nar62H3l4IHRqFzgDne33DQwlZXxoPUBsYQtLX4e18xRbmEUNdFLMZRtCzUCnvkGUg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:18.4408 (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: i1x5HgyHfXP9JbuwYOJQedORVRtgEnpSSrWaF41bVfrdtvPx5wUKTGJPsQLd+SggkCA4sG55me4nzl+C69IEBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and maybe a resource leak) when the frozen device was unregistered. We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to work around the broken feature of wfx_flush(). This patch repair wfx_flush() and therefore drop wfx_tx_queues_wait_empty_vif(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 34 ++++++- drivers/staging/wfx/data_tx.h | 3 +- drivers/staging/wfx/main.c | 1 - drivers/staging/wfx/queue.c | 163 ++++++++++++++++------------------ drivers/staging/wfx/queue.h | 10 ++- drivers/staging/wfx/sta.c | 36 +------- drivers/staging/wfx/sta.h | 2 - 7 files changed, 120 insertions(+), 129 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index ec95518c9167..1d9a8089f3d3 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -524,7 +524,7 @@ static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) rcu_read_unlock(); } -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) +static void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_msg *hif = (struct hif_msg *)skb->data; struct hif_req_tx *req = (struct hif_req_tx *)hif->body; @@ -626,4 +626,36 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_skb_dtor(wvif->wdev, skb); } +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop) +{ + struct wfx_dev *wdev = hw->priv; + struct sk_buff_head dropped; + struct wfx_queue *queue; + struct sk_buff *skb; + int vif_id = -1; + int i; + + if (vif) + vif_id = ((struct wfx_vif *)vif->drv_priv)->id; + skb_queue_head_init(&dropped); + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + if (!(BIT(i) & queues)) + continue; + queue = &wdev->tx_queue[i]; + if (drop) + wfx_tx_queue_drop(wdev, queue, vif_id, &dropped); + if (wdev->chip_frozen) + continue; + if (wait_event_timeout(wdev->tx_dequeue, + wfx_tx_queue_empty(wdev, queue, vif_id), + msecs_to_jiffies(1000)) <= 0) + dev_warn(wdev->dev, "frames queued while flushing tx queues?"); + } + wfx_tx_flush(wdev); + if (wdev->chip_frozen) + wfx_pending_drop(wdev, &dropped); + while ((skb = skb_dequeue(&dropped)) != NULL) + wfx_skb_dtor(wdev, skb); +} diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 03fe3e319ba1..7f201f626410 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -44,7 +44,8 @@ void wfx_tx_policy_upload_work(struct work_struct *work); void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop); static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) { diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 5e1a7a932b53..738016d45d63 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -267,7 +267,6 @@ static void wfx_free_common(void *data) mutex_destroy(&wdev->rx_stats_lock); mutex_destroy(&wdev->conf_mutex); - wfx_tx_queues_deinit(wdev); ieee80211_free_hw(wdev->hw); } diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index a1a2f7756a27..d4302a30dc41 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -62,92 +62,79 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -/* If successful, LOCKS the TX queue! */ -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) -{ - int i; - bool done; - struct wfx_queue *queue; - struct sk_buff *item; - struct wfx_dev *wdev = wvif->wdev; - struct hif_msg *hif; - - if (wvif->wdev->chip_frozen) { - wfx_tx_lock_flush(wdev); - wfx_tx_queues_clear(wdev); - return; - } - - do { - done = true; - wfx_tx_lock_flush(wdev); - for (i = 0; i < IEEE80211_NUM_ACS && done; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->normal.lock); - skb_queue_walk(&queue->normal, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->normal.lock); - spin_lock_bh(&queue->cab.lock); - skb_queue_walk(&queue->cab, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->cab.lock); - } - if (!done) { - wfx_tx_unlock(wdev); - msleep(20); - } - } while (!done); -} - -static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff_head *gc_list) -{ - struct sk_buff *item; - - while ((item = skb_dequeue(&queue->normal)) != NULL) - skb_queue_head(gc_list, item); - while ((item = skb_dequeue(&queue->cab)) != NULL) - skb_queue_head(gc_list, item); -} - -void wfx_tx_queues_clear(struct wfx_dev *wdev) -{ - int i; - struct sk_buff *item; - struct sk_buff_head gc_list; - - skb_queue_head_init(&gc_list); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) - wfx_tx_queue_clear(wdev, &wdev->tx_queue[i], &gc_list); - wake_up(&wdev->tx_dequeue); - while ((item = skb_dequeue(&gc_list)) != NULL) - wfx_skb_dtor(wdev, item); -} - void wfx_tx_queues_init(struct wfx_dev *wdev) { int i; - memset(wdev->tx_queue, 0, sizeof(wdev->tx_queue)); skb_queue_head_init(&wdev->tx_pending); init_waitqueue_head(&wdev->tx_dequeue); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb_queue_head_init(&wdev->tx_queue[i].normal); skb_queue_head_init(&wdev->tx_queue[i].cab); } } -void wfx_tx_queues_deinit(struct wfx_dev *wdev) +void wfx_tx_queues_check_empty(struct wfx_dev *wdev) { - WARN_ON(!skb_queue_empty(&wdev->tx_pending)); - wfx_tx_queues_clear(wdev); + int i; + + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_pending)); + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + WARN_ON(atomic_read(&wdev->tx_queue[i].pending_frames)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].normal)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].cab)); + } +} + +static bool __wfx_tx_queue_empty(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id) +{ + struct hif_msg *hif_msg; + struct sk_buff *skb; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk(skb_queue, skb) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + spin_unlock_bh(&skb_queue->lock); + return false; + } + } + spin_unlock_bh(&skb_queue->lock); + return true; +} + +bool wfx_tx_queue_empty(struct wfx_dev *wdev, + struct wfx_queue *queue, int vif_id) +{ + return __wfx_tx_queue_empty(wdev, &queue->normal, vif_id) && + __wfx_tx_queue_empty(wdev, &queue->cab, vif_id); +} + +static void __wfx_tx_queue_drop(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id, + struct sk_buff_head *dropped) +{ + struct sk_buff *skb, *tmp; + struct hif_msg *hif_msg; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk_safe(skb_queue, skb, tmp) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + __skb_unlink(skb, skb_queue); + skb_queue_head(dropped, skb); + } + } + spin_unlock_bh(&skb_queue->lock); +} + +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped) +{ + __wfx_tx_queue_drop(wdev, &queue->cab, vif_id, dropped); + __wfx_tx_queue_drop(wdev, &queue->normal, vif_id, dropped); + wake_up(&wdev->tx_dequeue); } void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) @@ -174,6 +161,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) +{ + struct wfx_queue *queue; + struct sk_buff *skb; + + WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", + __func__); + while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_queue_head(dropped, skb); + } +} + struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { struct wfx_queue *queue; @@ -249,17 +252,6 @@ bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) return false; } -bool wfx_tx_queues_empty(struct wfx_dev *wdev) -{ - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; i++) - if (!skb_queue_empty_lockless(&wdev->tx_queue[i].normal) || - !skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) - return false; - return true; -} - static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_req_tx *req = wfx_skb_txreq(skb); @@ -364,8 +356,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (!skb) return NULL; skb_queue_tail(&wdev->tx_pending, skb); - if (wfx_tx_queues_empty(wdev)) - wake_up(&wdev->tx_dequeue); + wake_up(&wdev->tx_dequeue); // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 9bc1a5200e64..ab45e32cbfbc 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -31,16 +31,18 @@ void wfx_tx_flush(struct wfx_dev *wdev); void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); -void wfx_tx_queues_deinit(struct wfx_dev *wdev); -void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_empty(struct wfx_dev *wdev); +void wfx_tx_queues_check_empty(struct wfx_dev *wdev); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); +bool wfx_tx_queue_empty(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id); +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 340e09bb639d..b1ee02d2f515 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -318,29 +318,6 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) return 0; } -static int __wfx_flush(struct wfx_dev *wdev, bool drop) -{ - for (;;) { - if (drop) - wfx_tx_queues_clear(wdev); - if (wait_event_timeout(wdev->tx_dequeue, - wfx_tx_queues_empty(wdev), - 2 * HZ) <= 0) - return -ETIMEDOUT; - wfx_tx_flush(wdev); - if (wfx_tx_queues_empty(wdev)) - return 0; - dev_warn(wdev->dev, "frames queued while flushing tx queues"); - } -} - -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop) -{ - // FIXME: only flush requested vif and queues - __wfx_flush(hw->priv, drop); -} - /* WSM callbacks */ static void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi) @@ -843,10 +820,8 @@ static int wfx_update_tim(struct wfx_vif *wvif) skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length); - if (!skb) { - __wfx_flush(wvif->wdev, true); + if (!skb) return -ENOENT; - } tim_ptr = skb->data + tim_offset; if (tim_offset && tim_length >= 6) { @@ -1062,8 +1037,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, } wvif->state = WFX_STATE_PASSIVE; - wfx_tx_queues_wait_empty_vif(wvif); - wfx_tx_unlock(wdev); /* FIXME: In add to reset MAC address, try to reset interface */ hif_set_macaddr(wvif, NULL); @@ -1097,10 +1070,5 @@ void wfx_stop(struct ieee80211_hw *hw) { struct wfx_dev *wdev = hw->priv; - wfx_tx_lock_flush(wdev); - mutex_lock(&wdev->conf_mutex); - wfx_tx_queues_clear(wdev); - mutex_unlock(&wdev->conf_mutex); - wfx_tx_unlock(wdev); - WARN(atomic_read(&wdev->tx_lock), "tx_lock is locked"); + wfx_tx_queues_check_empty(wdev); } diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index cf99a8a74a81..a0c5153e5272 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -54,8 +54,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop); int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params); void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Wed Apr 1 11:04:03 2020 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: 216143 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 174A4C43331 for ; Wed, 1 Apr 2020 11:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D43042082F for ; Wed, 1 Apr 2020 11:05:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="m7Irli7C" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732252AbgDALFb (ORCPT ); Wed, 1 Apr 2020 07:05:31 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732441AbgDALFa (ORCPT ); Wed, 1 Apr 2020 07:05:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LD9YXgC8s5iH17VD0Q+uPsF+Za1tE0ewPMu3aL2PLMfc78Y3IDZdh2QBzIM0fEXRpupbKRyOsSdCBLeUM7VFVIVNBrydg8OSJeBiD3CWPQHryQSLmyP1TQPz2zjR8SRMTXuQJmQH2hrBSxtIB1Zffn9z5uAX0cnpMO/bqx16FqWTs5Hxq6zVn+qHrHG19DahzMPvLGTeXHtp1ShTlucIDiCBSI6kej+MOAthWovsUHTkUZES2c29JkMJkv3dYHohtpYjEdIZ1vs9LC4MIWs5OwHQOUdY7jSi6a0BDRX/iEeCCR3L5RnqMaXQHQ1Njf89R6/ospMk6gMROO1KDfp9/Q== 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-SenderADCheck; bh=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=h8k/we5CAX42VywcNT5NdlKOEYBtD2sbgB0nmz9Qv2RjktXcZXLCsNdiUKDYGK2goU09Uuw3oyHlG5rcd3o6/AyFDnCBX/c3p8LG+CyQ5/x6gCISd66Ed1ceHrXRVpYh/BRvH673u9lgthtOzwb/AX2dpSgYUKZs7UhwNkZba05JzWIVAboJ6TSivIw2jt7/ngTCKWoX2vddZBp2DQIrkT1tklsiIom4SuusIo13Rb/toFODgevMmSyKGbhQYD4ouTuZi2VqeSv1WqcLDjXg3rrSDWv60wPtHqc4lQ8SBh+JJPtWLlS0bX4kj2sIR4tN3PlfeAcDoOwvrZuOQMs+vg== 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=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=m7Irli7CkR97oNAQZh/DZ3oXmLqZii4X+YdCbDhp4SQHQ/usbkzhf7UebtNwtzVuwlk/7Vklcen4wj2KcPOH6yHaOuZQipd64agKNnaVJQoCI42F/EpQAc6XhG97meWut/rlJslFK94+TxyR0UBzShLXtlm//KqW8HHLWS5Gfzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:23 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:23 +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 30/32] staging: wfx: fix potential deadlock in wfx_tx_flush() Date: Wed, 1 Apr 2020 13:04:03 +0200 Message-Id: <20200401110405.80282-31-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:21 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SrvUj0WhhGGbgWj9L+qOC0YI/4aZA5jS73cqPAIapUJBANq4XMKIPuZbPqs3hytE374kesWvY2VcFwAZF3RpM58T6C3fqy0Uo8kIBuoSygBT068F+DONbiFWUZX0I65LtNxqtJePwhv6n2pC+Vet9LfPKozh2ZzZNAsnWmkq0kGrqBfknWQs82jFQ+U9veyroOe/zdA+ywPWNQaZlyaF6bwUZfWoQ7BwWeh/glKnaCgn2p9zESUKMUZwQHivvTNeVp4PYdL2T0/bZyw7l4RVeYIByFZfzZO7TiLbTcTaMKJU3vk6FfvmHZjLYr9e6LEQn3kNglKmLXpC4T2TH8lLKvrPp32tqhhVND2KGwriz3uqKvO2wFV75qxBXkjzGgyDuKt8SvzCicGsobg2TvAuyKLMfl1H6hu4+7O2Sp5BDWYxTqZS+yqmyzQnqFDu0rhF X-MS-Exchange-AntiSpam-MessageData: JPfaJduqfOThZ8IKitOMLEuh6VmypmkJmJpdygtTfx4UfJxE8LeGraXmHMjiMCr9jJQURpwjt61g5ymqEppuZb3JfULkgJq2/borOT/gKvDkFWbQiT3jTTw/C43am2cfP5LFC1+Jkbg07XSdJGF+aT5KIchUEBr/LYNQ6Eok7MuzNZ8SRcFOWpMlCLQ85n1m04hS5wSudfrUAkO9RNeQ2g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:22.9343 (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: AqlkUbdxfXe6RJNbl44aSHkI77Jx4oghD83D8tJzUFxzIrhccYJI+ySsZTMMVO/E81Ugf/n2vRyfwM3w+FIKig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should. Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index d4302a30dc41..e6d7d0e45156 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -36,6 +36,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) if (wdev->chip_frozen) return; + wfx_tx_lock(wdev); mutex_lock(&wdev->hif_cmd.lock); ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, @@ -54,6 +55,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) wdev->chip_frozen = 1; } mutex_unlock(&wdev->hif_cmd.lock); + wfx_tx_unlock(wdev); } void wfx_tx_lock_flush(struct wfx_dev *wdev) From patchwork Wed Apr 1 11:04:05 2020 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: 216144 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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 28D9DC2D0E7 for ; Wed, 1 Apr 2020 11:05:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E93F92078B for ; Wed, 1 Apr 2020 11:05:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Y5QjFHLS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732580AbgDALFf (ORCPT ); Wed, 1 Apr 2020 07:05:35 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732561AbgDALFe (ORCPT ); Wed, 1 Apr 2020 07:05:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgZX1sVmmmsImtvIFJXGN68MmR6nkJUBC9vAOQj5pK0Tky998kAZXmmp5NlGf+mqmj2oUmAnnCiDgqLikEn5FqC5v1WfOnu6Z/Xid2U5AJaR7TZY7pTigbNDZBx3zem6M83OfnA+0G/YfMk8IqLdAQPK5LPiSOMIdWmvXo5iSzBt3lDLFS9p+6Fk+NACoG+LMO6br5pUzDivPO5nkxjLweEAfCTxEzf9jqG0fjU0nijiuAHNzo5i+k8VfXL2JcJEzX3y7KC+XtIY67ynJOAYiMK1lBP4d+tkFaWSy5h9WR4wgUXLfGZhvkC/qGc0exWU7WV7YdqW9hdnUrlbYP4Ybg== 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-SenderADCheck; bh=RPrxWdWGNJvYjUT2owohbDyOyC0Vbtfc7ra7B4ROlWQ=; b=BR5+gGsllV6XE30EYTOXrpuesGKnj3fu7Si7rTskYWmLcpuA0CLmdxStu7Z3fKO0Y3xMhQ+VFBr/Qf48fSsnMxPI+1+yQeEdm3o1m1sYYwuJrHuE0cRjkZs1aHIMX4LT7GCAYT7JJ3fzxUUn1G+AF8qsDmVz8LeAPkwn8TK8mj2o89wUSbbktwBBIkqk4CB97vn7PbpZvuWkKk+DnJqdunRJYSEzuNiALb0HiRzsmI+Xv0ddhJ2pDJ/BpGT+GQoRnSYPl+lRfnsLfiCvNVfOIIkN6l+7P6eEjbOqlUOb/RrsC5NV8AECcHVQ9C3+4JPELQs4XvqaKppDbRlATN7gWw== 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=RPrxWdWGNJvYjUT2owohbDyOyC0Vbtfc7ra7B4ROlWQ=; b=Y5QjFHLSt+COTKOYugvB7uaQi6yDAfdAuLXrVGaKOYzSlFK4c5+aibM8+qvWUziGzLwJNOXlErbBHcTEupDyd5QIpj24OxqYA0Mu6XffXKlQ/EoNt8i9dnlX2nGEfYDelOyRGJ/Yq7u3O9aVRKAovM61b+WstvtNdSt1US1gJCY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:27 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:27 +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 32/32] staging: wfx: remove hack about tx_rate policies Date: Wed, 1 Apr 2020 13:04:05 +0200 Message-Id: <20200401110405.80282-33-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:25 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32e0810a-ea3f-483a-d92f-08d7d62c953a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1qeSPoIe//HHNak+pSUaABbmyQA0ggmemurZGzVSDHV+lsH1cpN8OAf/8aU4nhNl0W+3S0iqUzRf+2AGzPtIB8LzaAGwbi0U2IROY0z/HutS5cP1QrwhV6Bzwf2Jbgq84UJdSMBZDM/HPHK+CN2EeGiFv4X5gEndVIxxSoQPgs3zMPVtj0VtBKC+NifTRRZnUL78bUn/8KakfJc6CMldLkJ75r4hH0FV2OwO3MZ1FJw6xTCHlcAtvdgkmP3ui9VUleakgYwEaihpYz4eTr0tZOqcASrNdWYjnMImVuDpFldletzn8xt6aITj9NDg2w76doZWWs24uN0DM6NR35H/vRyNYHu+3j+zioeNVv90im0AtQu9NbXvMauWve8Il+2uogWtkVzMrnuC9W0cdl1wLy7pxk9BLl0dhYhokril2d2xDh8WaQ5c0PiS9/Vqy3T X-MS-Exchange-AntiSpam-MessageData: cvMgiYPn/2TlNtXfy5qZ+kggf3E9UStRlG5XJFEfPDo+64PfnBui3mS9D/ojNBsxW0L3Txg98ge5VDT8P2bdIlWbtcKymJBAyM+BBJAPG4a11S5Th6RcKlpyE4s4aYfU3cBveRbDKrKev87Fze31x51r4jwqVyqCIgCjvT1IC9CpytbrtIbDQ14EEIEkhUw/Tttaho/x7jogPwVT9usICg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32e0810a-ea3f-483a-d92f-08d7d62c953a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:26.9909 (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: hauASE1EqdAfBmoLfcj8lpqkFGCLqgziLNRUVpvY5P57dY0ZtCHj09C+/vr5CUxg++HO6VtWmxvzV914g8KgQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code contains a weird hack to avoid switch from 54Mbps CTS to 1Mbps. However, we have not been able to reproduce the problem and hardware team don't know any defect of this kind. So, it seems this hack is no more necessary. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 53 ----------------------------------- 1 file changed, 53 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 1d9a8089f3d3..93ed0ed63bb2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -51,59 +51,6 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, if (rates[i].idx < 0) break; count = i; - - /* HACK!!! Device has problems (at least) switching from - * 54Mbps CTS to 1Mbps. This switch takes enormous amount - * of time (100-200 ms), leading to valuable throughput drop. - * As a workaround, additional g-rates are injected to the - * policy. - */ - if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) && - rates[0].idx > 4 && rates[0].count > 2 && - rates[1].idx < 2) { - int mid_rate = (rates[0].idx + 4) >> 1; - - /* Decrease number of retries for the initial rate */ - rates[0].count -= 2; - - if (mid_rate != 4) { - /* Keep fallback rate at 1Mbps. */ - rates[3] = rates[1]; - - /* Inject 1 transmission on lowest g-rate */ - rates[2].idx = 4; - rates[2].count = 1; - rates[2].flags = rates[1].flags; - - /* Inject 1 transmission on mid-rate */ - rates[1].idx = mid_rate; - rates[1].count = 1; - - /* Fallback to 1 Mbps is a really bad thing, - * so let's try to increase probability of - * successful transmission on the lowest g rate - * even more - */ - if (rates[0].count >= 3) { - --rates[0].count; - ++rates[2].count; - } - - /* Adjust amount of rates defined */ - count += 2; - } else { - /* Keep fallback rate at 1Mbps. */ - rates[2] = rates[1]; - - /* Inject 2 transmissions on lowest g-rate */ - rates[1].idx = 4; - rates[1].count = 2; - - /* Adjust amount of rates defined */ - count += 1; - } - } - for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) { int rateid; u8 count;