Message ID | 20210910160504.1794332-5-Jerome.Pouiller@silabs.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-wireless-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, 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 EBA25C4167D for <linux-wireless@archiver.kernel.org>; Fri, 10 Sep 2021 16:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D635F61208 for <linux-wireless@archiver.kernel.org>; Fri, 10 Sep 2021 16:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbhIJQG6 (ORCPT <rfc822;linux-wireless@archiver.kernel.org>); Fri, 10 Sep 2021 12:06:58 -0400 Received: from mail-mw2nam10on2043.outbound.protection.outlook.com ([40.107.94.43]:40801 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229919AbhIJQGw (ORCPT <rfc822;linux-wireless@vger.kernel.org>); Fri, 10 Sep 2021 12:06:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5YNXOxBX7QeSsAiy9pXGQmK1aUAYDQMvAko65Tgb8RugeZzttdjIV60Ra6kAm/qDei6OZW+50D461JzQNPCux9QK/AclxuQMwYPKkI0qKRla0OU77H2DjjBkzMu5OmNCCve6yax3k9hhNGXxrnabv+SkQUqi5M7I1VGqKxJf7J0BIpmARNQSqHmxYQxjW9JYRE9+Asd9VwbJYU6dG5/UHUzVLYhLm79V9aLjvpu2NJuwDh8q9QEahY2ANWIKWJm+oHdDUlCeG7b0Tn5M+Mmwtzpr0PW8Xhf1DcptCshpc5d9IgDhMiA6ysjdhXGktrh1j5Gi5SvZ375Ekuy6c+k9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AmCqsbY3AiU0YiEAlz93ibGj/lSsD0m2Srcg44MoTrQ=; b=CoRRTO7wkUGxSXlMcK8zwbxQGSQDSRIysTp3cdmYBe1MAmNDRE2B8OYNDmId+SvdX2AlkTh8pmU+OxLBUnsP40Q23urq8j4YxdO5NW5ES0ta0vj1CNN7xWX5sQ7EdCOxmrEKKtpoZvi790jZiXG4pdvyNGWNAbjdb24pCeZLoVNk8uU+gFlTtNU9fBxMJyR76mqGTnVGcdyHBpLD7Ws7XlNKHQKkWLF0A1kgkmv4mlBnJMKCaVNyUYJURgzuw0N/zfaTSydZ0TJMmr4k9awtmioMX8SayJ2Ix6VULyj6uVK4crjsUkkxUgZ37yseP5b5OYSNZhZap6092ObCMud3Sw== 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=AmCqsbY3AiU0YiEAlz93ibGj/lSsD0m2Srcg44MoTrQ=; b=Cn7QDbn9dahwxLKnFFM0PDTnm386BOTKmppRX93flw3a283S54t8LUKtkHBVRKlZRPjLAHA7R7AevxskD3AEmbL/JVijVZ1xQhzYebA6EjzenU6ohjueSM8IP8ELqW41TN4rd0PHytKGSbjJqj0eN2K+JgWTXxstXfm7jWkOSqI= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB3118.namprd11.prod.outlook.com (2603:10b6:805:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Fri, 10 Sep 2021 16:05:40 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Fri, 10 Sep 2021 16:05:40 +0000 From: Jerome Pouiller <Jerome.Pouiller@silabs.com> To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kalle Valo <kvalo@codeaurora.org>, "David S . Miller" <davem@davemloft.net>, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= <jerome.pouiller@silabs.com> Subject: [PATCH 04/31] staging: wfx: wait for SCAN_CMPL after a SCAN_STOP Date: Fri, 10 Sep 2021 18:04:37 +0200 Message-Id: <20210910160504.1794332-5-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> References: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (2a01:e34:ecb5:66a0:9876:e1d7:65be:d294) by SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Fri, 10 Sep 2021 16:05:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08b928fc-6f41-417c-97c3-08d97474d599 X-MS-TrafficTypeDiagnostic: SN6PR11MB3118: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <SN6PR11MB31181BD0715E17471B73309693D69@SN6PR11MB3118.namprd11.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zasamjVgn4oZb4+UaHWE7f1ct0+bSfClxh+giwSQqn4HErVzo+YXfmWynDzluUXtrdB26V+KqLb5l2hYODK1H1k324Y0CTMBKFhn647MYFR4z1DoneFMg0mTl4epOhLNIw4chL4EWLMHtBPZSn4E6m7zH6tUurWXqjwRX4HSEubRXyoy9dSsUNBjAWLiUqP6IRzfJqC/SLaPxEM+DVfRzVlZSN986xpHtv8Lfe/X/Yo8mAu95wmNnv1F4zSRSpSU1faz5a7zQl7tpMt/JPBratGchsH9b2tUhHYhE2NUAsi3xHpmOQfx4ulW70x3rpB6xkqMQPC9mOYrQtGXposU9ycXwifB68lth3hLRXvbKYoK7aBwKXyaIgy7YDCZNr/HfL55tOLfmZLCezDF8iMH6ue/o9PzCnArlAAzlkdtBF/EXMYNbbQq8NOEDZuTcdE36NVHAmU0+CXBgOzRmFDNjeif6pQSU5giZW0VVgfztUJBa8G4m6IpUikPOWYPUbEty8UZnVgrpy9i5q+Udd7sV0N21pGr5njk+P4CROV5DNNrpGv9WCe6s7Dm9oEyqhSGH4dWPasJTw4f11xcCr1WSqaoppjekogZzJjkwW8ICq02tGYq8PJxcqa7Xy5VhXe9KTP7iq0dnXh5qVoY07QTtg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(376002)(346002)(39850400004)(396003)(4326008)(66476007)(107886003)(36756003)(186003)(316002)(6486002)(66556008)(8676002)(86362001)(2906002)(54906003)(38100700002)(83380400001)(8936002)(66574015)(5660300002)(66946007)(1076003)(2616005)(52116002)(7696005)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?wXZuKgtne74mrRulozXLGCotb?= =?utf-8?q?wcVZEyghzvc1fqtnDViUsCp8VambtABUTfb9UPPHxryPsMqbEiq0edNi?= =?utf-8?q?8LVXtH0BHt83cpWtKRxAuGsqcDyG21UmfiRVjJeOS0JyvbGHha2v1ETy?= =?utf-8?q?V4GZzdHdUlEaeqyKBLuP84EqsNvIhPFUb+Tj2KhAck+Zfn6YQU+rgY6S?= =?utf-8?q?r37Ksa7UpG7vllVlxvkjLKvVUNNqAGhWmeYGEbAt4ojslbsRenL8OB/c?= =?utf-8?q?Yc0eEKcms1ot38nhe/4VGFWXPoENZT8PJfbHhDxbWThTAG2hHSfamble?= =?utf-8?q?A+qEfCwkxx6HIKFnJN7eTGopXhJSrpG1anke0FuUEM4gNBWX3ZeHdfvZ?= =?utf-8?q?PLJ6CI8RKEODqPZCGpVzdqKfQqDB5HlrmS1uBtDagcSUPVhdmaZn02Yx?= =?utf-8?q?xlkHDRI9yYe5vVAF5P3j1h2yrTjDlpqI9RxhIQWLJm1TwGb1IdsSkANH?= =?utf-8?q?O/9Zz2hlOlxSFzmCSHmnOBW1pYtAlKITcPPcHfJI/aKfbxv5Q67mN/0I?= =?utf-8?q?NuB1pXABtvMuAVjO56uR0DNdGsc3USPSnM33FBiTiVPi8QPvdhV3jotB?= =?utf-8?q?P9gKIbJkfp/6wFe0LV8i9YbNh7azfmK3UfwPtpndspJrZru6o8NgrwP5?= =?utf-8?q?0K8HckXUy19aqlIMVHGnmwYQmI5NI93bG6TiVbExn+M9n8qMTvBEbN9t?= =?utf-8?q?Cyv2NeBKVx7Mwplayo3+xezzoyGR4vD+DR1XLn2cGAmE+KNHzE2GVIG7?= =?utf-8?q?S5DLNJA8mQJw48HKo2DbFABZIoW8p/BXszvr/68T93zUqOxlzJd1LM6L?= =?utf-8?q?aAJNclx5ExXekZ/jeRUD/sqcOf0VgkuWZE+dzcGMI7XhFmCAi6rtUkav?= =?utf-8?q?IMlPuimAlZrRfptXrs1Y/fmIgxXM4vq8gQdUgZgAN1Z9tyn0XdN0KWjQ?= =?utf-8?q?YMU8HoRgGgnfHokErRT9GjLkw8JBXENtFjEVLZHAg3+Uo9L4Sytp7Orf?= =?utf-8?q?KqZtEnCN3wL+PmcX3foZ72ch0xsBeS8c4damJauxMfJ8p6aErFooQ48z?= =?utf-8?q?BI8UqPuVPKcAuUpcGs4lmqK3GSsEKDoNXEnMy+1CWTQrHphV3wHPXuOs?= =?utf-8?q?UNPktJ8yCnd0vmkHB8VhjjWT+mbqlKBAG6xEGxVk0AaAhXLKOM4CABZQ?= =?utf-8?q?y2+RtZNNuCjMX70DC8/cs+ew2t+7KTcfOzgtDpQaj5vj4jxorN7u0f/5?= =?utf-8?q?PLb51SSf9TnBWyXQFvmZsSD346Q5Mh7TQlk62ievH21CN6CNjFb/PCMQ?= =?utf-8?q?RLFN4OW5Bm1GfjBC2g/M2UnN+6cqpoafc64QBXV8U5Lf7H5BWp0UEa+f?= =?utf-8?q?6WT66eYsAfh+zdpwJZVX5C05sExay7AXub32QCBt5h0d7DvNXqUshnUY?= =?utf-8?q?NTyQ1k74a5599vrn2/xltkHah4pMRJKupUHeDHY?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08b928fc-6f41-417c-97c3-08d97474d599 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 16:05:40.0605 (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: vfr/L8nWbfyEvUtT7rNl43JaLw9fXosr4XGZSwgDyQVL3vrb+XwfYSLjckDvQ92prHm/EFE2pUHOnirdQxP/3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3118 Precedence: bulk List-ID: <linux-wireless.vger.kernel.org> X-Mailing-List: linux-wireless@vger.kernel.org |
Series |
staging/wfx: usual maintenance
|
expand
|
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index fb47c7cddf2f..1e03b130049b 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -58,23 +58,31 @@ static int send_scan_req(struct wfx_vif *wvif, reinit_completion(&wvif->scan_complete); ret = hif_scan(wvif, req, start_idx, i - start_idx, &timeout); if (ret) { - wfx_tx_unlock(wvif->wdev); - return -EIO; + ret = -EIO; + goto err_scan_start; } ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); - if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower) - hif_set_output_power(wvif, wvif->vif->bss_conf.txpower); - wfx_tx_unlock(wvif->wdev); if (!ret) { dev_notice(wvif->wdev->dev, "scan timeout\n"); hif_stop_scan(wvif); - return -ETIMEDOUT; + ret = wait_for_completion_timeout(&wvif->scan_complete, 1 * HZ); + if (!ret) + dev_err(wvif->wdev->dev, "scan didn't stop\n"); + ret = -ETIMEDOUT; + goto err_timeout; } if (wvif->scan_abort) { dev_notice(wvif->wdev->dev, "scan abort\n"); - return -ECONNABORTED; + ret = -ECONNABORTED; + goto err_timeout; } - return i - start_idx; + ret = i - start_idx; +err_timeout: + if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower) + hif_set_output_power(wvif, wvif->vif->bss_conf.txpower); +err_scan_start: + wfx_tx_unlock(wvif->wdev); + return ret; } /*