From patchwork Mon Dec 16 17:03:56 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: 11294767 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 DA117930 for ; Mon, 16 Dec 2019 17:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADEFC2072D for ; Mon, 16 Dec 2019 17:08: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="IVhXJmmA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727510AbfLPRIX (ORCPT ); Mon, 16 Dec 2019 12:08:23 -0500 Received: from mail-eopbgr690078.outbound.protection.outlook.com ([40.107.69.78]:42057 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727106AbfLPRG6 (ORCPT ); Mon, 16 Dec 2019 12:06:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDTqrQrSR0OmOlkjMdqr+z7ty0ZMQrF/j2XHFtheGGDGcFIK+ZRKFKCe8bUSVp0Jpu2mT1UymOy/hQ9hnGCXEZ6hUhNF3yhnh5bi+Ud2XWSRmpudPk0gY1RIprb2lDsYbg3m/OVJWUamXckHdqmgyyeU8aJsEu2To0T6ZjHfyfj4BGmLMROCzHiqdU1dfgEYsnvafXAjH8AoznI9Fo1zOk/LGeiVWggEZhReEBAcFc4IRNa7ry89i1h7Iy2YvJQzE3bD21qwyGEpcylyee+mvd6wF6DSoO3/XdPxsAplXaTerZrVYUubu5maXkEAxBx765VwKdzz9GCnqpP7cQNqOg== 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=Heol9oEc//L1+KRKm+U1W8kTflzxvpF+avWHq3bzfUk=; b=hW8WKx/NpHGpV3MB1p6ipaQ8LmShBC1Hlb1WKFnYe1ZuDfhyICnmfz14KCfKe/mdupw9SJocYqPw5NiO9QkoI6CuLUb0S9naiTpqCKm1dX0wu0giR4725+Wr7DVadEjqN9EQt57T8M8Pk2reCFYIQVdRhVfvaIo/R7OOiLRspQNEpSAnXO0SUimvxuXVGelVJXpQNN3BLSmS97Ox6s9b7ACAyyxWBAlERBiZ/ICk4OVxisWTx6hU2iQH65PKQEx+0cG5rYCuFjHBw98vr723ain77+GHff2XmpavMhgGCs4rP3MyckXP1Ot8PdbsAMM+5T6anTi22K6v9K+hVZhTcw== 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=Heol9oEc//L1+KRKm+U1W8kTflzxvpF+avWHq3bzfUk=; b=IVhXJmmAf678iY3JJm6Ssf+6jCQ/5GnfjZwSsGNQgi3wuvGCDYQ9zNlHDkIua/QSjUD/S4XCyNSm0izdu5dpIdohGJrRRMU6BXKuGlvQ5H+7c39PzFV9Zw+8EeWoStjNAlhi4UwXRUtNhAqGusvpHzMX0omeCHYr8xSYOu/oDm0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4142.namprd11.prod.outlook.com (20.179.149.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Mon, 16 Dec 2019 17:06:46 +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; Mon, 16 Dec 2019 17:06:46 +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 45/55] staging: wfx: device already handle sleep mode during scan Thread-Topic: [PATCH 45/55] staging: wfx: device already handle sleep mode during scan Thread-Index: AQHVtDLNZFmcvjicTUihGPRgdvbXow== Date: Mon, 16 Dec 2019 17:03:56 +0000 Message-ID: <20191216170302.29543-46-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ac1298c0-62de-4204-1282-08d7824a54ef x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39850400004)(199004)(189003)(6512007)(71200400001)(91956017)(6486002)(8676002)(2906002)(54906003)(81166006)(81156014)(186003)(76116006)(478600001)(36756003)(85182001)(85202003)(6666004)(66556008)(66476007)(66446008)(64756008)(1076003)(66574012)(316002)(2616005)(4326008)(6506007)(26005)(8936002)(110136005)(5660300002)(107886003)(66946007)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4142;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: kX60kCGfIMdrAv36ZYtYjSVKZ4T2BupHLzs4dS4UhKB1ewCP1BxDal01sZbLTT5klBUBNp+qxTCp8yUMrHjDR3LUPPHmyMCb13Yla9YDJFa04iYscb2Rkyt1M5TrO+Skl27MQQan1l8lPoLk5NLkOSOPeqGITxoHkDNUh9gwofBA2XnxONcDOAqkMqkH3H+3bxy/V45zxpQyIjIxq3k9G0ZmDPTtTpsPIBA7RbBvWKr700TEk+cLR3tV4Id7+183UVYu4sRtLnun7PtD2ONa2R331MxfoCzHldxVp5Clkdd7958adKy0JNNGUkt/wzIbudCE5uV/zD1U6hkrmJgPnk+CWtUHecZCRVIrOQ4JOOLuXFSZ40CBRAbmSy5X4ECFPCXWeJ7B9kcNJKukGWddcEOBTA4Nd0QtcfVQSHWLfRbKS+0joPK3ium3LqbWUNvc Content-ID: <4BA983C751098F40992E3AEF590CD255@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac1298c0-62de-4204-1282-08d7824a54ef X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:56.5829 (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: VlU3UZvu+i7Vn5hD0vumFzq3uJW1HHGZ7BWUI7gOXjIafyr9RSMLMggLX7yoTMH/2s1OUbJpXqsFUQDlu/K4LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4142 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 {