Re: [PATCH v2 5/5] staging: vc04_services: vchiq_core: Stop kthreads on shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 21, 2024 at 06:37:37PM +0530, Umang Jain wrote:
> The various kthreads thread functions (slot_handler_func, sync_func,
> recycle_func) in vchiq_core and vchiq_keepalive_thread_func in
> vchiq_arm should be stopped on vchiq_shutdown().
> 
> This also address the following TODO item:
>  * Fix kernel module support
> 
> hence drop it from the TODO item list.

This has landed in -next as d9c60badccc183eb971e0941bb86f9475d4b9551
and appears to be causing substantial issues on the original Raspberry
Pi.  I'm seeing a lot of failed boots and one that worked is showing a
bunch of faults the first of which is:

[   18.010575] bcm2835_vchiq 2000b840.mailbox: sync: error: 0: sf unexpected msgid 0@3776f2e5,0
[   18.027151] ------------[ cut here ]------------
Setting prompt string to ['-+\\[ end trace \\w* \\]-+[^\\n]*\\r', '/ #', 'Login timed out', 'Login incorrect']
[   18.035622] WARNING: CPU: 0 PID: 97 at lib/refcount.c:25 kthread_stop+0x60/0xc4
[   18.046703] refcount_t: addition on 0; use-after-free.
[   18.055566] Modules linked in: bcm2835_v4l2(C+) videobuf2_vmalloc videobuf2_memops bcm2835_mmal_vchiq(C) videobuf2_v4l2 videobuf2_common snd_bcm2835(C) raspberrypi_hwmon bcm2835_rng rng_core vchiq(C)
[   18.084302] CPU: 0 PID: 97 Comm: vchiq-keep/0 Tainted: G         C         6.9.0-rc1-next-20240328 #1
[   18.100553] Hardware name: BCM2835
[   18.107531] Call trace: 
[   18.107582]  unwind_backtrace from show_stack+0x18/0x1c
[   18.122480]  show_stack from dump_stack_lvl+0x38/0x48
[   18.131126]  dump_stack_lvl from __warn+0x88/0xec
[   18.139507]  __warn from warn_slowpath_fmt+0x80/0xbc
[   18.148071]  warn_slowpath_fmt from kthread_stop+0x60/0xc4
[   18.157210]  kthread_stop from vchiq_shutdown_internal+0x48/0x94 [vchiq]
[   18.167974]  vchiq_shutdown_internal [vchiq] from vchiq_shutdown+0x38/0x98 [vchiq]
[   18.179664]  vchiq_shutdown [vchiq] from vchiq_keepalive_thread_func+0xb8/0x258 [vchiq]
[   18.191793]  vchiq_keepalive_thread_func [vchiq] from kthread+0xc4/0xd0
[   18.202482]  kthread from ret_from_fork+0x14/0x28
[   18.210834] Exception stack(0xdc8a9fb0 to 0xdc8a9ff8)
[   18.219579] 9fa0:                                     00000000 00000000 00000000 00000000
[   18.234691] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   18.249717] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   18.260498] ---[ end trace 0000000000000000 ]---

A bisect landed on this commit which does look plausibe, a bisect log is
below (note that due to the way my CI runs this isn't actually the
bisect running, it's what happens when you feed the results from a
bisect into bisect on a separate machine but it does show the commits):

# bad: [a6bd6c9333397f5a0e2667d4d82fef8c970108f2] Add linux-next specific files for 20240328
# good: [1f6fc07c0c4d1e30d2bae9962205a2e74f6b00b2] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [846ad4e37aa837616354d335187c3e79b20e2f1b] Merge branch 'togreg' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
# good: [08515f60ff706253d5f195f9983f6ec21fef7256] Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [bbac19c294ebd1e2e55d5bc1130f6751a41c0d23] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
# good: [d5449432f794e75cd4f5e46bc33bfe6ce20b657d] spi: pxa2xx: Switch to use dev_err_probe()
# good: [7b95ee0db7e0a7f99077f1b926323c7bf0d2e8f8] ASoC: soc-jack: Get rid of legacy GPIO support
# good: [59ffeb15b2f7b44cf934fd778dc0d98a35aa6a84] ASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output
# good: [4ed0915f5bc4bcc81bca783a5b984f3d81e9764e] ASoC: codecs: Add RK3308 internal audio codec driver
# good: [ea5fee227ff3dae209062ac9544906debe1e9ac1] ASoC: hdac_hda: improve error logs
# good: [1e90a846493c716e3e6b4d901fc0844e9eea6430] ASoC: soc-dai: Note valid values of sysclock direction
# good: [61cafaeab5bca2d3e6a68ee8fa92b5c10b8610ca] ASoC: Intel: sof_rt5682: board id cleanup for cml boards
# good: [9b163e0d330debbf7dcc14b2c3e2dc19a3b50a1d] spi: remove struct spi_message::is_dma_mapped
# good: [b340f56a74b62d8ce8617650c8ab4a26c87ba5c5] ASoC: dt-bindings: wm8974: Convert to dtschema
# good: [bf1894900b53f9047eb9b96c89717a9a22329f6a] staging: vc04_services: Implement vchiq_bus .remove
# good: [f119f9e050940070c3da3a7476b1bf7a63c803c4] staging: rtl8712: rename tmpVal to avg_val
# good: [57c0b41bbe7b43c519f5824a964a406d1e7f60a3] staging: vc04_services: vchiq_arm: Use appropriate dev_* log helpers
# good: [bdeef5dcea6b164f4bd614655821b1ef12ebec9a] spi: rspi: Get rid of unused struct rspi_plat_data
# good: [885dd75f41f9fff5b277bc6ab28ad798f98a37b4] ASoC: dt-bindings: fsl-esai: Convert fsl,esai.txt to yaml
# good: [10402419f2d60890525f590b54d0eaec3de0d87a] spi: spi-mt65xx: Rename a variable in interrupt handler
# good: [9855f05e553637f05494cf47a3154cbf9a5cfc67] ASoC: fsl: imx-es8328: Switch to using gpiod API
# good: [5f39231888c63f0a7708abc86b51b847476379d8] ASoC: mediatek: Assign dummy when codec not specified for a DAI link
# good: [5edeb7d312628961046eec9b26a7e72f44baf846] regulator: pca9450: add pca9451a support
# good: [c14445bdcb98feddf9afaeb05e6193cc1f8eec1a] ASoC: fsl: imx-rpmsg: Update to correct DT node
# good: [cee28113db17f0de58df0eaea4e2756c404ee01f] ASoC: dmaengine_pcm: Allow passing component name via config
# good: [b5867a5c0d7a6bf36f59f3d472c7aed33ca4d02c] spi: pxa2xx: Use proper SSP header in soc/pxa/ssp.c
# good: [60c10c678b582d41532fefa12667d8adca75811b] ASoC: Intel: avs: i2s_test: Remove redundant dapm routes
# good: [aad6b35290f52639d3601063d33d9621c0948a04] regmap: maple: Remove second semicolon
# good: [a39111b1cf0864b1782f30f9a1fa65260d057327] spi: xilinx: Make num_chipselect 8-bit in the struct xspi_platform_data
# good: [e6913c6ef83c80aa7569c9e08204542222fbf542] ASoC: codecs: ES8326: Delete unused REG_SUPPLY
# good: [ab470abe58c09b2fbe2c1478e67a904fd803e84f] regulator: rpi-panel-attiny: convert to use maple tree register cache
# good: [0c5f77f4eaef8ed9fe752d21f40ac471dd511cfc] dt-bindings: regulator: qcom,usb-vbus-regulator: Add PM7250B compatible
# good: [21fa98f4197bb3365dda1417708b318f403c13c1] ASoC: sun8i-codec: Implement jack and accessory detection
git bisect start 'a6bd6c9333397f5a0e2667d4d82fef8c970108f2' '1f6fc07c0c4d1e30d2bae9962205a2e74f6b00b2' '846ad4e37aa837616354d335187c3e79b20e2f1b' '08515f60ff706253d5f195f9983f6ec21fef7256' 'bbac19c294ebd1e2e55d5bc1130f6751a41c0d23' 'd5449432f794e75cd4f5e46bc33bfe6ce20b657d' '7b95ee0db7e0a7f99077f1b926323c7bf0d2e8f8' '59ffeb15b2f7b44cf934fd778dc0d98a35aa6a84' '4ed0915f5bc4bcc81bca783a5b984f3d81e9764e' 'ea5fee227ff3dae209062ac9544906debe1e9ac1' '1e90a846493c716e3e6b4d901fc0844e9eea6430' '61cafaeab5bca2d3e6a68ee8fa92b5c10b8610ca' '9b163e0d330debbf7dcc14b2c3e2dc19a3b50a1d' 'b340f56a74b62d8ce8617650c8ab4a26c87ba5c5' 'bf1894900b53f9047eb9b96c89717a9a22329f6a' 'f119f9e050940070c3da3a7476b1bf7a63c803c4' '57c0b41bbe7b43c519f5824a964a406d1e7f60a3' 'bdeef5dcea6b164f4bd614655821b1ef12ebec9a' '885dd75f41f9fff5b277bc6ab28ad798f98a37b4' '10402419f2d60890525f590b54d0eaec3de0d87a' '9855f05e553637f05494cf47a3154cbf9a5cfc67' '5f39231888c63f0a7708abc86b51b847476379d8' '5edeb7d312628961046eec9b26a7e72f44baf846' 'c14445bdcb98feddf9afaeb05e6193cc1f8eec1a' 'cee28113db17f0de58df0eaea4e2756c404ee01f' 'b5867a5c0d7a6bf36f59f3d472c7aed33ca4d02c' '60c10c678b582d41532fefa12667d8adca75811b' 'aad6b35290f52639d3601063d33d9621c0948a04' 'a39111b1cf0864b1782f30f9a1fa65260d057327' 'e6913c6ef83c80aa7569c9e08204542222fbf542' 'ab470abe58c09b2fbe2c1478e67a904fd803e84f' '0c5f77f4eaef8ed9fe752d21f40ac471dd511cfc' '21fa98f4197bb3365dda1417708b318f403c13c1'
# bad: [a6bd6c9333397f5a0e2667d4d82fef8c970108f2] Add linux-next specific files for 20240328
git bisect bad a6bd6c9333397f5a0e2667d4d82fef8c970108f2
# bad: [86c322a4c2ba300ebd086f8f70cec07bb9ca7fce] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git
git bisect bad 86c322a4c2ba300ebd086f8f70cec07bb9ca7fce
# bad: [acb95230d1324d9cc8de9bca38664b607e57fbe3] Merge branch 'counter-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter.git
git bisect bad acb95230d1324d9cc8de9bca38664b607e57fbe3
# bad: [20952655235dd9b1447829591774f1d8561f7c6a] staging: wlan-ng: Remove broken driver prism2_usb
git bisect bad 20952655235dd9b1447829591774f1d8561f7c6a
# bad: [a1ba19a1ae7cd1e324685ded4ab563e78fe68648] greybus: lights: check return of get_channel_from_mode
git bisect bad a1ba19a1ae7cd1e324685ded4ab563e78fe68648
# bad: [d9c60badccc183eb971e0941bb86f9475d4b9551] staging: vc04_services: vchiq_core: Stop kthreads on shutdown
git bisect bad d9c60badccc183eb971e0941bb86f9475d4b9551
# first bad commit: [d9c60badccc183eb971e0941bb86f9475d4b9551] staging: vc04_services: vchiq_core: Stop kthreads on shutdown
# bad: [d9c60badccc183eb971e0941bb86f9475d4b9551] staging: vc04_services: vchiq_core: Stop kthreads on shutdown
git bisect bad d9c60badccc183eb971e0941bb86f9475d4b9551
# first bad commit: [d9c60badccc183eb971e0941bb86f9475d4b9551] staging: vc04_services: vchiq_core: Stop kthreads on shutdown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux