Re: [PATCH] sh: boot: Remove sh5 cache handling

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <23a3abf08f358588ef448c1a2f2ef53013ce6b69.camel@physik.fu-berlin.de>
On Mon, 2024-04-29 at 09:49 +0200, Geert Uytterhoeven wrote:
> Hi Adrian,
> 
> On Mon, Apr 29, 2024 at 9:46 AM John Paul Adrian Glaubitz
> <[email protected]> wrote:
> > On Wed, 2024-04-24 at 13:54 +0200, Geert Uytterhoeven wrote:
> > > Commit 37744feebc086908 ("sh: remove sh5 support") in v5.8 forgot to
> > > remove the sh5 cache handling.
> > > 
> > > Suggested-by: Yoshinori Sato <[email protected]>
> > > Signed-off-by: Geert Uytterhoeven <[email protected]>
> 
> > > --- a/arch/sh/boot/compressed/cache.c
> > > +++ /dev/null
> > > @@ -1,13 +0,0 @@
> > > -// SPDX-License-Identifier: GPL-2.0
> > > -int cache_control(unsigned int command)
> > > -{
> > > -     volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
> > > -     int i;
> > > -
> > > -     for (i = 0; i < (32 * 1024); i += 32) {
> > > -             (void)*p;
> > > -             p += (32 / sizeof(int));
> > > -     }
> > > -
> > > -     return 0;
> > > -}
> 
> > Interesting, looking at boot/compressed/cache.c, it seems that the whole code
> > is actually a no-op and does nothing but increasing a pointer. So I agree we
> > should just delete it.
> 
> It is not a no-op: it also reads from memory, to load new data in
> the cache, and evicting the old data.

Yeah, I actually came to this conclusion right after sending my reply. However, the
command parameter is never used.

Don't have the 32-bit SH CPUs any caches? The code itself is unconditionally executed,
it seems.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.