From patchwork Tue Dec 17 16:15:29 2019 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: 11298121 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD37914B7 for ; Tue, 17 Dec 2019 16:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A076B24679 for ; Tue, 17 Dec 2019 16:17:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="iBldJD8O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728996AbfLQQQD (ORCPT ); Tue, 17 Dec 2019 11:16:03 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729077AbfLQQP7 (ORCPT ); Tue, 17 Dec 2019 11:15:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTM4K8HZ6hgnWs/7jq1XoRwvXbluyPF7HOl+GcF6nbyuGpCNomcfJy1kv6sN2y0ZwIr09zCIVTIznwGyxkZwrIxi8E3ldB3yUqvHQXghIO74Jd1sDnVVnLZ32lG42+b3EKhFX+VhX2xg0S72p64dPzhaVdBWpkucKkMDo8aRmhMH0gTcIQMghiqSyQNSbZh1FQZd3EAYhBOXUSM9f0N3/rCdbv+MNq9/c8qyJI+IhxcfQ8f0dTt3AtpqfHycdD+sJwJeEgKEV3YLvOXeRaztd3l9IoZ3dMO97gAQXVwNraGVq/MRMSCjq5nsTGBT/dI6rUxkp6207rzb/kZwTcr3GQ== 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=LQUOd2k3H7PvGQvT3Gmu7+8VFJLJ0zbzv6DQPSsWlUM=; b=Wl80ivMEjfb7wOuamZso0vf0l18DgHLqBwdlUdu+nEi0VO8o5duntlw1kxcKADDx59q5TwTxYNXhKyo7k5Gu4FsoL5jIxbvLubmrgyRYEucD5BxPCMVc/xf+ie/Sr5mmotlNO9SktYvZebDS2upaQedni/+1/1+HM/hF+seomX8D4DwkUDoBo7dCriqvExVj3GoeRIBzlxaBk0wZHjUudBmQjzotwhLShQ723mQ6wxsOGhLNiABNI5SlZcBERMfsObd5rlCQsD1sNs6KDiOvZs0zwUsNfOWKBG8fMCs6SS20VTsntf6HiiDg5+0AeIBiN7ku0e3P+JaYcYuLI5AAew== 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=LQUOd2k3H7PvGQvT3Gmu7+8VFJLJ0zbzv6DQPSsWlUM=; b=iBldJD8OQ9uBIPwCxAqfnRI4W26LYEKIBqbwv032iDOtx7CcQlJhipZ7klFdFV/wo+HTUnsP9VNsxs/7Q1sRy9I0RtyT/SknO2Y2DDAw4WiZXdTn4KGlxEh42WfmOY+qhQ6oQcxtIvgs2MeaPrDR39dlEPbhJ9bgyKeFaZ+X/W8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:51 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 16:15:51 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 45/55] staging: wfx: device already handle sleep mode during scan Thread-Topic: [PATCH v2 45/55] staging: wfx: device already handle sleep mode during scan Thread-Index: AQHVtPUzjPg8Lu2rPUKHwVRjyrYluw== Date: Tue, 17 Dec 2019 16:15:29 +0000 Message-ID: <20191217161318.31402-46-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5f3b38bb-a3ab-4dc3-bc35-08d7830c5584 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(66574012)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4477;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; 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: NWgU3uSr9ceh/qkFugBPi4sFgIJEnvCL1um9tvP3m6Oh4umno/BRCBJirvJpR29s7HwKsleBuEdovTEx/fqreeo7oY1OWR10cDHd0MvZI9SlvQNVnlMoen8ZW4qfhtzQdM1Y/Wy1z5m2xqNTuP0iKSrCqj1fs5lZqufpzx4omGGj/XsMMBxZuH83xLQLmIwg6MAV4dqC4rPw0W7awgdgnmc1mqUESJWQVc0JQEh0l6oWgwicdizZgnx2Qrv4mX90S//P8DCuHzU5cuWwYo0nW3Csg9owLrLidpKYphw8ikqtA1/LVl1xpECgwjKmqeF/Em1rakoQGxiqS1spVHRv3FUWx3D95EmGI2JtHwaCxf7yMXfKZ0DpCLkP/hOqo2b8JoSqwrSeyClqz3rZh0BEhFercyF6rFmf/5Jh3t0T70T29vsQ8I+4jeApwZR3wt9V Content-ID: <0FB045CF19D8A94E81EF85590E0334A4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f3b38bb-a3ab-4dc3-bc35-08d7830c5584 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:29.5322 (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: omkMHNWcaGNGjTRKZRkZVJN9q/Ct+bS7CNpGrg66H96smhXMVocRw0VRHNR6G7+/JuNJp/8e5ty2ibbrdCRLEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 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 device is not allowed to enter in sleep mode during scan. However, this is already handled by the device. So driver does not have to care about it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 3 +-- drivers/staging/wfx/scan.c | 3 --- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 2432ba95c2f5..983c41d1fe7c 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -271,8 +271,7 @@ static void bh_work(struct work_struct *work) if (last_op_is_rx) ack_sdio_data(wdev); - if (!wdev->hif.tx_buffers_used && !work_pending(work) && - !atomic_read(&wdev->scan_in_progress)) { + if (!wdev->hif.tx_buffers_used && !work_pending(work)) { device_release(wdev); release_chip = true; } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index cdccb67cb30e..397fe511d34a 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -44,7 +44,6 @@ static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) tmo += scan->scan_req.num_of_channels * ((20 * (scan->scan_req.max_channel_time)) + 10); atomic_set(&wvif->scan.in_progress, 1); - atomic_set(&wvif->wdev->scan_in_progress, 1); schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); hif_scan(wvif, scan); @@ -232,8 +231,6 @@ void wfx_scan_work(struct work_struct *work) static void wfx_scan_complete(struct wfx_vif *wvif) { up(&wvif->scan.lock); - atomic_set(&wvif->wdev->scan_in_progress, 0); - wfx_scan_work(&wvif->scan.work); } diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index f396a502283e..97373d047f58 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -60,7 +60,6 @@ struct wfx_dev { struct mutex rx_stats_lock; int output_power; - atomic_t scan_in_progress; }; struct wfx_vif {