From: Yan-Hsuan Chuang <[email protected]>
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
From: Yan-Hsuan Chuang <[email protected]>
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 <[email protected]>
---
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
From: Ping-Ke Shih <[email protected]>
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 <[email protected]>
Signed-off-by: Yan-Hsuan Chuang <[email protected]>
---
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
From: Yan-Hsuan Chuang <[email protected]>
vif is not used, remove it
Signed-off-by: Yan-Hsuan Chuang <[email protected]>
---
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
From: Ping-Ke Shih <[email protected]>
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 <[email protected]>
Signed-off-by: Yan-Hsuan Chuang <[email protected]>
---
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
From: Tzu-En Huang <[email protected]>
Fix switching xtal mode leads to BT USB error issue.
Signed-off-by: Tzu-En Huang <[email protected]>
Signed-off-by: Yan-Hsuan Chuang <[email protected]>
---
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
On Wed, Feb 5, 2020 at 3:09 PM <[email protected]> wrote:
>
> From: Yan-Hsuan Chuang <[email protected]>
>
> vif is not used, remove it
>
> Signed-off-by: Yan-Hsuan Chuang <[email protected]>
> ---
Reviewed-by: Chris Chiu <[email protected]>
> 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
>
On Wed, Feb 5, 2020 at 3:09 PM <[email protected]> wrote:
>
> From: Ping-Ke Shih <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Yan-Hsuan Chuang <[email protected]>
> ---
Reviewed-by: Chris Chiu <[email protected]>
> 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
>
<[email protected]> wrote:
> From: Yan-Hsuan Chuang <[email protected]>
>
> vif is not used, remove it
>
> Signed-off-by: Yan-Hsuan Chuang <[email protected]>
> Reviewed-by: Chris Chiu <[email protected]>
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