2020-03-29 13:41:08

by kernel test robot

[permalink] [raw]
Subject: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

Greetings,

0day kernel testing robot got the below dmesg and the first bad commit is

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next

commit b276527539188f1f61c082ebef27803db93e536d
Author: Christian Gromm <[email protected]>
AuthorDate: Tue Mar 10 14:02:40 2020 +0100
Commit: Greg Kroah-Hartman <[email protected]>
CommitDate: Tue Mar 24 13:42:44 2020 +0100

staging: most: move core files out of the staging area

This patch moves the core module to the /drivers/most directory
and makes all necessary changes in order to not break the build.

Signed-off-by: Christian Gromm <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>

22dd4acc80 Staging: speakup: Add identifier name to function declaration arguments.
b276527539 staging: most: move core files out of the staging area
e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of specific code
+-------------------------------------------------------+------------+------------+------------+
| | 22dd4acc80 | b276527539 | e681bb287f |
+-------------------------------------------------------+------------+------------+------------+
| boot_successes | 26 | 0 | 0 |
| boot_failures | 8 | 11 | 11 |
| WARNING:possible_circular_locking_dependency_detected | 8 | | |
| BUG:kernel_NULL_pointer_dereference,address | 0 | 11 | 11 |
| Oops:#[##] | 0 | 11 | 11 |
| EIP:__list_add_valid | 0 | 11 | 11 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 11 | 11 |
+-------------------------------------------------------+------------+------------+------------+

If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>

[ 12.242090] no options.
[ 12.245364] FPGA DOWNLOAD --->
[ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
[ 12.246548] GPIO INIT FAIL!!
[ 12.246995] most_sound: init()
[ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000
[ 12.248032] #PF: supervisor read access in kernel mode
[ 12.248322] #PF: error_code(0x0000) - not-present page
[ 12.248322] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
[ 12.248322] Oops: 0000 [#1] PREEMPT SMP
[ 12.248322] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc7-00376-gb276527539188 #1
[ 12.248322] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[ 12.248322] EIP: __list_add_valid+0x29/0x77
[ 12.248322] Code: c3 55 89 e5 56 53 83 ec 10 8b 59 04 39 d3 74 1a 89 4c 24 0c 89 5c 24 08 89 54 24 04 c7 04 24 00 cc bd c2 e8 84 9e b4 ff 0f 0b <8b> 33 39 ce 74 1a 89 5c 24 0c 89 74 24 08 89 4c 24 04 c7 04 24 7c
[ 12.248322] EAX: c2f45800 EBX: 00000000 ECX: c3e8df50 EDX: 00000000
[ 12.248322] ESI: 00000000 EDI: ec4a7f68 EBP: ec4a7ee8 ESP: ec4a7ed0
[ 12.248322] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
[ 12.248322] CR0: 80050033 CR2: 00000000 CR3: 03256000 CR4: 001406b0
[ 12.248322] Call Trace:
[ 12.248322] ? vprintk_func+0x9d/0xa7
[ 12.248322] most_register_component+0x33/0x53
[ 12.248322] ? wilc_spi_driver_init+0x11/0x11
[ 12.248322] audio_init+0x2c/0x76
[ 12.248322] do_one_initcall+0xf0/0x284
[ 12.248322] ? __might_sleep+0x70/0x77
[ 12.262064] kernel_init_freeable+0x141/0x1a5
[ 12.262064] ? rest_init+0x205/0x205
[ 12.262064] kernel_init+0xb/0xea
[ 12.262064] ? schedule_tail_wrapper+0x9/0xc
[ 12.262064] ret_from_fork+0x2e/0x38
[ 12.262064] Modules linked in:
[ 12.262064] CR2: 0000000000000000
[ 12.262064] ---[ end trace 7c7a2cb6d11f9c5d ]---
[ 12.262064] EIP: __list_add_valid+0x29/0x77

# HH:MM RESULT GOOD BAD GOOD_BUT_DIRTY DIRTY_NOT_BAD
git bisect start a400b349905677d3561138087528f36718cbd9fc 16fbf79b0f83bc752cee8589279f1ebfe57b3b6e --
git bisect bad 1fb7e4086438ac799b09b0fcafbe7d6d694d2229 # 10:44 B 0 9 25 0 Merge 'linux-review/Gustavo-A-R-Silva/chrome-cros_ec_chardev-Replace-zero-length-array-with-flexible-array-member/20200321-071741' into devel-hourly-2020032803
git bisect bad aa5a6dfe7759dceb732db7578fd8e93b558c583f # 11:03 B 0 6 22 0 Merge 'linux-review/Ravi-Bangoria/perf-dso-Fix-dso-comparison/20200324-152752' into devel-hourly-2020032803
git bisect good 9f5dc12221c99dd30a64be3fbce2130654d1fcc0 # 11:38 G 10 0 3 3 Merge 'linux-review/Mateusz-Gorski/Add-topologies-for-generic-HDA-DSP-machine-driver/20200326-075250' into devel-hourly-2020032803
git bisect good 4f2fa08ebb25660ca706626bf58b0ddccf6e35c6 # 12:13 G 10 0 3 3 Merge 'thermal/next' into devel-hourly-2020032803
git bisect bad 0b76d1986630dbd2332c91a2f94875ee93ca7e3a # 12:40 B 0 7 23 0 Merge 'linux-review/Weihang-Li/RDMA-hns-Update-some-configurations-related-to-hardware/20200327-030803' into devel-hourly-2020032803
git bisect good 3817f5f77f139d27a42ff92b0fcbae964665a471 # 13:34 G 11 0 2 2 Merge 'linux-review/Leon-Romanovsky/RDMA-rxe-Set-sys_image_guid-to-be-aligned-with-HW-IB-devices/20200323-235957' into devel-hourly-2020032803
git bisect good 37f479d4be63453151a4e8b1db0d18a102fa6e81 # 14:38 G 10 0 2 2 Merge 'linux-review/sunil-kovvuri-gmail-com/Miscellaneous-fixes/20200326-074148' into devel-hourly-2020032803
git bisect bad 9e25511121b25d3191aea63e9c2c65d8beed750e # 14:57 B 0 1 17 0 Merge 'linux-review/Rayagonda-Kokatanur/i2c-iproc-add-support-for-SMBUS-quick-cmd/20200323-045331' into devel-hourly-2020032803
git bisect good 676d651ef12f80cc35ef101bfe610d6a6f12ef10 # 15:40 G 10 0 5 5 Merge 'linux-review/Luiz-Augusto-von-Dentz/Bluetooth-Add-BT_MODE-socket-option/20200327-073534' into devel-hourly-2020032803
git bisect bad 25c4b63ca26e35d0793bdd2c1b24bed8cf95801d # 16:29 B 0 2 18 0 Merge 'linux-review/Simran-Singhal/staging-rtl8723bs-Clean-up-tests-if-NULL-returned-on-failure/20200327-012809' into devel-hourly-2020032803
git bisect good 8eb6b39c0ff38fd1bf21454c438fb3a2a52636f9 # 17:36 G 11 0 4 4 staging: qlge: qlge_dbg: remove unneeded spaces
git bisect good fe297f8f048a7a0663479dcf6447ec450b53b905 # 18:35 G 10 0 2 2 iio: dac: Kconfig: sort symbols alphabetically
git bisect good 9791ca0dcb46dcedc5fb93fb4e8791cedc91babd # 19:31 G 10 0 4 4 staging: mt7621-pci-phy: re-do 'xtal_mode' detection
git bisect bad c926f022c2560d801545e6b55dacc9082277d18e # 20:19 B 0 3 19 0 staging: rtl8723bs: Add line after variable declarations
git bisect bad b276527539188f1f61c082ebef27803db93e536d # 20:43 B 0 6 22 0 staging: most: move core files out of the staging area
git bisect good 759411a0e0f35c8ae1778a838a97cec9d0140f7f # 21:11 G 10 0 2 2 staging: wlan-ng: Fix third argument going over 80 characters
git bisect good 7385adece19190f28800e0fc2fa964b96706120a # 21:42 G 10 0 2 2 staging: hp100: Add space around operator +
git bisect good 7cf9a79dbae127776a6ddd455494faec9f3af9fb # 22:13 G 11 0 7 7 Staging: speakup: Use sizeof(*var) in kmalloc().
git bisect good 22dd4acc80495ea0fa3a54b36e49ef9dd5bad6c6 # 22:40 G 10 0 1 1 Staging: speakup: Add identifier name to function declaration arguments.
# first bad commit: [b276527539188f1f61c082ebef27803db93e536d] staging: most: move core files out of the staging area
git bisect good 22dd4acc80495ea0fa3a54b36e49ef9dd5bad6c6 # 22:45 G 31 0 7 8 Staging: speakup: Add identifier name to function declaration arguments.
# extra tests with debug options
git bisect good b276527539188f1f61c082ebef27803db93e536d # 23:05 G 11 0 0 0 staging: most: move core files out of the staging area
# extra tests on head commit of staging/staging-next
git bisect bad e681bb287f40e7a9dbcb04cef80fd87a2511ab86 # 23:49 B 0 1 17 0 staging: vt6656: Use DIV_ROUND_UP macro instead of specific code
# bad: [e681bb287f40e7a9dbcb04cef80fd87a2511ab86] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code
# extra tests on revert first bad commit
git bisect good 099a66b938bb0368b91c81e4431180ef11a0b66b # 00:32 G 10 0 1 1 Revert "staging: most: move core files out of the staging area"
# good: [099a66b938bb0368b91c81e4431180ef11a0b66b] Revert "staging: most: move core files out of the staging area"

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (8.93 kB)
dmesg-yocto-vm-yocto-28:20200328204408:i386-randconfig-g003-20200327:5.6.0-rc7-00376-gb276527539188:1.gz (17.74 kB)
dmesg-yocto-vm-yocto-17:20200328224405:i386-randconfig-g003-20200327:5.6.0-rc7-00375-g22dd4acc80495:1.gz (24.70 kB)
reproduce-yocto-vm-yocto-28:20200328204408:i386-randconfig-g003-20200327:5.6.0-rc7-00376-gb276527539188:1 (987.00 B)
a400b349905677d3561138087528f36718cbd9fc:gcc-7:i386-randconfig-g003-20200327:EIP:__list_add_valid.xz (8.23 kB)
config-5.6.0-rc7-00376-gb276527539188 (150.26 kB)
Download all attachments

2020-03-31 19:31:09

by Christian Gromm

[permalink] [raw]
Subject: Re: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

On Sun, 2020-03-29 at 21:39 +0800, kernel test robot wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Greetings,
>
> 0day kernel testing robot got the below dmesg and the first bad
> commit is
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> staging-next
>
> commit b276527539188f1f61c082ebef27803db93e536d
> Author: Christian Gromm <[email protected]>
> AuthorDate: Tue Mar 10 14:02:40 2020 +0100
> Commit: Greg Kroah-Hartman <[email protected]>
> CommitDate: Tue Mar 24 13:42:44 2020 +0100
>
> staging: most: move core files out of the staging area
>
> This patch moves the core module to the /drivers/most directory
> and makes all necessary changes in order to not break the build.
>
> Signed-off-by: Christian Gromm <[email protected]>
> Link:
> https://lore.kernel.org/r/[email protected]
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> 22dd4acc80 Staging: speakup: Add identifier name to function
> declaration arguments.
> b276527539 staging: most: move core files out of the staging area
> e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of
> specific code
> +-------------------------------------------------------+----------
> --+------------+------------+
> > | 22dd4acc80
> > | b276527539 | e681bb287f |
> +-------------------------------------------------------+----------
> --+------------+------------+
> > boot_successes |
> > 26 | 0 | 0 |
> > boot_failures |
> > 8 | 11 | 11 |
> > WARNING:possible_circular_locking_dependency_detected |
> > 8 | | |
> > BUG:kernel_NULL_pointer_dereference,address |
> > 0 | 11 | 11 |
> > Oops:#[##] |
> > 0 | 11 | 11 |
> > EIP:__list_add_valid |
> > 0 | 11 | 11 |
> > Kernel_panic-not_syncing:Fatal_exception |
> > 0 | 11 | 11 |
> +-------------------------------------------------------+----------
> --+------------+------------+
>
> If you fix the issue, kindly add following tag
> Reported-by: kernel test robot <[email protected]>
>
> [ 12.242090] no options.
> [ 12.245364] FPGA DOWNLOAD --->
> [ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
> [ 12.246548] GPIO INIT FAIL!!
> [ 12.246995] most_sound: init()
> [ 12.247349] BUG: kernel NULL pointer dereference, address:
> 00000000
> [ 12.248032] #PF: supervisor read access in kernel mode
> [ 12.248322] #PF: error_code(0x0000) - not-present page
> [ 12.248322] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
> [ 12.248322] Oops: 0000 [#1] PREEMPT SMP
> [ 12.248322] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc7-
> 00376-gb276527539188 #1
> [ 12.248322] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
> BIOS 1.12.0-1 04/01/2014
> [ 12.248322] EIP: __list_add_valid+0x29/0x77
> [ 12.248322] Code: c3 55 89 e5 56 53 83 ec 10 8b 59 04 39 d3 74 1a
> 89 4c 24 0c 89 5c 24 08 89 54 24 04 c7 04 24 00 cc bd c2 e8 84 9e b4
> ff 0f 0b <8b> 33 39 ce 74 1a 89 5c 24 0c 89 74 24 08 89 4c 24 04 c7
> 04 24 7c
> [ 12.248322] EAX: c2f45800 EBX: 00000000 ECX: c3e8df50 EDX:
> 00000000
> [ 12.248322] ESI: 00000000 EDI: ec4a7f68 EBP: ec4a7ee8 ESP:
> ec4a7ed0
> [ 12.248322] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS:
> 00010246
> [ 12.248322] CR0: 80050033 CR2: 00000000 CR3: 03256000 CR4:
> 001406b0
> [ 12.248322] Call Trace:
> [ 12.248322] ? vprintk_func+0x9d/0xa7
> [ 12.248322] most_register_component+0x33/0x53

This function does a NULL check on the passed argument
struct most_component, berfore it calls list_add_tail().
So the dereferenced pointer must be the struct list_head
comp_list of the core.

> [ 12.248322] ? wilc_spi_driver_init+0x11/0x11
> [ 12.248322] audio_init+0x2c/0x76
> [ 12.248322] do_one_initcall+0xf0/0x284
> [ 12.248322] ? __might_sleep+0x70/0x77
> [ 12.262064] kernel_init_freeable+0x141/0x1a5
> [ 12.262064] ? rest_init+0x205/0x205
> [ 12.262064] kernel_init+0xb/0xea
> [ 12.262064] ? schedule_tail_wrapper+0x9/0xc
> [ 12.262064] ret_from_fork+0x2e/0x38
> [ 12.262064] Modules linked in:
> [ 12.262064] CR2: 0000000000000000
> [ 12.262064] ---[ end trace 7c7a2cb6d11f9c5d ]---
> [ 12.262064] EIP: __list_add_valid+0x29/0x77

which is weird, as the list_head used here is not dynamically
allocated and INIT_LIST_HEAD is definitely being called in the
__init function most_init() of the core module before its first
usage.

I've never seen the code failing at this point, nor has this
being reported by anyone yet.

Need to investigate.

thanks,
Chris

2020-04-24 09:44:01

by Christian Gromm

[permalink] [raw]
Subject: Re: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

On Sun, 2020-03-29 at 21:39 +0800, kernel test robot wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Greetings,
>
> 0day kernel testing robot got the below dmesg and the first bad
> commit is
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> staging-next
>
> commit b276527539188f1f61c082ebef27803db93e536d
> Author: Christian Gromm <[email protected]>
> AuthorDate: Tue Mar 10 14:02:40 2020 +0100
> Commit: Greg Kroah-Hartman <[email protected]>
> CommitDate: Tue Mar 24 13:42:44 2020 +0100
>
> staging: most: move core files out of the staging area
>
> This patch moves the core module to the /drivers/most directory
> and makes all necessary changes in order to not break the build.
>
> Signed-off-by: Christian Gromm <[email protected]>
> Link:
> https://lore.kernel.org/r/[email protected]
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> 22dd4acc80 Staging: speakup: Add identifier name to function
> declaration arguments.
> b276527539 staging: most: move core files out of the staging area
> e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of
> specific code
> +-------------------------------------------------------+----------
> --+------------+------------+
> > | 22dd4acc80
> > | b276527539 | e681bb287f |
> +-------------------------------------------------------+----------
> --+------------+------------+
> > boot_successes |
> > 26 | 0 | 0 |
> > boot_failures |
> > 8 | 11 | 11 |
> > WARNING:possible_circular_locking_dependency_detected |
> > 8 | | |
> > BUG:kernel_NULL_pointer_dereference,address |
> > 0 | 11 | 11 |
> > Oops:#[##] |
> > 0 | 11 | 11 |
> > EIP:__list_add_valid |
> > 0 | 11 | 11 |
> > Kernel_panic-not_syncing:Fatal_exception |
> > 0 | 11 | 11 |
> +-------------------------------------------------------+----------
> --+------------+------------+
>
> If you fix the issue, kindly add following tag
> Reported-by: kernel test robot <[email protected]>
>
> [ 12.242090] no options.
> [ 12.245364] FPGA DOWNLOAD --->
> [ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
> [ 12.246548] GPIO INIT FAIL!!
> [ 12.246995] most_sound: init()
> [ 12.247349] BUG: kernel NULL pointer dereference, address:


The init order of the modules is wrong in case the driver is
being built in-tree.

The init function of module most_sound is called before the
core itself is being initialized.

[ 5.179189] most_sound: init()
[ 5.180205] mostcore: __init()

Hence the list used in the core to store and track the
registered components has not been initialized with
INIT_LIST_HEAD(&comp_list) by the time the sound module
tries to register itself with the core.

The Kconfig of most_sound, however, has a dependency to
MOST. How can the build system be forced to initialize the
core module first?

thanks,
Chris

2020-04-24 10:21:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

On Fri, Apr 24, 2020 at 09:41:36AM +0000, [email protected] wrote:
> On Sun, 2020-03-29 at 21:39 +0800, kernel test robot wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > know the content is safe
> >
> > Greetings,
> >
> > 0day kernel testing robot got the below dmesg and the first bad
> > commit is
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> > staging-next
> >
> > commit b276527539188f1f61c082ebef27803db93e536d
> > Author: Christian Gromm <[email protected]>
> > AuthorDate: Tue Mar 10 14:02:40 2020 +0100
> > Commit: Greg Kroah-Hartman <[email protected]>
> > CommitDate: Tue Mar 24 13:42:44 2020 +0100
> >
> > staging: most: move core files out of the staging area
> >
> > This patch moves the core module to the /drivers/most directory
> > and makes all necessary changes in order to not break the build.
> >
> > Signed-off-by: Christian Gromm <[email protected]>
> > Link:
> > https://lore.kernel.org/r/[email protected]
> > Signed-off-by: Greg Kroah-Hartman <[email protected]>
> >
> > 22dd4acc80 Staging: speakup: Add identifier name to function
> > declaration arguments.
> > b276527539 staging: most: move core files out of the staging area
> > e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of
> > specific code
> > +-------------------------------------------------------+----------
> > --+------------+------------+
> > > | 22dd4acc80
> > > | b276527539 | e681bb287f |
> > +-------------------------------------------------------+----------
> > --+------------+------------+
> > > boot_successes |
> > > 26 | 0 | 0 |
> > > boot_failures |
> > > 8 | 11 | 11 |
> > > WARNING:possible_circular_locking_dependency_detected |
> > > 8 | | |
> > > BUG:kernel_NULL_pointer_dereference,address |
> > > 0 | 11 | 11 |
> > > Oops:#[##] |
> > > 0 | 11 | 11 |
> > > EIP:__list_add_valid |
> > > 0 | 11 | 11 |
> > > Kernel_panic-not_syncing:Fatal_exception |
> > > 0 | 11 | 11 |
> > +-------------------------------------------------------+----------
> > --+------------+------------+
> >
> > If you fix the issue, kindly add following tag
> > Reported-by: kernel test robot <[email protected]>
> >
> > [ 12.242090] no options.
> > [ 12.245364] FPGA DOWNLOAD --->
> > [ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
> > [ 12.246548] GPIO INIT FAIL!!
> > [ 12.246995] most_sound: init()
> > [ 12.247349] BUG: kernel NULL pointer dereference, address:
>
>
> The init order of the modules is wrong in case the driver is
> being built in-tree.
>
> The init function of module most_sound is called before the
> core itself is being initialized.
>
> [ 5.179189] most_sound: init()
> [ 5.180205] mostcore: __init()
>
> Hence the list used in the core to store and track the
> registered components has not been initialized with
> INIT_LIST_HEAD(&comp_list) by the time the sound module
> tries to register itself with the core.
>
> The Kconfig of most_sound, however, has a dependency to
> MOST. How can the build system be forced to initialize the
> core module first?

Linker order is the thing here.

You can mess with the init levels here, and use subsys_initcall() for
mostcore, will that fix it?

thanks,

greg k-h

2020-04-24 10:23:11

by Christian Gromm

[permalink] [raw]
Subject: Re: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

On Fri, 2020-04-24 at 12:16 +0200, Greg KH wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On Fri, Apr 24, 2020 at 09:41:36AM +0000,
> [email protected] wrote:
> > On Sun, 2020-03-29 at 21:39 +0800, kernel test robot wrote:
> > > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > > know the content is safe
> > >
> > > Greetings,
> > >
> > > 0day kernel testing robot got the below dmesg and the first bad
> > > commit is
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> > > staging-next
> > >
> > > commit b276527539188f1f61c082ebef27803db93e536d
> > > Author: Christian Gromm <[email protected]>
> > > AuthorDate: Tue Mar 10 14:02:40 2020 +0100
> > > Commit: Greg Kroah-Hartman <[email protected]>
> > > CommitDate: Tue Mar 24 13:42:44 2020 +0100
> > >
> > > staging: most: move core files out of the staging area
> > >
> > > This patch moves the core module to the /drivers/most
> > > directory
> > > and makes all necessary changes in order to not break the
> > > build.
> > >
> > > Signed-off-by: Christian Gromm <[email protected]
> > > >
> > > Link:
> > > https://lore.kernel.org/r/[email protected]
> > > Signed-off-by: Greg Kroah-Hartman <[email protected]
> > > >
> > >
> > > 22dd4acc80 Staging: speakup: Add identifier name to function
> > > declaration arguments.
> > > b276527539 staging: most: move core files out of the staging
> > > area
> > > e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of
> > > specific code
> > > +-------------------------------------------------------+------
> > > ----
> > > --+------------+------------+
> > > > |
> > > > 22dd4acc80
> > > > > b276527539 | e681bb287f |
> > > +-------------------------------------------------------+------
> > > ----
> > > --+------------+------------+
> > > > boot_successes |
> > > > 26 | 0 | 0 |
> > > > boot_failures |
> > > > 8 | 11 | 11 |
> > > > WARNING:possible_circular_locking_dependency_detected |
> > > > 8 | | |
> > > > BUG:kernel_NULL_pointer_dereference,address |
> > > > 0 | 11 | 11 |
> > > > Oops:#[##] |
> > > > 0 | 11 | 11 |
> > > > EIP:__list_add_valid |
> > > > 0 | 11 | 11 |
> > > > Kernel_panic-not_syncing:Fatal_exception |
> > > > 0 | 11 | 11 |
> > > +-------------------------------------------------------+------
> > > ----
> > > --+------------+------------+
> > >
> > > If you fix the issue, kindly add following tag
> > > Reported-by: kernel test robot <[email protected]>
> > >
> > > [ 12.242090] no options.
> > > [ 12.245364] FPGA DOWNLOAD --->
> > > [ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
> > > [ 12.246548] GPIO INIT FAIL!!
> > > [ 12.246995] most_sound: init()
> > > [ 12.247349] BUG: kernel NULL pointer dereference, address:
> >
> > The init order of the modules is wrong in case the driver is
> > being built in-tree.
> >
> > The init function of module most_sound is called before the
> > core itself is being initialized.
> >
> > [ 5.179189] most_sound: init()
> > [ 5.180205] mostcore: __init()
> >
> > Hence the list used in the core to store and track the
> > registered components has not been initialized with
> > INIT_LIST_HEAD(&comp_list) by the time the sound module
> > tries to register itself with the core.
> >
> > The Kconfig of most_sound, however, has a dependency to
> > MOST. How can the build system be forced to initialize the
> > core module first?
>
> Linker order is the thing here.
>
> You can mess with the init levels here, and use subsys_initcall() for
> mostcore, will that fix it?

I already gave it a try and it works. But is it ok to use the
subsys_initcall() function when the driver is being built as a
module?

thanks,
Chris

2020-04-24 10:57:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: b276527539 ("staging: most: move core files out of the staging .."): [ 12.247349] BUG: kernel NULL pointer dereference, address: 00000000

On Fri, Apr 24, 2020 at 10:21:05AM +0000, [email protected] wrote:
> On Fri, 2020-04-24 at 12:16 +0200, Greg KH wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > know the content is safe
> >
> > On Fri, Apr 24, 2020 at 09:41:36AM +0000,
> > [email protected] wrote:
> > > On Sun, 2020-03-29 at 21:39 +0800, kernel test robot wrote:
> > > > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > > > know the content is safe
> > > >
> > > > Greetings,
> > > >
> > > > 0day kernel testing robot got the below dmesg and the first bad
> > > > commit is
> > > >
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> > > > staging-next
> > > >
> > > > commit b276527539188f1f61c082ebef27803db93e536d
> > > > Author: Christian Gromm <[email protected]>
> > > > AuthorDate: Tue Mar 10 14:02:40 2020 +0100
> > > > Commit: Greg Kroah-Hartman <[email protected]>
> > > > CommitDate: Tue Mar 24 13:42:44 2020 +0100
> > > >
> > > > staging: most: move core files out of the staging area
> > > >
> > > > This patch moves the core module to the /drivers/most
> > > > directory
> > > > and makes all necessary changes in order to not break the
> > > > build.
> > > >
> > > > Signed-off-by: Christian Gromm <[email protected]
> > > > >
> > > > Link:
> > > > https://lore.kernel.org/r/[email protected]
> > > > Signed-off-by: Greg Kroah-Hartman <[email protected]
> > > > >
> > > >
> > > > 22dd4acc80 Staging: speakup: Add identifier name to function
> > > > declaration arguments.
> > > > b276527539 staging: most: move core files out of the staging
> > > > area
> > > > e681bb287f staging: vt6656: Use DIV_ROUND_UP macro instead of
> > > > specific code
> > > > +-------------------------------------------------------+------
> > > > ----
> > > > --+------------+------------+
> > > > > |
> > > > > 22dd4acc80
> > > > > > b276527539 | e681bb287f |
> > > > +-------------------------------------------------------+------
> > > > ----
> > > > --+------------+------------+
> > > > > boot_successes |
> > > > > 26 | 0 | 0 |
> > > > > boot_failures |
> > > > > 8 | 11 | 11 |
> > > > > WARNING:possible_circular_locking_dependency_detected |
> > > > > 8 | | |
> > > > > BUG:kernel_NULL_pointer_dereference,address |
> > > > > 0 | 11 | 11 |
> > > > > Oops:#[##] |
> > > > > 0 | 11 | 11 |
> > > > > EIP:__list_add_valid |
> > > > > 0 | 11 | 11 |
> > > > > Kernel_panic-not_syncing:Fatal_exception |
> > > > > 0 | 11 | 11 |
> > > > +-------------------------------------------------------+------
> > > > ----
> > > > --+------------+------------+
> > > >
> > > > If you fix the issue, kindly add following tag
> > > > Reported-by: kernel test robot <[email protected]>
> > > >
> > > > [ 12.242090] no options.
> > > > [ 12.245364] FPGA DOWNLOAD --->
> > > > [ 12.245723] FPGA image file name: xlinx_fpga_firmware.bit
> > > > [ 12.246548] GPIO INIT FAIL!!
> > > > [ 12.246995] most_sound: init()
> > > > [ 12.247349] BUG: kernel NULL pointer dereference, address:
> > >
> > > The init order of the modules is wrong in case the driver is
> > > being built in-tree.
> > >
> > > The init function of module most_sound is called before the
> > > core itself is being initialized.
> > >
> > > [ 5.179189] most_sound: init()
> > > [ 5.180205] mostcore: __init()
> > >
> > > Hence the list used in the core to store and track the
> > > registered components has not been initialized with
> > > INIT_LIST_HEAD(&comp_list) by the time the sound module
> > > tries to register itself with the core.
> > >
> > > The Kconfig of most_sound, however, has a dependency to
> > > MOST. How can the build system be forced to initialize the
> > > core module first?
> >
> > Linker order is the thing here.
> >
> > You can mess with the init levels here, and use subsys_initcall() for
> > mostcore, will that fix it?
>
> I already gave it a try and it works. But is it ok to use the
> subsys_initcall() function when the driver is being built as a
> module?

Yes, that works the same, see it's use elsewhere in the kernel tree, and
for what it "degrades to" if the file is being built as a module.

thanks,

greg k-h