[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGsJ_4zrnw5ziZHZciC3asgsZUzWP8N69k7o48WKdV2qNn6+pw@mail.gmail.com>
Date: Mon, 29 Apr 2024 21:11:45 +1200
From: Barry Song <21cnbao@...il.com>
To: Max Filippov <jcmvbkbc@...il.com>
Cc: Guenter Roeck <linux@...ck-us.net>, chris@...kel.net, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, willy@...radead.org, dennis@...nel.org,
alexghiti@...osinc.com, Barry Song <v-songbaohua@...o.com>,
Huacai Chen <chenhuacai@...ngson.cn>, Herbert Xu <herbert@...dor.apana.org.au>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] xtensa: remove redundant flush_dcache_page and
ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE macros
On Mon, Apr 29, 2024 at 5:10 PM Max Filippov <jcmvbkbc@...il.com> wrote:
>
> On Sat, Apr 27, 2024 at 12:05 PM Guenter Roeck <linux@...ck-us.net> wrote:
> >
> > Hi,
> >
> > On Tue, Mar 19, 2024 at 02:09:20PM +1300, Barry Song wrote:
> > > From: Barry Song <v-songbaohua@...o.com>
> > >
> > > xtensa's flush_dcache_page() can be a no-op sometimes. There is a
> > > generic implementation for this case in include/asm-generic/
> > > cacheflush.h.
> > > #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> > > static inline void flush_dcache_page(struct page *page)
> > > {
> > > }
> > >
> > > #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
> > > #endif
> > >
> > > So remove the superfluous flush_dcache_page() definition, which also
> > > helps silence potential build warnings complaining the page variable
> > > passed to flush_dcache_page() is not used.
> > >
> > > In file included from crypto/scompress.c:12:
> > > include/crypto/scatterwalk.h: In function 'scatterwalk_pagedone':
> > > include/crypto/scatterwalk.h:76:30: warning: variable 'page' set but not used [-Wunused-but-set-variable]
> > > 76 | struct page *page;
> > > | ^~~~
> > > crypto/scompress.c: In function 'scomp_acomp_comp_decomp':
> > > >> crypto/scompress.c:174:38: warning: unused variable 'dst_page' [-Wunused-variable]
> > > 174 | struct page *dst_page = sg_page(req->dst);
> > > |
> > >
> > > The issue was originally reported on LoongArch by kernel test
> > > robot (Huacai fixed it on LoongArch), then reported by Guenter
> > > and me on xtensa.
> > >
> > > This patch also removes lots of redundant macros which have
> > > been defined by asm-generic/cacheflush.h.
> > >
> > > Cc: Huacai Chen <chenhuacai@...ngson.cn>
> > > Cc: Herbert Xu <herbert@...dor.apana.org.au>
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Closes: https://lore.kernel.org/oe-kbuild-all/202403091614.NeUw5zcv-lkp@intel.com/
> > > Reported-by: Barry Song <v-songbaohua@...o.com>
> > > Closes: https://lore.kernel.org/all/CAGsJ_4yDk1+axbte7FKQEwD7X2oxUCFrEc9M5YOS1BobfDFXPA@mail.gmail.com/
> > > Reported-by: Guenter Roeck <linux@...ck-us.net>
> > > Closes: https://lore.kernel.org/all/aaa8b7d7-5abe-47bf-93f6-407942436472@roeck-us.net/
> > > Fixes: 77292bb8ca69 ("crypto: scomp - remove memcpy if sg_nents is 1 and pages are lowmem")
> > > Signed-off-by: Barry Song <v-songbaohua@...o.com>
> >
> > The mainline kernel still fails to build xtensa:allmodconfig.
> >
> > Building xtensa:allmodconfig ... failed
> > --------------
> > Error log:
> > crypto/scompress.c: In function 'scomp_acomp_comp_decomp':
> > crypto/scompress.c:174:38: error: unused variable 'dst_page' [-Werror=unused-variable]
> > 174 | struct page *dst_page = sg_page(req->dst);
> >
> > This patch fixes the problem. Is there a chance to get it applied to the
> > upstream kernel, or should I just stop build testing xtensa:allmodconfig ?
>
> Applied to my xtensa tree.
Thanks for taking care of this, Max!
> I was still hoping to see rationale for why this is a useful warning.
Personally, I think the reason is quite obvious.
This warning serves as a valuable alert, highlighting an issue where Xtensa
fails to properly implement flush_dcache_page(). The problem lies in a macro
definition that neglects to evaluate its argument. Such discrepancies can
impact driver functionality across various architectures, rendering them
independent of specific architectural considerations.
>
> --
> Thanks.
> -- Max
Thanks
Barry
Powered by blists - more mailing lists