Romulus triggers WARN() on gpio-keys probe under qemu
amboar opened this issue · comments
[ 2.938641] ------------[ cut here ]------------
[ 2.939249] WARNING: CPU: 0 PID: 1 at drivers/gpio/gpio-aspeed.c:834 unregister_allocated_timer+0x60/0x98
[ 2.939793] No timer allocated to offset 74
[ 2.940376] CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-rc2-next-20190325-00005-g2b3edb2567a0 #1
[ 2.940867] Hardware name: Generic DT based system
[ 2.941349] Backtrace:
[ 2.941734] [<80107dd4>] (dump_backtrace) from [<80108008>] (show_stack+0x20/0x24)
[ 2.942326] r7:80396fd0 r6:00000009 r5:00000000 r4:9d4a1c7c
[ 2.942753] [<80107fe8>] (show_stack) from [<80670824>] (dump_stack+0x20/0x28)
[ 2.943262] [<80670804>] (dump_stack) from [<80118748>] (__warn.part.3+0xb4/0xdc)
[ 2.943703] [<80118694>] (__warn.part.3) from [<801187dc>] (warn_slowpath_fmt+0x6c/0x90)
[ 2.944245] r6:00000342 r5:807ff06c r4:80a07008
[ 2.944608] [<80118774>] (warn_slowpath_fmt) from [<80396fd0>] (unregister_allocated_timer+0x60/0x98)
[ 2.945184] r3:0000004a r2:807ff088
[ 2.945467] r7:9d59a440 r6:60000153 r5:00000000 r4:0000004a
[ 2.945861] [<80396f70>] (unregister_allocated_timer) from [<8039717c>] (aspeed_gpio_set_config+0x174/0x43c)
[ 2.946474] [<80397008>] (aspeed_gpio_set_config) from [<8038fdb8>] (gpiod_set_debounce+0x60/0xc4)
[ 2.947063] r10:95359280 r9:00000000 r8:9d562e10 r7:881fe4ac r6:8081ea3c r5:9535929c
[ 2.947567] r4:9d5ea4a0
[ 2.947786] [<8038fd58>] (gpiod_set_debounce) from [<804c4550>] (gpio_keys_probe+0x468/0x8a4)
[ 2.948323] r4:9535d284
[ 2.948515] [<804c40e8>] (gpio_keys_probe) from [<8041b608>] (platform_drv_probe+0x44/0x80)
[ 2.949049] r10:00000003 r9:80a3c188 r8:00000000 r7:00000000 r6:80a82234 r5:80a3c188
[ 2.949547] r4:9d562e10
[ 2.949762] [<8041b5c4>] (platform_drv_probe) from [<804197f4>] (really_probe+0x208/0x3dc)
[ 2.950302] r5:80a82128 r4:9d562e10
[ 2.950564] [<804195ec>] (really_probe) from [<80419ec4>] (driver_probe_device+0x130/0x170)
[ 2.951106] r10:0000007e r9:8093883c r8:00000000 r7:80a07008 r6:80a3c188 r5:9d562e10
[ 2.951600] r4:80a3c188
[ 2.951805] [<80419d94>] (driver_probe_device) from [<8041a1ac>] (device_driver_attach+0x68/0x70)
[ 2.952291] r9:8093883c r8:00000000 r7:80a07008 r6:80a3c188 r5:00000000 r4:9d562e10
[ 2.952816] [<8041a144>] (device_driver_attach) from [<8041a234>] (__driver_attach+0x80/0x150)
[ 2.953327] r7:80a07008 r6:9d562e10 r5:00000001 r4:80a3c188
[ 2.953705] [<8041a1b4>] (__driver_attach) from [<8041792c>] (bus_for_each_dev+0x80/0xc4)
[ 2.954186] r7:80a07008 r6:8041a1b4 r5:80a3c188 r4:9d5560b0
[ 2.954578] [<804178ac>] (bus_for_each_dev) from [<8041a32c>] (driver_attach+0x28/0x30)
[ 2.955105] r7:00000000 r6:9535e980 r5:80a35780 r4:80a3c188
[ 2.955519] [<8041a304>] (driver_attach) from [<80418310>] (bus_add_driver+0x14c/0x200)
[ 2.956086] [<804181c4>] (bus_add_driver) from [<8041a9d0>] (driver_register+0x84/0x118)
[ 2.956617] r7:80a63180 r6:80923ba4 r5:80a07008 r4:80a3c188
[ 2.957012] [<8041a94c>] (driver_register) from [<8041c344>] (__platform_driver_register+0x3c/0x50)
[ 2.957581] r5:80a07008 r4:80954fc4
[ 2.957918] [<8041c308>] (__platform_driver_register) from [<80923bc4>] (gpio_keys_init+0x20/0x28)
[ 2.958530] [<80923ba4>] (gpio_keys_init) from [<80901290>] (do_one_initcall+0x80/0x180)
[ 2.959044] [<80901210>] (do_one_initcall) from [<8090153c>] (kernel_init_freeable+0x1ac/0x26c)
[ 2.959621] r8:80a63180 r7:80a63180 r6:8093885c r5:00000008 r4:80954fc4
[ 2.960077] [<80901390>] (kernel_init_freeable) from [<80687e7c>] (kernel_init+0x18/0x11c)
[ 2.960598] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80687e64
[ 2.961086] r4:00000000
[ 2.961290] [<80687e64>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[ 2.961863] Exception stack(0x9d4a1fb0 to 0x9d4a1ff8)
[ 2.962430] 1fa0: 00000000 00000000 00000000 00000000
[ 2.963232] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2.963873] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 2.964360] r5:80687e64 r4:00000000
It's unusual because at first glance it seems we're calling into unregister_allocated_timer
but the timer value must be zero.
Debounce was broken by torvalds/linux@6581eaf . The fix is to revert it. Attached is a patch with an explanation.
0001-Revert-gpio-use-new-gpio_set_config-helper-in-more-p.patch
Sent out the fix: https://lkml.org/lkml/2019/3/26/12
Patch now upstream: torvalds/linux@fa59dd2