From: Peter Chiu Date: Thu, 9 Jan 2025 11:04:35 +0000 (+0800) Subject: wifi: mt76: mt7915: fix register mapping X-Git-Tag: v6.14-rc1~162^2~20^2~4^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd1649ef966bb87053c17385ea2cfd1758f5385b;p=thirdparty%2Fkernel%2Flinux.git wifi: mt76: mt7915: 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: cd4c314a65d3 ("mt76: mt7915: refine register definition") Signed-off-by: Peter Chiu Signed-off-by: Shengyu Qu Link: https://patch.msgid.link/OSZPR01MB843401EAA1DA6BD7AEF356F298132@OSZPR01MB8434.jpnprd01.prod.outlook.com Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c index 530182e20ce29..876f0692850a2 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;