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; }