Now, stack has introduced wiphy lock. And, the normal paths calling
RF read/write should be under wiphy lock. So, replace RF mutex with
wiphy lock assertion. Besides, in dbgfs paths, add the corresponding
lock option.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260310080146.31113-11-pkshih@realtek.com
return -ENOMEM;
spin_lock_init(&rtwdev->ba_lock);
spin_lock_init(&rtwdev->rpwm_lock);
- mutex_init(&rtwdev->rf_mutex);
rtwdev->total_sta_assoc = 0;
rtw89_init_wait(&rtwdev->mcc.wait);
__rtw89_fw_free_all_early_h2c(rtwdev);
destroy_workqueue(rtwdev->txq_wq);
- mutex_destroy(&rtwdev->rf_mutex);
}
EXPORT_SYMBOL(rtw89_core_deinit);
refcount_t refcount_ap_info;
struct list_head rtwvifs_list;
- /* used to protect rf read write */
- struct mutex rf_mutex;
struct workqueue_struct *txq_wq;
struct work_struct txq_work;
struct delayed_work txq_reinvoke_work;
rtw89_read_rf(struct rtw89_dev *rtwdev, enum rtw89_rf_path rf_path,
u32 addr, u32 mask)
{
- u32 val;
-
- mutex_lock(&rtwdev->rf_mutex);
- val = rtwdev->chip->ops->read_rf(rtwdev, rf_path, addr, mask);
- mutex_unlock(&rtwdev->rf_mutex);
+ lockdep_assert_wiphy(rtwdev->hw->wiphy);
- return val;
+ return rtwdev->chip->ops->read_rf(rtwdev, rf_path, addr, mask);
}
static inline void
rtw89_write_rf(struct rtw89_dev *rtwdev, enum rtw89_rf_path rf_path,
u32 addr, u32 mask, u32 data)
{
- mutex_lock(&rtwdev->rf_mutex);
+ lockdep_assert_wiphy(rtwdev->hw->wiphy);
+
rtwdev->chip->ops->write_rf(rtwdev, rf_path, addr, mask, data);
- mutex_unlock(&rtwdev->rf_mutex);
}
static inline u32 rtw89_read32_pci_cfg(struct rtw89_dev *rtwdev, u32 addr)
static const struct rtw89_debugfs rtw89_debugfs_templ = {
.read_reg = rtw89_debug_priv_select_and_get(read_reg),
.write_reg = rtw89_debug_priv_set(write_reg),
- .read_rf = rtw89_debug_priv_select_and_get(read_rf),
- .write_rf = rtw89_debug_priv_set(write_rf),
- .rf_reg_dump = rtw89_debug_priv_get(rf_reg_dump, RSIZE_8K),
+ .read_rf = rtw89_debug_priv_select_and_get(read_rf, RLOCK),
+ .write_rf = rtw89_debug_priv_set(write_rf, WLOCK),
+ .rf_reg_dump = rtw89_debug_priv_get(rf_reg_dump, RSIZE_8K, RLOCK),
.txpwr_table = rtw89_debug_priv_get(txpwr_table, RSIZE_20K, RLOCK),
.mac_reg_dump = rtw89_debug_priv_select_and_get(mac_reg_dump, RSIZE_128K),
.mac_mem_dump = rtw89_debug_priv_select_and_get(mac_mem_dump, RSIZE_16K, RLOCK),