Skip to contentSkip to conversation

CNS3xxx: Fix PCI cns3xxx_write_config()

PATCH New Krzysztof Halasa 2 participants 2 messages Mar 11, 2016 – Mar 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CNS3xxx: Fix PCI cns3xxx_write_config()

The "where" offset was added twice, fix it.

Fixes 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow")
arch/arm/mach-cns3xxx/pcie.c +3 -3
index 47905a5..318394e 100644
@@ -220,13 +220,13 @@ static void cns3xxx_write_config(struct cns3xxx_pcie *cnspci,
 	u32 mask = (0x1ull << (size * 8)) - 1;
 	int shift = (where % 4) * 8;
 
-	v = readl_relaxed(base + (where & 0xffc));
+	v = readl_relaxed(base);
 
 	v &= ~(mask << shift);
 	v |= (val & mask) << shift;
 
-	writel_relaxed(v, base + (where & 0xffc));
-	readl_relaxed(base + (where & 0xffc));
+	writel_relaxed(v, base);
+	readl_relaxed(base);
 }
 
 static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
Signature · 4 lines
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
#1 lore raw

PATCH 1/1 CNS3xxx: Fix PCI cns3xxx_write_config()

Quoted 4 lines · Krzysztof Halasa

The "where" offset was added twice, fix it.

Fixes 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow")

Thanks, applied to next/fixes-non-critical.

-Olof