All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] rtw88: regular driver updates
@ 2020-02-05  7:08 yhchuang
  2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

This patch set has some patches for regular update.

Ping-Ke Shih (2):
  rtw88: move rtw_enter_ips() to the last when config
  rtw88: add ciphers to suppress error message

Tzu-En Huang (1):
  rtw88: 8822c: update power sequence to v16

Yan-Hsuan Chuang (4):
  rtw88: remove unused parameter vif in rtw_lps_pg_info_get()
  rtw88: add rtw_read8_mask and rtw_read16_mask
  rtw88: pci: 8822c should set clock delay to zero
  rtw88: avoid holding mutex for cancel_delayed_work_sync()

 drivers/net/wireless/realtek/rtw88/coex.c     |  3 +++
 drivers/net/wireless/realtek/rtw88/fw.c       |  9 ++++---
 drivers/net/wireless/realtek/rtw88/hci.h      | 26 +++++++++++++++++++
 drivers/net/wireless/realtek/rtw88/mac80211.c | 22 +++++++++-------
 drivers/net/wireless/realtek/rtw88/main.c     |  5 ++++
 drivers/net/wireless/realtek/rtw88/pci.c      |  7 +++++
 drivers/net/wireless/realtek/rtw88/pci.h      |  1 +
 drivers/net/wireless/realtek/rtw88/rtw8822c.c |  5 ++++
 8 files changed, 66 insertions(+), 12 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get()
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-12  2:53   ` Chris Chiu
  2020-02-12 16:19   ` Kalle Valo
  2020-02-05  7:08 ` [PATCH 2/7] rtw88: add rtw_read8_mask and rtw_read16_mask yhchuang
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

vif is not used, remove it

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/fw.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index 243441453ead..b765b26b6926 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -819,8 +819,7 @@ static struct sk_buff *rtw_lps_pg_dpk_get(struct ieee80211_hw *hw)
 	return skb;
 }
 
-static struct sk_buff *rtw_lps_pg_info_get(struct ieee80211_hw *hw,
-					   struct ieee80211_vif *vif)
+static struct sk_buff *rtw_lps_pg_info_get(struct ieee80211_hw *hw)
 {
 	struct rtw_dev *rtwdev = hw->priv;
 	struct rtw_chip_info *chip = rtwdev->chip;
@@ -876,7 +875,7 @@ static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
 		skb_new = rtw_lps_pg_dpk_get(hw);
 		break;
 	case RSVD_LPS_PG_INFO:
-		skb_new = rtw_lps_pg_info_get(hw, vif);
+		skb_new = rtw_lps_pg_info_get(hw);
 		break;
 	case RSVD_PROBE_REQ:
 		ssid = (struct cfg80211_ssid *)rsvd_pkt->ssid;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/7] rtw88: add rtw_read8_mask and rtw_read16_mask
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
  2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-05  7:08 ` [PATCH 3/7] rtw88: pci: 8822c should set clock delay to zero yhchuang
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

Both are missing but could be used sometimes.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/hci.h | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/hci.h b/drivers/net/wireless/realtek/rtw88/hci.h
index 85a81a578fd5..cad56389182c 100644
--- a/drivers/net/wireless/realtek/rtw88/hci.h
+++ b/drivers/net/wireless/realtek/rtw88/hci.h
@@ -193,6 +193,32 @@ rtw_read32_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask)
 	return ret;
 }
 
+static inline u16
+rtw_read16_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask)
+{
+	u32 shift = __ffs(mask);
+	u32 orig;
+	u32 ret;
+
+	orig = rtw_read16(rtwdev, addr);
+	ret = (orig & mask) >> shift;
+
+	return ret;
+}
+
+static inline u8
+rtw_read8_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask)
+{
+	u32 shift = __ffs(mask);
+	u32 orig;
+	u32 ret;
+
+	orig = rtw_read8(rtwdev, addr);
+	ret = (orig & mask) >> shift;
+
+	return ret;
+}
+
 static inline void
 rtw_write32_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)
 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/7] rtw88: pci: 8822c should set clock delay to zero
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
  2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
  2020-02-05  7:08 ` [PATCH 2/7] rtw88: add rtw_read8_mask and rtw_read16_mask yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-05  7:08 ` [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config yhchuang
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

Since RTL8822CE has enabled reference clock auto calibration,
there is no need to add any clock delay for covering the timing
gap of the reference clock.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/pci.c | 7 +++++++
 drivers/net/wireless/realtek/rtw88/pci.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 1fbc14c149ec..9ac77aef708d 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1197,11 +1197,18 @@ static void rtw_pci_link_ps(struct rtw_dev *rtwdev, bool enter)
 
 static void rtw_pci_link_cfg(struct rtw_dev *rtwdev)
 {
+	struct rtw_chip_info *chip = rtwdev->chip;
 	struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
 	struct pci_dev *pdev = rtwpci->pdev;
 	u16 link_ctrl;
 	int ret;
 
+	/* RTL8822CE has enabled REFCLK auto calibration, it does not need
+	 * to add clock delay to cover the REFCLK timing gap.
+	 */
+	if (chip->id == RTW_CHIP_TYPE_8822C)
+		rtw_dbi_write8(rtwdev, RTK_PCIE_CLKDLY_CTRL, 0);
+
 	/* Though there is standard PCIE configuration space to set the
 	 * link control register, but by Realtek's design, driver should
 	 * check if host supports CLKREQ/ASPM to enable the HW module.
diff --git a/drivers/net/wireless/realtek/rtw88/pci.h b/drivers/net/wireless/realtek/rtw88/pci.h
index 1580cfc57361..cd4fcd064cdb 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.h
+++ b/drivers/net/wireless/realtek/rtw88/pci.h
@@ -39,6 +39,7 @@
 #define RTK_PCIE_LINK_CFG	0x0719
 #define BIT_CLKREQ_SW_EN	BIT(4)
 #define BIT_L1_SW_EN		BIT(3)
+#define RTK_PCIE_CLKDLY_CTRL	0x0725
 
 #define BIT_PCI_BCNQ_FLAG	BIT(4)
 #define RTK_PCI_TXBD_DESA_BCNQ	0x308
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
                   ` (2 preceding siblings ...)
  2020-02-05  7:08 ` [PATCH 3/7] rtw88: pci: 8822c should set clock delay to zero yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-12  4:16   ` Chris Chiu
  2020-02-05  7:08 ` [PATCH 5/7] rtw88: avoid holding mutex for cancel_delayed_work_sync() yhchuang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Ping-Ke Shih <pkshih@realtek.com>

When driver is coming up, mac80211 will set changed as ~0 (0xffffffff),
and driver could enter IDLE state (power off) before switching channel or
other config event. So move rtw_enter_ips() to the last, to make sure the
driver completed the config events before going to IDLE state.

So, moves leave/enter IPS config to be first/last one according to flag
IEEE80211_CONF_IDLE. If there're more configureations we want to add in
the future, they must locate between leave/enter IPS.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/mac80211.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 6fc33e11d08c..8742b3f2b5c1 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -75,15 +75,12 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed)
 
 	rtw_leave_lps_deep(rtwdev);
 
-	if (changed & IEEE80211_CONF_CHANGE_IDLE) {
-		if (hw->conf.flags & IEEE80211_CONF_IDLE) {
-			rtw_enter_ips(rtwdev);
-		} else {
-			ret = rtw_leave_ips(rtwdev);
-			if (ret) {
-				rtw_err(rtwdev, "failed to leave idle state\n");
-				goto out;
-			}
+	if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
+	    !(hw->conf.flags & IEEE80211_CONF_IDLE)) {
+		ret = rtw_leave_ips(rtwdev);
+		if (ret) {
+			rtw_err(rtwdev, "failed to leave idle state\n");
+			goto out;
 		}
 	}
 
@@ -99,6 +96,10 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed)
 	if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
 		rtw_set_channel(rtwdev);
 
+	if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
+	    (hw->conf.flags & IEEE80211_CONF_IDLE))
+		rtw_enter_ips(rtwdev);
+
 out:
 	mutex_unlock(&rtwdev->mutex);
 	return ret;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/7] rtw88: avoid holding mutex for cancel_delayed_work_sync()
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
                   ` (3 preceding siblings ...)
  2020-02-05  7:08 ` [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-05  7:08 ` [PATCH 6/7] rtw88: add ciphers to suppress error message yhchuang
  2020-02-05  7:08 ` [PATCH 7/7] rtw88: 8822c: update power sequence to v16 yhchuang
  6 siblings, 0 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

Driver could possibly be dead-locked while canceling works with
*_sync() with mutex lock held. Those cancel_delayed_work_sync()
functions will wait until the work is done, but if we hold the
lock, they will never acquire the lock.

To prevent this, simply release the lock and acquire again after
the works have been canceled. And to avoid the works being queued
again, check if the device is at RTW_FLAG_RUNNING state, otherwise
just return and do nothing.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c | 3 +++
 drivers/net/wireless/realtek/rtw88/fw.c   | 4 ++++
 drivers/net/wireless/realtek/rtw88/main.c | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 4dfb2ec395ee..f91dc21a8bf1 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -1904,6 +1904,9 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
 
 	lockdep_assert_held(&rtwdev->mutex);
 
+	if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
+		return;
+
 	coex_dm->reason = reason;
 
 	/* update wifi_link_info_ext variable */
diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index b765b26b6926..b36928470fc0 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -136,6 +136,9 @@ void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb)
 
 	mutex_lock(&rtwdev->mutex);
 
+	if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
+		goto unlock;
+
 	switch (c2h->id) {
 	case C2H_BT_INFO:
 		rtw_coex_bt_info_notify(rtwdev, c2h->payload, len);
@@ -153,6 +156,7 @@ void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb)
 		break;
 	}
 
+unlock:
 	mutex_unlock(&rtwdev->mutex);
 }
 
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 2845d2838f7b..edecc7d7ea56 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -909,11 +909,16 @@ void rtw_core_stop(struct rtw_dev *rtwdev)
 	clear_bit(RTW_FLAG_RUNNING, rtwdev->flags);
 	clear_bit(RTW_FLAG_FW_RUNNING, rtwdev->flags);
 
+	mutex_unlock(&rtwdev->mutex);
+
+	cancel_work_sync(&rtwdev->c2h_work);
 	cancel_delayed_work_sync(&rtwdev->watch_dog_work);
 	cancel_delayed_work_sync(&coex->bt_relink_work);
 	cancel_delayed_work_sync(&coex->bt_reenable_work);
 	cancel_delayed_work_sync(&coex->defreeze_work);
 
+	mutex_lock(&rtwdev->mutex);
+
 	rtw_power_off(rtwdev);
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/7] rtw88: add ciphers to suppress error message
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
                   ` (4 preceding siblings ...)
  2020-02-05  7:08 ` [PATCH 5/7] rtw88: avoid holding mutex for cancel_delayed_work_sync() yhchuang
@ 2020-02-05  7:08 ` yhchuang
  2020-02-05  7:08 ` [PATCH 7/7] rtw88: 8822c: update power sequence to v16 yhchuang
  6 siblings, 0 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Ping-Ke Shih <pkshih@realtek.com>

Though hardware isn't implement CCMP-256, GCMP and GCMP-256, it's possible
to fallback to use software de-/en-cryption implemented by mac80211.

Without adding these chipers, kernel log will show something if we connect
to a WPA3 enterprise AP, likes
  wlan0: failed to set key (1, ff:ff:ff:ff:ff:ff) to hardware (-524)

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/mac80211.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 8742b3f2b5c1..0190ec6fa090 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -515,6 +515,9 @@ static int rtw_ops_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	case WLAN_CIPHER_SUITE_BIP_CMAC_256:
 	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
 	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
+	case WLAN_CIPHER_SUITE_CCMP_256:
+	case WLAN_CIPHER_SUITE_GCMP:
+	case WLAN_CIPHER_SUITE_GCMP_256:
 		/* suppress error messages */
 		return -EOPNOTSUPP;
 	default:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/7] rtw88: 8822c: update power sequence to v16
  2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
                   ` (5 preceding siblings ...)
  2020-02-05  7:08 ` [PATCH 6/7] rtw88: add ciphers to suppress error message yhchuang
@ 2020-02-05  7:08 ` yhchuang
  6 siblings, 0 replies; 11+ messages in thread
From: yhchuang @ 2020-02-05  7:08 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, briannorris

From: Tzu-En Huang <tehuang@realtek.com>

Fix switching xtal mode leads to BT USB error issue.

Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index 3865097696d4..d49c8b697e4f 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -3544,6 +3544,11 @@ static struct rtw_pwr_seq_cmd trans_cardemu_to_act_8822c[] = {
 	 RTW_PWR_INTF_ALL_MSK,
 	 RTW_PWR_ADDR_MAC,
 	 RTW_PWR_CMD_WRITE, BIT(2), BIT(2)},
+	{0x1064,
+	 RTW_PWR_CUT_ALL_MSK,
+	 RTW_PWR_INTF_ALL_MSK,
+	 RTW_PWR_ADDR_MAC,
+	 RTW_PWR_CMD_WRITE, BIT(1), BIT(1)},
 	{0xFFFF,
 	 RTW_PWR_CUT_ALL_MSK,
 	 RTW_PWR_INTF_ALL_MSK,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get()
  2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
@ 2020-02-12  2:53   ` Chris Chiu
  2020-02-12 16:19   ` Kalle Valo
  1 sibling, 0 replies; 11+ messages in thread
From: Chris Chiu @ 2020-02-12  2:53 UTC (permalink / raw)
  To: Tony Chuang; +Cc: Kalle Valo, linux-wireless, Brian Norris

On Wed, Feb 5, 2020 at 3:09 PM <yhchuang@realtek.com> wrote:
>
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> vif is not used, remove it
>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> ---
Reviewed-by: Chris Chiu <chiu@endlessm.com>

>  drivers/net/wireless/realtek/rtw88/fw.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index 243441453ead..b765b26b6926 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c
> @@ -819,8 +819,7 @@ static struct sk_buff *rtw_lps_pg_dpk_get(struct ieee80211_hw *hw)
>         return skb;
>  }
>
> -static struct sk_buff *rtw_lps_pg_info_get(struct ieee80211_hw *hw,
> -                                          struct ieee80211_vif *vif)
> +static struct sk_buff *rtw_lps_pg_info_get(struct ieee80211_hw *hw)
>  {
>         struct rtw_dev *rtwdev = hw->priv;
>         struct rtw_chip_info *chip = rtwdev->chip;
> @@ -876,7 +875,7 @@ static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
>                 skb_new = rtw_lps_pg_dpk_get(hw);
>                 break;
>         case RSVD_LPS_PG_INFO:
> -               skb_new = rtw_lps_pg_info_get(hw, vif);
> +               skb_new = rtw_lps_pg_info_get(hw);
>                 break;
>         case RSVD_PROBE_REQ:
>                 ssid = (struct cfg80211_ssid *)rsvd_pkt->ssid;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config
  2020-02-05  7:08 ` [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config yhchuang
@ 2020-02-12  4:16   ` Chris Chiu
  0 siblings, 0 replies; 11+ messages in thread
From: Chris Chiu @ 2020-02-12  4:16 UTC (permalink / raw)
  To: Tony Chuang; +Cc: Kalle Valo, linux-wireless, Brian Norris

On Wed, Feb 5, 2020 at 3:09 PM <yhchuang@realtek.com> wrote:
>
> From: Ping-Ke Shih <pkshih@realtek.com>
>
> When driver is coming up, mac80211 will set changed as ~0 (0xffffffff),
> and driver could enter IDLE state (power off) before switching channel or
> other config event. So move rtw_enter_ips() to the last, to make sure the
> driver completed the config events before going to IDLE state.
>
> So, moves leave/enter IPS config to be first/last one according to flag
> IEEE80211_CONF_IDLE. If there're more configureations we want to add in
> the future, they must locate between leave/enter IPS.
>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> ---
Reviewed-by: Chris Chiu <chiu@endlessm.com>
>  drivers/net/wireless/realtek/rtw88/mac80211.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 6fc33e11d08c..8742b3f2b5c1 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
> @@ -75,15 +75,12 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed)
>
>         rtw_leave_lps_deep(rtwdev);
>
> -       if (changed & IEEE80211_CONF_CHANGE_IDLE) {
> -               if (hw->conf.flags & IEEE80211_CONF_IDLE) {
> -                       rtw_enter_ips(rtwdev);
> -               } else {
> -                       ret = rtw_leave_ips(rtwdev);
> -                       if (ret) {
> -                               rtw_err(rtwdev, "failed to leave idle state\n");
> -                               goto out;
> -                       }
> +       if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
> +           !(hw->conf.flags & IEEE80211_CONF_IDLE)) {
> +               ret = rtw_leave_ips(rtwdev);
> +               if (ret) {
> +                       rtw_err(rtwdev, "failed to leave idle state\n");
> +                       goto out;
>                 }
>         }
>
> @@ -99,6 +96,10 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed)
>         if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
>                 rtw_set_channel(rtwdev);
>
> +       if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
> +           (hw->conf.flags & IEEE80211_CONF_IDLE))
> +               rtw_enter_ips(rtwdev);
> +
>  out:
>         mutex_unlock(&rtwdev->mutex);
>         return ret;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get()
  2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
  2020-02-12  2:53   ` Chris Chiu
@ 2020-02-12 16:19   ` Kalle Valo
  1 sibling, 0 replies; 11+ messages in thread
From: Kalle Valo @ 2020-02-12 16:19 UTC (permalink / raw)
  To: yhchuang; +Cc: linux-wireless, briannorris

<yhchuang@realtek.com> wrote:

> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> vif is not used, remove it
> 
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Reviewed-by: Chris Chiu <chiu@endlessm.com>

7 patches applied to wireless-drivers-next.git, thanks.

597fc0e6ad59 rtw88: remove unused parameter vif in rtw_lps_pg_info_get()
9e01c07069db rtw88: add rtw_read8_mask and rtw_read16_mask
2a4225551afb rtw88: pci: 8822c should set clock delay to zero
398b9bdab2c3 rtw88: move rtw_enter_ips() to the last when config
6eab0ba99bc2 rtw88: avoid holding mutex for cancel_delayed_work_sync()
55cc84421c30 rtw88: add ciphers to suppress error message
8299adec99b2 rtw88: 8822c: update power sequence to v16

-- 
https://patchwork.kernel.org/patch/11365825/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-12 16:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05  7:08 [PATCH 0/7] rtw88: regular driver updates yhchuang
2020-02-05  7:08 ` [PATCH 1/7] rtw88: remove unused parameter vif in rtw_lps_pg_info_get() yhchuang
2020-02-12  2:53   ` Chris Chiu
2020-02-12 16:19   ` Kalle Valo
2020-02-05  7:08 ` [PATCH 2/7] rtw88: add rtw_read8_mask and rtw_read16_mask yhchuang
2020-02-05  7:08 ` [PATCH 3/7] rtw88: pci: 8822c should set clock delay to zero yhchuang
2020-02-05  7:08 ` [PATCH 4/7] rtw88: move rtw_enter_ips() to the last when config yhchuang
2020-02-12  4:16   ` Chris Chiu
2020-02-05  7:08 ` [PATCH 5/7] rtw88: avoid holding mutex for cancel_delayed_work_sync() yhchuang
2020-02-05  7:08 ` [PATCH 6/7] rtw88: add ciphers to suppress error message yhchuang
2020-02-05  7:08 ` [PATCH 7/7] rtw88: 8822c: update power sequence to v16 yhchuang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.