summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chiu <chui-hao.chiu@mediatek.com>2025-01-09 14:04:36 +0300
committerFelix Fietkau <nbd@nbd.name>2025-01-14 15:42:30 +0300
commitd07ecb4f7070e84de49e8fa4e5a83dd52716d805 (patch)
tree7fad3bfa05fc0702520c32b273bf8371addfd1ba
parentdd1649ef966bb87053c17385ea2cfd1758f5385b (diff)
downloadlinux-d07ecb4f7070e84de49e8fa4e5a83dd52716d805.tar.xz
wifi: mt76: mt7996: fix register mapping
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. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Signed-off-by: Shengyu Qu <wiagn233@outlook.com> Link: https://patch.msgid.link/OSZPR01MB84344FEFF53004B5CF40BCC198132@OSZPR01MB8434.jpnprd01.prod.outlook.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7996/mmio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
index d85abec19c6f..7a8ee6c75cf2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
@@ -177,7 +177,7 @@ static u32 __mt7996_reg_addr(struct mt7996_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].mapped + ofs;