mt7601u: make write with mask access atomic
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 mt7601u: make write with mask access atomic
Introduce __mt7601u_rr and __mt7601u_vendor_single_wr routines in order to make mt7601u_rmw and mt7601u_rmc atomic. This patch does not fix a reported issue but makes the usb access more robust to concurrent operations on the same register since it is theoretically possible that read and write accesses of mt7601u_rmw/mt7601u_rmc can be interleaved with a different write operation on the same register.
Moreover using __mt7601u_rr and __mt7601u_vendor_single_wr in mt7601u_rmw/mt7601u_rmc allows to grab vendor_req_mutex mutex once instead of twice
---
Changes since v1:
- improve commit log
--- drivers/net/wireless/mediatek/mt7601u/mt7601u.h | 3 +- drivers/net/wireless/mediatek/mt7601u/usb.c | 52 ++++++++++++++++++------- 2 files changed, 39 insertions(+), 16 deletions(-)
drivers/net/wireless/mediatek/mt7601u/mt7601u.h +2 -1
@@ -147,7 +147,8 @@ enum {* @rx_lock: protects @rx_q. * @con_mon_lock: protects @ap_bssid, @bcn_*, @avg_rssi. * @mutex: ensures exclusive access from mac80211 callbacks. -* @vendor_req_mutex: protects @vend_buf, ensures atomicity of split writes. +* @vendor_req_mutex: protects @vend_buf, ensures atomicity of read/write +* accesses * @reg_atomic_mutex: ensures atomicity of indirect register accesses * (accesses to RF and BBP). * @hw_atomic_mutex: ensures exclusive access to HW during critical
drivers/net/wireless/mediatek/mt7601u/usb.c +37 -15
100 lines not on this page · raw message
Signature · 1 line
2.14.3
Quoted 11 lines · Lorenzo Bianconi
Introduce
__mt7601u_rrand__mt7601u_vendor_single_wrroutines in order to makemt7601u_rmwandmt7601u_rmcatomic. This patch does not fix a reported issue but makes the usb access more robust to concurrent operations on the same register since it is theoretically possible that read and write accesses of mt7601u_rmw/mt7601u_rmc can be interleaved with a different write operation on the same register.
Moreover using__mt7601u_rrand__mt7601u_vendor_single_wrin mt7601u_rmw/mt7601u_rmc allows to grabvendor_req_mutexmutex once instead of twiceSigned-off-by Lorenzo Bianconi <[email protected]>
Thanks!
Quoted 10 lines · Lorenzo Bianconi
Introduce
__mt7601u_rrand__mt7601u_vendor_single_wrroutines in order to makemt7601u_rmwandmt7601u_rmcatomic. This patch does not fix a reported issue but makes the usb access more robust to concurrent operations on the same register since it is theoretically possible that read and write accesses of mt7601u_rmw/mt7601u_rmc can be interleaved with a different write operation on the same register.
Moreover using__mt7601u_rrand__mt7601u_vendor_single_wrin mt7601u_rmw/mt7601u_rmc allows to grabvendor_req_mutexmutex once instead of twice
Quoted 2 lines
Signed-off-by Lorenzo Bianconi <[email protected]>Acked-by Jakub Kicinski <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
fee05843801c mt7601u: make write with mask access atomic
Signature · 3 lines
https://patchwork.kernel.org/patch/10225849/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches