From patchwork Fri Feb 25 11:24:03 2022 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: 12760125 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 606A7C43219 for ; Fri, 25 Feb 2022 11:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240164AbiBYLZw (ORCPT ); Fri, 25 Feb 2022 06:25:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238811AbiBYLZs (ORCPT ); Fri, 25 Feb 2022 06:25:48 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE8041DBA80; Fri, 25 Feb 2022 03:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NAJVydU8fMGkCwJvL6GR1C9vZyJ/7wFbW0FJKNyy0d2GLDCPRWGLiiVEpIcMYfutUdelek1Eho5g4wBubljfii4ulY+rqAVFnyXEREOJVOG6LSUbtvlS/YaWtqvQVR4O6vVtxXxlk1u9eSyWL6FG/z1Dd2LBLg6Gt4z7FkA+Y3h9T7s+UQydD+1ToCfKMFPOl502dzyEClWEIIPBGOKcmsL8Bsn9pZIWTNqSOw3TVOsgFS9FSY4dES2qzp28zt2lfZhWc2UDgQjh/q7XoNla6xOtW7FPql8k+lXVmdGFH7IA0SRy01Lk3EbHkEo1tHmFUCRQ5AP2lXLdrMKvm/DVOA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nFG80ytckh9LmzJFSxoW+PmAHRd0OhkLgBzAq1w2Oe4=; b=mmzt496gvDd31ZTJlZKnBfgIPcRGSpyv+ipdk7n+AKeFh98W1KCD0UWOn3jtCLFbZuUEQL6iDu6bdRhZLyL8XF4AK70Neho4dmH6sFeB+Lp37Us9BO1dTxH/oTwKRUeaUxvq36tcgTRcABj5trpNxTlTn18O8YuTkpb89ZWYoYJO3IP3eChIRJ4HxlzLntCXGWRwAWHEfP1zY9gN1q93WYij4e/hMe8xSTWNp2tN92xpM73M9WimxT30O+w+k/EZ+YHvIflfq9VA5cwPZNhcz66gOZYedp0a+vQjtJrxjxZw/DYKZxJ5pJVfqI+XYJzaYvp6gKVgu06OB36uv/Cb3A== 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=nFG80ytckh9LmzJFSxoW+PmAHRd0OhkLgBzAq1w2Oe4=; b=VI71eWw1P9nuJtXSnR/y2MmlMuPhzVki3okbWOfAHnIOO+DBgHWsstfoQjWmC3Xh75o3yyCPCNFb1H20XCGEDbtGDazX1onH2rOofmOvOh0VC0Hsp8a69BTKo2dj4O56ZhHPIKdLX0tVxGgRqMQm8aQwucG/Sam5xwj0Q9z7mwk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by BN6PR11MB1428.namprd11.prod.outlook.com (2603:10b6:405:a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Fri, 25 Feb 2022 11:24:50 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::dd2e:8a4e:fc77:1e66]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::dd2e:8a4e:fc77:1e66%5]) with mapi id 15.20.5017.023; Fri, 25 Feb 2022 11:24:50 +0000 From: Jerome Pouiller To: linux-wireless@vger.kernel.org, Kalle Valo Cc: devel@driverdev.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?b?aWxsZXI=?= Subject: [PATCH 08/10] staging: wfx: prefer to wait for an event instead to sleep Date: Fri, 25 Feb 2022 12:24:03 +0100 Message-Id: <20220225112405.355599-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225112405.355599-1-Jerome.Pouiller@silabs.com> References: <20220225112405.355599-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P189CA0052.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::27) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9991364d-8612-4a67-545c-08d9f8516fa0 X-MS-TrafficTypeDiagnostic: BN6PR11MB1428:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C+q80jbDTT74yumiQqauKqJYz+rrhGyI1fMfhWteCFBJeHfoRCrynEAj2MXya8AR37OjBOpG7on0xEu2lzNBvUOr2vqLC+lbp50ji+sNGaSBccA537jCNTaMiKYt4e0py3sJjjYJvw1ltot4dbhkNSm/u3WPkOE+CH1SM5QnhuAIofmBWKt3EV6HLGE9XQk+KSXrlU/3O0ri82lFD5TI4HtbW9aSyT5c1zoU3ZwIjQiYKEQDiCBtbM7p2iptwA2dG48oTY3riliBqfKf0ZaUvUMP3SJINWduXIZqZrdTf8+8ThYBt4sE1yoghzyU+q7h6yb5kHX9opfcr0pPBQGJaFpZzdN4HZu0jDJJJl5OqkvatT7vMXcHQn4j6DLgHfqsG1gYxT8X/jrRgggvdvKbupWVCVs0XIZQptepAU2xFyUyn7/EY2XLjBhncE9SBQXVwyPs3DomWBL7fuMx2nI5yR+H5xV0p3NcpFBtV9UPuAwRV3OSrNK2Wsu8XFxA2gmg9Tmv6DwXG9en1R0B1hHFRof51lMhgqZCLx3AGL9uk5U4hl0WVFS6Qz9awQjXcEqx/2sIUlvBaeC67dfW3h10UY6FXtiUIb3m6MIPJuc9yDqgjFQvNg+VwgLjVj8g0vGWgztznJt8/zfTLkNtKXZB0YvLLNFDqB3I7dlXNtEkoZEjpBpbUrojekjd7Pga22vLqhnMd83AEMGBeAhDukRyPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5657.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(36756003)(66574015)(107886003)(83380400001)(6506007)(6512007)(4744005)(8676002)(26005)(8936002)(2906002)(38350700002)(186003)(5660300002)(38100700002)(1076003)(508600001)(54906003)(66946007)(66556008)(6486002)(66476007)(52116002)(6916009)(86362001)(4326008)(316002)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?o/6jrvEgKdPKcKPiPrlS5L0Avuzp?= =?utf-8?q?ODNwkte9th+EVE7A6d0fyxesH9ei1q26b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J7+etVin3W598ii4gFmAQMdA6B3M?= =?utf-8?q?VwDElDtg2BCbENCzowCqTuZ6VEpvsM/baaAvcwWx/pMN96tgWhA3Y7fipmjhm2JAT?= =?utf-8?q?dC4Y6ds6rfK7zry1PCJHVGo+Dv4E/IYLXZCfXslXbkHcDVezvlVNEvtlxGBh7JSHE?= =?utf-8?q?1WHyJInFIYff22XGSOu9+2psi2v2KTV/Z33btRmoNjosc/2+TJZt2PuXkc5VMgRkV?= =?utf-8?q?jzgPbJF4LoJfNWwbUX32boZmfYoxsQt0SGkiENBoqZEvswiQeKyb3nkmrxiqLo6K5?= =?utf-8?q?t/T4l+WctS8/7vjOSnW9nwvVekOqB3JmZrJkjmOL1X8qvI50tTW19yDZHfWJWwE1q?= =?utf-8?q?aRLR4iN8TBAgyQzv1WsxvR6P6anPlf+Gxr/51VSiFImTB60ZtMD5wAOszKSHP59kU?= =?utf-8?q?sKfHKTA+6SqnpKnhEmD9x0C0AuwWTy9sSH3aYWk0uq0p36HJ9XkhmByJzQJ6eg3/c?= =?utf-8?q?BwAvNpV62Kv4dE1Sw7c/WD4taopmHMsc0hUhmkGe9sTUKRcbpUli28uRhoQ5jHtKR?= =?utf-8?q?ATrkJrB9ZnB79xYeyZF6Wd5T/WiG8G2YSaRCQpxeTIfc4u6QkvY872lOerxL+7oNW?= =?utf-8?q?tZQwygHqrbiMjiYUjJFC5t7op9WknX/LyLCVPLKp2WkaCH5m/u4S3bs=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9991364d-8612-4a67-545c-08d9f8516fa0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 11:24:50.0953 (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: YHi4xf5+fn3lZgAz08MANi+D4XdrD7wTQE1bJLO9RgyA2TFk/XP6TOowpeYxUKuCJf0cBexxOf++ZjKdJZkxeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When possible it is better to wait for an explicit event instead of wait an arbitrary amount of time. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 0b1ed12c0e83..ae3cc5919dcd 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -72,8 +72,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, wfx_bh_request_tx(wdev); if (no_reply) { - /* Chip won't reply. Give enough time to the wq to send the buffer. */ - msleep(100); + /* Chip won't reply. Ensure the wq has send the buffer before to continue. */ + flush_workqueue(system_highpri_wq); ret = 0; goto end; }