[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Znp12j23mf1bUEqp@alpha.franken.de>
Date: Tue, 25 Jun 2024 09:46:34 +0200
From: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To: Shiji Yang <yangshiji66@...look.com>
Cc: linux-mips@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Javier Martinez Canillas <javierm@...hat.com>,
Khalid Aziz <khalid@...ehiking.org>, Baoquan He <bhe@...hat.com>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Serge Semin <fancer.lancer@...il.com>, linux-kernel@...r.kernel.org,
Mieczyslaw Nalewaj <namiltd@...oo.com>
Subject: Re: [PATCH V2] mips: kernel: fix detect_memory_region() function
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 ]
Powered by blists - more mailing lists