summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw88/hci.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-12-02 11:12:16 +0300
committerKalle Valo <kvalo@kernel.org>2022-12-08 17:48:40 +0300
commitd57ca103e54e2b3eea7e2603548c58bcc4155541 (patch)
treeb1e8be496515e563f1cc89338d8918722a8a2d92 /drivers/net/wireless/realtek/rtw88/hci.h
parent69020957bcb783184af1a86c8483139557cec751 (diff)
downloadlinux-d57ca103e54e2b3eea7e2603548c58bcc4155541.tar.xz
wifi: rtw88: Drop rf_lock
The rtwdev->rf_lock spinlock protects the rf register accesses in rtw_read_rf() and rtw_write_rf(). Most callers of these functions hold rtwdev->mutex already with the exception of the callsites in the debugfs code. The debugfs code doesn't justify an extra lock, so acquire the mutex there as well before calling rf register accessors and drop the now unnecessary spinlock. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221202081224.2779981-4-s.hauer@pengutronix.de
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/hci.h')
-rw-r--r--drivers/net/wireless/realtek/rtw88/hci.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/hci.h b/drivers/net/wireless/realtek/rtw88/hci.h
index 4c6fc6fb3f83..830d7532f2a3 100644
--- a/drivers/net/wireless/realtek/rtw88/hci.h
+++ b/drivers/net/wireless/realtek/rtw88/hci.h
@@ -166,12 +166,11 @@ static inline u32
rtw_read_rf(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
u32 addr, u32 mask)
{
- unsigned long flags;
u32 val;
- spin_lock_irqsave(&rtwdev->rf_lock, flags);
+ lockdep_assert_held(&rtwdev->mutex);
+
val = rtwdev->chip->ops->read_rf(rtwdev, rf_path, addr, mask);
- spin_unlock_irqrestore(&rtwdev->rf_lock, flags);
return val;
}
@@ -180,11 +179,9 @@ static inline void
rtw_write_rf(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
u32 addr, u32 mask, u32 data)
{
- unsigned long flags;
+ lockdep_assert_held(&rtwdev->mutex);
- spin_lock_irqsave(&rtwdev->rf_lock, flags);
rtwdev->chip->ops->write_rf(rtwdev, rf_path, addr, mask, data);
- spin_unlock_irqrestore(&rtwdev->rf_lock, flags);
}
static inline u32