Received: by 10.223.164.202 with SMTP id h10csp2739287wrb; Tue, 28 Nov 2017 00:03:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMajXMHmfeF+KSdb93Rbcwwi50HSzMm1Ddj7l6Yhk1JcS9b7WBS30b54lJHh/cCEuIT75Ty9 X-Received: by 10.84.130.97 with SMTP id 88mr42519406plc.131.1511856196653; Tue, 28 Nov 2017 00:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511856196; cv=none; d=google.com; s=arc-20160816; b=HWF2yjwjToLZWQjKtfie1vBgRb9TZVSQeYP5ZB09S+CRTpo6NIbY9mdsKMQujlsdHq bxl9GRFUOBtsALLkRIRD5rGvnlPNhc1amKj/yUPDnTJ8EZfmei4FnEC0AcaYYGQ8CeoD YNwMizcatcBit++xvo8N7m3W2fmhp7nyCJtwbchyOAOwOw/TsYJhmuvGtTc/KjPPfnBB GlDI/F/GYnfazlBEk7c7ok8w3DXlfEtZpOaN+Za/NySpOBqG3FGVaB4zs1vTphqGNLwt E7yq+JxHOR9NnhbmciykLM3mi5pYjN9p8WsGWvaE6CPoPOMC5Qji1explFHC9SYifL2J oYjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:to:from:dkim-signature :arc-authentication-results; bh=1WsKqAYfWJ25WOBkJw5Hk5EJcaNRg2axexvMxGdsR14=; b=QWTHWeF7utujTa0Nxn97PWrUs8/RBBDyY06813DopzNyzd3xJJhpns7fWyFCJyaEQz FEt3kuN3nVPpzl/0wcTPRwGEwHvyHWTpjazgeUMmh/MIRST6aJsu91O8+SaMooJEr20+ 9FEOeAlUQ1NIGT2WhtJaYhzFtTqQY9HJ3L2PNvN8bmnGIEtuEXgc8izzX89rL7GgLN0S xGS2nPD774WVkn5Y5RWkp/TfqHshQUBR9gf1S6uB1Qi7JbEBf0gh2uI3goCLV3h5cral jenXPKi99jPIjZel1+YvO28mtZZrVg2zoPltmDr36LH1tJqpFIYT5sbH5PcMyowQQ3qe lhiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HAkgi46P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si7533237pgv.712.2017.11.28.00.03.05; Tue, 28 Nov 2017 00:03:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HAkgi46P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752054AbdK1ICQ (ORCPT + 78 others); Tue, 28 Nov 2017 03:02:16 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:9742 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbdK1ICN (ORCPT ); Tue, 28 Nov 2017 03:02:13 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id vAS829I0016221; Tue, 28 Nov 2017 02:02:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1511856129; bh=wlLeXrr2tDpaOwpcrsjQ+nYp7ZBhv/pR8lKMJKIpxeE=; h=From:To:Subject:Date; b=HAkgi46PDGiSo5zwosecamFcTENDYnXvl5SV953KtAHcA+e8hNKPx7fmZ86O9aXby Nxd7ndjcdLpWF2rA9NDReprL/7oZaxJw4g/T/ys9Vaew5DT6ZKMmEvqIo+Bf7tX6GW KUN3RNPeBtgx3mXkEs0hgk9Yfl9G0r3Hd6HJqQbA= Received: from DFRE71.ent.ti.com (dfre71.ent.ti.com [10.167.188.35]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vAS829Is002449; Tue, 28 Nov 2017 02:02:09 -0600 Received: from DFRE01.ent.ti.com ([fe80::b027:5293:c8d8:d82a]) by DFRE71.ent.ti.com ([fe80::1d1a:fb50:7d9b:ab68%31]) with mapi id 14.03.0294.000; Tue, 28 Nov 2017 09:02:08 +0100 From: "Reizer, Eyal" To: Kalle Valo , Greg Kroah-Hartman , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] wlcore: allow elp during wowlan suspend Thread-Topic: [PATCH] wlcore: allow elp during wowlan suspend Thread-Index: AdNoHl/bGXVkGpKqQZGnTY1jlxWGEA== Date: Tue, 28 Nov 2017 08:02:07 +0000 Message-ID: <8665E2433BC68541A24DFFCA87B70F5B364A3796@DFRE01.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.188.93] x-exclaimer-md-config: f9c360f5-3d1e-4c3c-8703-f45bf52eff6b Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org when enabling wowlan and entering suspend the last write to the firmware allowing it to go into elp mode was not completing before suspend, leaving the firmware running in full active mode consuming high power. Use an immediate call instead of a work queue for this last access allowing the firmware to go into power save during wowlan uspend. Signed-off-by: Eyal Reizer --- drivers/net/wireless/ti/wlcore/main.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/t= i/wlcore/main.c index 792cb91..1c31555 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -42,6 +42,7 @@ #include "sysfs.h" =20 #define WL1271_BOOT_RETRIES 3 +#define WL1271_SUSPEND_SLEEP 100 =20 static char *fwlog_param; static int fwlog_mem_blocks =3D -1; @@ -979,6 +980,24 @@ static int wlcore_fw_wakeup(struct wl1271 *wl) return wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_WAKE_UP); } =20 +static int wlcore_fw_sleep(struct wl1271 *wl) +{ + int ret; + + mutex_lock(&wl->mutex); + ret =3D wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_SLEEP); + if (ret < 0) { + wl12xx_queue_recovery_work(wl); + goto out; + } + set_bit(WL1271_FLAG_IN_ELP, &wl->flags); +out: + mutex_unlock(&wl->mutex); + mdelay(WL1271_SUSPEND_SLEEP); + + return 0; +} + static int wl1271_setup(struct wl1271 *wl) { wl->raw_fw_status =3D kzalloc(wl->fw_status_len, GFP_KERNEL); @@ -1750,7 +1769,6 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw, goto out_sleep; =20 out_sleep: - wl1271_ps_elp_sleep(wl); mutex_unlock(&wl->mutex); =20 if (ret < 0) { @@ -1783,6 +1801,15 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw= , */ cancel_delayed_work(&wl->tx_watchdog_work); =20 + /* + * Use an immediate call for allowing the firmware to go into power + * save during suspend. + * Using a workque for this last write was only hapenning on resume + * leaving the firmware with power save disabled during suspend, + * while consuming full power during wowlan suspend. + */ + wlcore_fw_sleep(wl); + return 0; } =20 --=20 2.7.4 From 1586390359574621137@xxx Sun Dec 10 09:55:41 +0000 2017 X-GM-THRID: 1586122829015057276 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread