Re: [PATCH] firmware_loader: Replace kmap() with kmap_local_page()

From: Fabio M. De Francesco
Date: Thu Jul 14 2022 - 19:54:33 EST


On giovedì 14 luglio 2022 22:40:32 CEST Luis Chamberlain wrote:
> On Thu, Jul 14, 2022 at 04:50:42PM +0200, Greg Kroah-Hartman wrote:
> > On Mon, Jul 11, 2022 at 08:52:49PM +0200, Fabio M. De Francesco wrote:
> > >
> > > I see that the outputs of selftests, regardless of running a 5.19.0-
rc6
> > > kernel with or without my changes, show always the same error:
> > >
> > > "not ok 1 selftests: firmware: fw_run_tests.sh # TIMEOUT 165
seconds".".
> > >
> > > I ran those tests on a QEMU/KVM 32-bits VM, booting a vanilla 5.19.0-
rc6
> > > kernel with HIGHMEM64GB enabled.
> > >
> > > As said, outputs don't change with or without my patch. Instead it
changes
> > > with the latest openSUSE stock kernel (5.18.9-2-pae):
> > >
> > > "ok 1 selftests: firmware: fw_run_tests.sh".
> > >
> > > Unfortunately, I'm not familiar with kernel selftests. Any ideas
about what
> > > could have made this tests fail? Is it expected?
> > >
> > > If not, I can try and figure out why these outputs are not what they
should
> > > be (the second version of my patch can wait the time it takes).
> >
> > No idea, sorry, Luis might know more.
>
> The selftests should have a config file, ensure that stuff is all
> enabled. Can you verify if this stuff was enabled on your config:
>
> cat tools/testing/selftests/firmware/config
> CONFIG_TEST_FIRMWARE=y
> CONFIG_FW_LOADER=y
> CONFIG_FW_LOADER_USER_HELPER=y
> CONFIG_IKCONFIG=y
> CONFIG_IKCONFIG_PROC=y
> CONFIG_FW_UPLOAD=y
>
> Luis
>
You've been helpful to tell me how to check that all the necessary options
were enabled. Actually they were _all_ enabled.

Soon after checking, I started to look at something else...

Being not familiar at all with selftests I had not realized that I was
using the tests built for an older version of the kernel.

I made some confusion between cross-compiling for x86-32 in a separate
directory from sources, installing my custom 5.19.0-rc6 kernel in the VM,
and running the selftests built for an older 5.18.0-rc[something].

Everything is working perfectly now (with and without my patch)[1]:
"ok 1 selftests: firmware: fw_run_tests.sh".

I'm sorry for my lack of experience :-(

Thank you so much,

Fabio

[1] https://lore.kernel.org/lkml/20220714235030.12732-1-fmdefrancesco@xxxxxxxxx/