Re: tpm: spi: do not call blocking ops when !TASK_RUNNING; during shutdown
Jarkko Sakkinen <[email protected]>
| Newsgroups | org.kernel.vger.linux-integrity,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Apr 21, 2026 at 09:04:43AM +0000, Peng Fan wrote: > > Subject: tpm: spi: do not call blocking ops when !TASK_RUNNING; > > during shutdown > > > > Hi, > > we use a custom i.MX93 board, which based on Phytec Phycore i.MX93 > > with a TPM connected via SPI. If I enable > > CONFIG_DEBUG_ATOMIC_SLEEP=y in our kernel config with mainline > > kernel 6.18.23 and reboot our board, I will get the following warning: > > ffff0000000d8000 > > The issue seems at drivers/char/tpm/tpm_tis_core.c > 94 rc = wait_event_interruptible_timeout(*queue, > 95 wait_for_tpm_stat_cond(chip, sts_mask, check_cancel, > 96 &canceled), > 97 timeout); > > wait_event_interruptible_timeout set task to !TASK_RUNNING, > but wait_for_tpm_stat_cond still calls into mutex_lock. > > Regards > Peng > > > [Â Â 43.422135] Call trace: > > [Â Â 43.424570]Â __might_sleep+0x74/0x7c (P) > > [Â Â 43.428487]Â mutex_lock+0x24/0x80 > > [Â Â 43.431797]Â spi_bus_lock+0x20/0x50 > > [Â Â 43.435281]Â tpm_tis_spi_transfer_full+0x70/0x2c4 > > [Â Â 43.439979]Â tpm_tis_spi_read_bytes+0x3c/0x48 > > [Â Â 43.444321]Â tpm_tis_status+0x58/0xf8 > > [Â Â 43.447978]Â wait_for_tpm_stat_cond+0x30/0x90 > > [Â Â 43.452329]Â wait_for_tpm_stat+0x1cc/0x2e0 > > [Â Â 43.456419]Â tpm_tis_send_data+0xdc/0x334 > > [Â Â 43.460423]Â tpm_tis_send_main+0x74/0x160 > > [Â Â 43.464427]Â tpm_tis_send+0xd4/0x13c > > [Â Â 43.467998]Â tpm_transmit+0xc4/0x3c4 > > [Â Â 43.471569]Â tpm_transmit_cmd+0x38/0xd4 > > [Â Â 43.475399]Â tpm2_shutdown+0x6c/0xa4 > > [Â Â 43.478970]Â tpm_class_shutdown+0x60/0x88 > > [Â Â 43.482974]Â device_shutdown+0x130/0x25c > > [Â Â 43.486891]Â kernel_restart+0x44/0xa4 > > [Â Â 43.490549]Â __do_sys_reboot+0x114/0x254 > > [Â Â 43.494466]Â __arm64_sys_reboot+0x24/0x30 > > [Â Â 43.498470]Â invoke_syscall+0x48/0x10c > > [Â Â 43.502214]Â el0_svc_common.constprop.0+0x40/0xe0 > > [Â Â 43.506911]Â do_el0_svc+0x1c/0x28 > > [Â Â 43.510222]Â el0_svc+0x34/0xec > > [Â Â 43.513273]Â el0t_64_sync_handler+0xa0/0xe4 > > [Â Â 43.517441]Â el0t_64_sync+0x198/0x19c > > > > Best regards On travel this week but thanks for the report. Investigating next weeek In the meantime, patches are welcome (whcih I will review next week). Br, Jarkko