[PATCH v1 1/2] wifi: mt76: mt7915: fix register mapping
From: Shengyu Qu
Date: Thu Jan 09 2025 - 06:05:06 EST
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the CR
address is located at the boundary of an entry.
SDK patch: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/3627eb7e975959ed944e333e383e92f01ac5cdb9/autobuild/autobuild_5.4_mac80211_release/package/kernel/mt76/patches/0026-wifi-mt76-mt7915-fix-register-mapping.patch
Fixes: cd4c314a65d3 ("mt76: mt7915: refine register definition")
Signed-off-by: Peter Chiu <chui-hao.chiu@xxxxxxxxxxxx>
Signed-off-by: Shengyu Qu <wiagn233@xxxxxxxxxxx>
---
drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
index 530182e20ce2..876f0692850a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
@@ -486,7 +486,7 @@ static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)
continue;
ofs = addr - dev->reg.map[i].phys;
- if (ofs > dev->reg.map[i].size)
+ if (ofs >= dev->reg.map[i].size)
continue;
return dev->reg.map[i].maps + ofs;
--
2.43.0