This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TLV320AIC3204:TLV32x4驱动程序导致的内核错误和引导故障

Guru**** 1828310 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1318308/tlv320aic3204-kernel-errors-and-boot-failures-due-to-tlv32x4-driver

器件型号:TLV320AIC3204

您好*:

这个问题之前有人提出过、但上一个线程(请参阅 此处)已关闭、但未提供解决方案。 我们正在对 Raspberry Pi 使用与 Audiosense Pi Hat 相同的设计(相同的原理图、只是不同的外形尺寸 PCB;请参阅 https://github.com/b-ak/audiosense-pi)、并且我会在启动期间看到随机内核堆栈跟踪和"Bug:scheduling while onotic"。 这并不是每次都发生,但我会说,至少1每5个靴子。

这种情况发生在运行 Ubuntu 22.04 (Kernel 5.15.0-1044-raspi)的库存 Raspberry Pi 4 (也适用于400)上。

我看到的输出如下所示:

[   11.023538] BUG: scheduling while atomic: kworker/u8:2/106/0x00000002
[   11.031099] Modules linked in: snd_soc_tlv320aic32x4_i2c snd_soc_bcm2835_i2s(+) snd_soc_tlv320aic32x4 snd_soc_audiosense_pi snd_soc_core bcm2835_codec(CE+) bcm2835_v4l2(CE) v4l2_mem2mem bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) snd_compress videobuf2_vmalloc videobuf2_dma_contig ac97_bus videobuf2_memops videobuf2_v4l2 videobuf2_common snd_pcm_dmaengine snd_bcm2835(CE) snd_pcm raspberrypi_hwmon snd_timer videodev mc snd bcm2835_gpiomem vc_sm_cma(CE) nvmem_rmem rpivid_mem uio_pdrv_genirq uio sch_fq_codel dm_multipath drm ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid crct10dif_ce i2c_bcm2835 spi_bcm2835 xhci_pci xhci_pci_renesas phy_generic aes_arm64
[   11.031324] CPU: 0 PID: 106 Comm: kworker/u8:2 Tainted: G         C  E     5.15.0-1044-raspi #47-Ubuntu
[   11.031332] Hardware name: Raspberry Pi 400 Rev 1.1 (DT)
[   11.031336] Workqueue: events_unbound deferred_probe_work_func
[   11.031355] Call trace:
[   11.031357]  dump_backtrace+0x0/0x200
[   11.031364]  show_stack+0x20/0x30
[   11.031368]  dump_stack_lvl+0x8c/0xb8
[   11.031374]  dump_stack+0x18/0x34
[   11.031378]  __schedule_bug+0x5c/0x74
[   11.031384]  __schedule+0x774/0x8b0
[   11.031389]  schedule+0x70/0x170
[   11.031394]  schedule_timeout+0xa0/0x1c4
[   11.031399]  wait_for_completion_timeout+0x88/0x110
[   11.031404]  bcm2835_i2c_xfer+0xe8/0x3a4 [i2c_bcm2835]
[   11.031414]  __i2c_transfer+0xa4/0x4b0
[   11.031420]  i2c_transfer+0x68/0x130
[   11.031424]  regmap_i2c_read+0x64/0xb0
[   11.031430]  _regmap_raw_read+0xb4/0x270
[   11.031435]  _regmap_bus_read+0x4c/0x84
[   11.031440]  _regmap_read+0x80/0x200
[   11.031445]  _regmap_update_bits+0xd4/0x110
[   11.031450]  _regmap_select_page+0xb8/0x160
[   11.031454]  _regmap_raw_read+0x10c/0x270
[   11.031459]  _regmap_bus_read+0x4c/0x84
[   11.031464]  _regmap_read+0x80/0x200
[   11.031469]  regmap_read+0x54/0x80
[   11.031474]  clk_aic32x4_div_recalc_rate+0x40/0x80 [snd_soc_tlv320aic32x4]
[   11.031486]  clk_recalc+0x50/0xf0
[   11.031494]  clk_core_update_orphan_child_rates+0x34/0x70
[   11.031498]  clk_core_update_orphan_child_rates+0x50/0x70
[   11.031503]  clk_reparent+0xb0/0x170
[   11.031507]  __clk_set_parent_before+0x4c/0xb0
[   11.031512]  clk_core_set_parent_nolock+0x130/0x3b0
[   11.031517]  clk_set_parent+0x48/0x180
[   11.031522]  aic32x4_component_probe+0x60/0x1b0 [snd_soc_tlv320aic32x4]
[   11.031529]  snd_soc_component_probe+0x30/0x84 [snd_soc_core]
[   11.031588]  soc_probe_component+0x1dc/0x374 [snd_soc_core]
[   11.031624]  snd_soc_bind_card+0x27c/0x7c0 [snd_soc_core]
[   11.031658]  snd_soc_register_card+0xf8/0x110 [snd_soc_core]
[   11.031693]  audiosense_pi_card_probe+0x6c/0xc4 [snd_soc_audiosense_pi]
[   11.031700]  platform_probe+0x70/0x110
[   11.031705]  really_probe+0xd0/0x490
[   11.031711]  __driver_probe_device+0x148/0x190
[   11.031716]  driver_probe_device+0xec/0x180
[   11.031721]  __device_attach_driver+0xe0/0x1b0
[   11.031727]  bus_for_each_drv+0x80/0xe0
[   11.031733]  __device_attach+0xb0/0x210
[   11.031738]  device_initial_probe+0x1c/0x30
[   11.031742]  bus_probe_device+0xa4/0xb0
[   11.031747]  deferred_probe_work_func+0xa4/0xf4
[   11.031752]  process_one_work+0x204/0x4e0
[   11.031759]  worker_thread+0x144/0x490
[   11.031764]  kthread+0x128/0x134
[   11.031768]  ret_from_fork+0x10/0x20
[   11.035880] BUG: scheduling while atomic: kworker/u8:2/106/0x00000000
[   11.043475] Modules linked in: snd_soc_tlv320aic32x4_i2c snd_soc_bcm2835_i2s(+) snd_soc_tlv320aic32x4 snd_soc_audiosense_pi snd_soc_core bcm2835_codec(CE+) bcm2835_v4l2(CE) v4l2_mem2mem bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) snd_compress videobuf2_vmalloc videobuf2_dma_contig ac97_bus videobuf2_memops videobuf2_v4l2 videobuf2_common snd_pcm_dmaengine snd_bcm2835(CE) snd_pcm raspberrypi_hwmon snd_timer videodev mc snd bcm2835_gpiomem vc_sm_cma(CE) nvmem_rmem rpivid_mem uio_pdrv_genirq uio sch_fq_codel dm_multipath drm ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid crct10dif_ce i2c_bcm2835 spi_bcm2835 xhci_pci xhci_pci_renesas phy_generic aes_arm64
[   11.043723] CPU: 0 PID: 106 Comm: kworker/u8:2 Tainted: G        WC  E     5.15.0-1044-raspi #47-Ubuntu
[   11.043731] Hardware name: Raspberry Pi 400 Rev 1.1 (DT)
[   11.043735] Workqueue: events_unbound deferred_probe_work_func
[   11.043759] Call trace:
[   11.043761]  dump_backtrace+0x0/0x200
[   11.043772]  show_stack+0x20/0x30
[   11.043776]  dump_stack_lvl+0x8c/0xb8
[   11.043783]  dump_stack+0x18/0x34
[   11.043787]  __schedule_bug+0x5c/0x74
[   11.043794]  __schedule+0x774/0x8b0
[   11.043799]  schedule+0x70/0x170
[   11.043803]  schedule_timeout+0xa0/0x1c4
[   11.043809]  wait_for_completion_timeout+0x88/0x110
[   11.043814]  bcm2835_i2c_xfer+0xe8/0x3a4 [i2c_bcm2835]
[   11.043824]  __i2c_transfer+0xa4/0x4b0
[   11.043830]  i2c_transfer+0x68/0x130
[   11.043835]  regmap_i2c_read+0x64/0xb0
[   11.043840]  _regmap_raw_read+0xb4/0x270
[   11.043846]  _regmap_bus_read+0x4c/0x84
[   11.043851]  _regmap_read+0x80/0x200
[   11.043855]  _regmap_update_bits+0xd4/0x110
[   11.043861]  _regmap_select_page+0xb8/0x160
[   11.043865]  _regmap_raw_read+0x10c/0x270
[   11.043870]  _regmap_bus_read+0x4c/0x84
[   11.043876]  _regmap_read+0x80/0x200
[   11.043880]  _regmap_update_bits+0xd4/0x110
[   11.043885]  regmap_update_bits_base+0x6c/0xa0
[   11.043890]  clk_aic32x4_codec_clkin_set_parent+0x34/0x40 [snd_soc_tlv320aic32x4]
[   11.043902]  clk_core_set_parent_nolock+0x158/0x3b0
[   11.043908]  clk_set_parent+0x48/0x180
[   11.043913]  aic32x4_component_probe+0x60/0x1b0 [snd_soc_tlv320aic32x4]
[   11.043921]  snd_soc_component_probe+0x30/0x84 [snd_soc_core]
[   11.043980]  soc_probe_component+0x1dc/0x374 [snd_soc_core]
[   11.044015]  snd_soc_bind_card+0x27c/0x7c0 [snd_soc_core]
[   11.044050]  snd_soc_register_card+0xf8/0x110 [snd_soc_core]
[   11.044084]  audiosense_pi_card_probe+0x6c/0xc4 [snd_soc_audiosense_pi]
[   11.044092]  platform_probe+0x70/0x110
[   11.044097]  really_probe+0xd0/0x490
[   11.044102]  __driver_probe_device+0x148/0x190
[   11.044108]  driver_probe_device+0xec/0x180
[   11.044113]  __device_attach_driver+0xe0/0x1b0
[   11.044119]  bus_for_each_drv+0x80/0xe0
[   11.044124]  __device_attach+0xb0/0x210
[   11.044129]  device_initial_probe+0x1c/0x30
[   11.044132]  bus_probe_device+0xa4/0xb0
[   11.044137]  deferred_probe_work_func+0xa4/0xf4
[   11.044142]  process_one_work+0x204/0x4e0
[   11.044148]  worker_thread+0x144/0x490
[   11.044153]  kthread+0x128/0x134
[   11.044158]  ret_from_fork+0x10/0x20
[   11.057622] BUG: scheduling while atomic: kworker/u8:2/106/0x00000002
[   11.065215] Modules linked in: snd_soc_tlv320aic32x4_spi(+) snd_soc_tlv320aic32x4_i2c snd_soc_bcm2835_i2s(+) snd_soc_tlv320aic32x4 snd_soc_audiosense_pi snd_soc_core bcm2835_codec(CE+) bcm2835_v4l2(CE) v4l2_mem2mem bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) snd_compress videobuf2_vmalloc videobuf2_dma_contig ac97_bus videobuf2_memops videobuf2_v4l2 videobuf2_common snd_pcm_dmaengine snd_bcm2835(CE) snd_pcm raspberrypi_hwmon snd_timer videodev mc snd bcm2835_gpiomem vc_sm_cma(CE) nvmem_rmem rpivid_mem uio_pdrv_genirq uio sch_fq_codel dm_multipath drm ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid crct10dif_ce i2c_bcm2835 spi_bcm2835 xhci_pci xhci_pci_renesas phy_generic aes_arm64
[   11.065465] CPU: 0 PID: 106 Comm: kworker/u8:2 Tainted: G        WC  E     5.15.0-1044-raspi #47-Ubuntu
[   11.065473] Hardware name: Raspberry Pi 400 Rev 1.1 (DT)
[   11.065479] Workqueue: events_unbound deferred_probe_work_func
[   11.065499] Call trace:
[   11.065501]  dump_backtrace+0x0/0x200
[   11.065510]  show_stack+0x20/0x30
[   11.065515]  dump_stack_lvl+0x8c/0xb8
[   11.065523]  dump_stack+0x18/0x34
[   11.065527]  __schedule_bug+0x5c/0x74
[   11.065534]  __schedule+0x774/0x8b0
[   11.065540]  schedule+0x70/0x170
[   11.065544]  schedule_timeout+0xa0/0x1c4
[   11.065551]  wait_for_completion_timeout+0x88/0x110
[   11.065556]  bcm2835_i2c_xfer+0xe8/0x3a4 [i2c_bcm2835]
[   11.065571]  __i2c_transfer+0xa4/0x4b0
[   11.065577]  i2c_transfer+0x68/0x130
[   11.065581]  regmap_i2c_read+0x64/0xb0
[   11.065587]  _regmap_raw_read+0xb4/0x270
[   11.065594]  _regmap_bus_read+0x4c/0x84
[   11.065599]  _regmap_read+0x80/0x200
[   11.065603]  _regmap_update_bits+0xd4/0x110
[   11.065609]  _regmap_select_page+0xb8/0x160
[   11.065614]  _regmap_raw_read+0x10c/0x270
[   11.065619]  _regmap_bus_read+0x4c/0x84
[   11.065624]  _regmap_read+0x80/0x200
[   11.065629]  regmap_read+0x54/0x80
[   11.065633]  clk_aic32x4_div_recalc_rate+0x40/0x80 [snd_soc_tlv320aic32x4]
[   11.065649]  clk_recalc+0x50/0xf0
[   11.065659]  clk_core_update_orphan_child_rates+0x34/0x70
[   11.065664]  clk_reparent+0xb0/0x170
[   11.065668]  __clk_set_parent_before+0x4c/0xb0
[   11.065673]  clk_core_set_parent_nolock+0x130/0x3b0
[   11.065678]  clk_set_parent+0x48/0x180
[   11.065683]  aic32x4_component_probe+0x6c/0x1b0 [snd_soc_tlv320aic32x4]
[   11.065690]  snd_soc_component_probe+0x30/0x84 [snd_soc_core]
[   11.065761]  soc_probe_component+0x1dc/0x374 [snd_soc_core]
[   11.065798]  snd_soc_bind_card+0x27c/0x7c0 [snd_soc_core]
[   11.065834]  snd_soc_register_card+0xf8/0x110 [snd_soc_core]
[   11.065871]  audiosense_pi_card_probe+0x6c/0xc4 [snd_soc_audiosense_pi]
[   11.065879]  platform_probe+0x70/0x110
[   11.065884]  really_probe+0xd0/0x490
[   11.065889]  __driver_probe_device+0x148/0x190
[   11.065894]  driver_probe_device+0xec/0x180
[   11.065900]  __device_attach_driver+0xe0/0x1b0
[   11.065905]  bus_for_each_drv+0x80/0xe0
[   11.065910]  __device_attach+0xb0/0x210
[   11.065915]  device_initial_probe+0x1c/0x30
[   11.065919]  bus_probe_device+0xa4/0xb0
[   11.065924]  deferred_probe_work_func+0xa4/0xf4
[   11.065929]  process_one_work+0x204/0x4e0
[   11.065940]  worker_thread+0x144/0x490
[   11.065944]  kthread+0x128/0x134
[   11.065951]  ret_from_fork+0x10/0x20
[   11.066926] BUG: scheduling while atomic: kworker/u8:2/106/0x00000000

因此、如上一 主题中所述、在时钟初始化期间执行 I2C 访问似乎会出现问题。

我可以确认 I2C 总线正常工作、并且 MCLK 始终存在(由一个在通电后立即开始运行的振荡器提供)。

此问题是否曾得到解决? 是否有适用于该驱动程序的补丁? 我有什么想法可以尝试解决它?

此致、
肖恩

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Sean、您好!

    似乎错误发生在 regmap_read 上、我们的驱动程序只是调用该接口。 如果出现此问题、可能是传入用法出现问题、导致了堆栈调度问题。 请检查并分享我们的驱动程序的任何错误日志。

    此致

    凯文

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Kevin:

    感谢您的答复。 我不是一个经验丰富的驱动程序开发人员、我只是做了硬件设计、然后注意到了这些引导问题、所以这有点脱离了我的专业知识范围。

    但我现在用一个支持后端的6.2版内核进行了测试,这样,问题就不会再发生了。 我想在 Ubuntu 22.03 LTS 上的5.15内核与更新的6.2之间有一个驱动程序更新、并修复了它。

    我想我们可以关闭这个岛屿。

    谢谢!

    此致、
    肖恩