On Tue, Jun 25, 2024 at 09:44:44AM +0800, Shiji Yang wrote: > for (size = sz_min; size < sz_max; size <<= 1) { > - if (!memcmp(dm, dm + size, sizeof(detect_magic))) > - break; > + __raw_writel(MIPS_MEM_TEST_PATTERN, dm); > + if (__raw_readl(dm) == __raw_readl(dm + size)) { > + __raw_writel(~MIPS_MEM_TEST_PATTERN, dm); > + if (__raw_readl(dm) == __raw_readl(dm + size)) > + break; > + } you are testing memory, so just use pointers. __raw_readl and __raw_writel are for io regions (which should be ioremppaed before usage). Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]