Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3780630ybe; Mon, 16 Sep 2019 00:46:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMnk8OOtjGPTjIXK8PfFxzo7y1h/qFO0WEuDzJEj6WNs+i3w9Z81k9Ejiq5XcHqStsrQ8u X-Received: by 2002:a17:906:d0c5:: with SMTP id bq5mr50987052ejb.95.1568619991248; Mon, 16 Sep 2019 00:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568619991; cv=none; d=google.com; s=arc-20160816; b=sbN7GZTiLSJnMYiShKSW6JBlqiSC5QDOgt8QkdVIzZyZkwl52+tbYSPeDCCDV5ty9x ht+Aqj8hmOMQbSfgun6ypGsbxN+Ta2L7AK7eBBcciJCeEeyqdWqIOgvwQfRzMW1Jt46U tHjNyzxpJaYa8kwYHFqLji/gn3Cx9vxNxA5w6ToiyyRUEl0jEyXWYRHMgkaheFulpZvf +PkM8cayTPu13z4KwwKUmnAQ0QRvlkQPOcTFDfiNMXM1YwU+/WMubehv6wJxbwAecvpV uXsojmj6o4M0YN9ZZ2tx/AYuv8SK+8aD9oNV4/zQPx6CkmklboNQ9EdRYyw9BJLf3jLF TVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:authenticated-by; bh=giXdxbKkyMf73zqYfm7ljAKlYcrRlhZ8/Jp5Nbft58I=; b=aXBHb5wyO8QxPqldIfK62k9afKDW5L2k83OAsyuHrTCRMOu1zGFOiF8sD7jZUCNZAO deui7sujflG4YJ2c5ai9HiX0v7Y5ob3ASLMseY0xSN7RUfQpbH+gC1wnQY28DrpHxnN1 SrNzXWqyuf7FvhWHsYlb3x7GSkNYOxnM5fvSAgHjXtO8QnEhTuPvjg87mRd2VHRW/Ors nkD2Lb1p3RW0xnbeaUkWrdotu8QfILihmGHQsLCvzrG4xfmHHB3yJtf1tmhgyb4tJWwU aXfXDQn34zKi5SHDUQjLBQ+GlmvTmvRMPZrX/4TE41TcKuf978gfLc6J/HGgdv1LxcZT rrHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22si10175149ejs.131.2019.09.16.00.46.03; Mon, 16 Sep 2019 00:46:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbfIPHD5 (ORCPT + 99 others); Mon, 16 Sep 2019 03:03:57 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:60324 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfIPHD5 (ORCPT ); Mon, 16 Sep 2019 03:03:57 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x8G73nLe029951, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x8G73nLe029951 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Sep 2019 15:03:49 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Mon, 16 Sep 2019 15:03:49 +0800 From: To: CC: , Subject: [PATCH 00/15] rtw88: Add support for deep PS mode Date: Mon, 16 Sep 2019 15:03:30 +0800 Message-ID: <1568617425-28062-1-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang RTL8822B/RTL8822C series devices are capable of entering deep PS mode. In contrast to Leisure Power Save (LPS) which turns off RF components periodically between beacons, deep PS mode turns off more hardware circuits. But device should enter LPS before enter deep PS mode, otherwise the state of the firmware is undefined. Under deep PS mode, driver can not read/write registers, and also the TX path is reuiqred to be idle. To make sure it, driver should acquired rtwdev->mutex lock, and then leave deep PS mode before operating on the hardware, otherwise the behavior of the device is unexpected and undefined. To add deep PS mode, some modifications for the driver are needed. For PCI part, drivers need to keep tracking on the SKBs delivered to the device and see if there will have any activity on the TX path. For the others, driver should make sure to acquire lock and leave deep PS mode. Also remove a misleading module parameter named "rtw_fw_support_lps". It is not representing property of the firmware, but to let driver decide if it wants to use LPS mode. But IEEE80211_CONF_PS can handle it, by setting power save [on/off] through user space. So just remove it, and listen to IEEE80211_CONF_CHANGE_PS. Yan-Hsuan Chuang (15): rtw88: remove redundant flag check helper function rtw88: configure firmware after HCI started rtw88: pci: reset H2C queue indexes in a single write rtw88: pci: extract skbs free routine for trx rings rtw88: pci: release tx skbs DMAed when stop rtw88: not to enter or leave PS under IRQ rtw88: not to control LPS by each vif rtw88: remove unused lps state check helper rtw88: LPS enter/leave should be protected by lock rtw88: leave PS state for dynamic mechanism rtw88: add deep power save support rtw88: not to enter LPS by coex strategy rtw88: select deep PS mode when module is inserted rtw88: add deep PS PG mode for 8822c rtw88: remove misleading module parameter rtw_fw_support_lps drivers/net/wireless/realtek/rtw88/coex.c | 14 +-- drivers/net/wireless/realtek/rtw88/debug.h | 1 + drivers/net/wireless/realtek/rtw88/fw.c | 77 ++++++++++++ drivers/net/wireless/realtek/rtw88/fw.h | 29 +++++ drivers/net/wireless/realtek/rtw88/hci.h | 6 + drivers/net/wireless/realtek/rtw88/mac.c | 5 +- drivers/net/wireless/realtek/rtw88/mac80211.c | 43 +++++-- drivers/net/wireless/realtek/rtw88/main.c | 88 ++++++++------ drivers/net/wireless/realtek/rtw88/main.h | 32 +++-- drivers/net/wireless/realtek/rtw88/pci.c | 125 +++++++++++++++++--- drivers/net/wireless/realtek/rtw88/phy.c | 2 +- drivers/net/wireless/realtek/rtw88/ps.c | 162 +++++++++++++++++--------- drivers/net/wireless/realtek/rtw88/ps.h | 14 ++- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + drivers/net/wireless/realtek/rtw88/rx.c | 2 - drivers/net/wireless/realtek/rtw88/sec.c | 21 ++++ drivers/net/wireless/realtek/rtw88/sec.h | 1 + drivers/net/wireless/realtek/rtw88/tx.c | 2 - 19 files changed, 471 insertions(+), 155 deletions(-) -- 2.7.4