linux/drivers/accel/amdxdna
Wendy Liang 488f4902e1 accel/amdxdna: Fix command timeout race
When two commands enter aie2_sched_job_timedout() concurrently, both
check the timeout detection state. The first scheduler thread observes
tdr_status as SIGNALED and updates it to WAIT. The second thread then
observes the updated state instead of the original SIGNALED state, which
may cause the command timeout to be handled incorrectly.

Replace tdr_status with last_signal_ts, which records the timestamp of
the last driver signal. Timeout detection now only reads
last_signal_ts and never modifies it, allowing multiple serialized
detect() calls under dev_lock to evaluate the same signal timestamp
independently. If there is not any new job scheduled or completed
within tdr_timeout_ms, the command will timeout.

Fixes: 9022f01097 ("accel/amdxdna: Check for device hang on job timeout")
Signed-off-by: Wendy Liang <wendy.liang@amd.com>
Reviewed-by: Max Zhen <max.zhen@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260718083409.1825940-1-lizhi.hou@amd.com
2026-07-19 18:23:40 -07:00
..
aie_psp.c accel/amdxdna: Add AIE4 firmware loading 2026-04-01 10:27:42 -07:00
aie_smu.c accel/amdxdna: Create common SMU interfaces for AIE2 and AIE4 2026-04-01 10:44:51 -07:00
aie.c accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie.h accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie2_ctx.c accel/amdxdna: Fix command timeout race 2026-07-19 18:23:40 -07:00
aie2_error.c accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie2_message.c accel/amdxdna: Fix potential NULL pointer dereference of abo->client 2026-07-07 20:49:28 -07:00
aie2_msg_priv.h accel/amdxdna: Add expandable device heap support 2026-05-18 16:03:57 -07:00
aie2_pci.c accel/amdxdna: Fix command timeout race 2026-07-19 18:23:40 -07:00
aie2_pci.h accel/amdxdna: Fix command timeout race 2026-07-19 18:23:40 -07:00
aie2_pm.c accel/amdxdna: Add configuring low and medium power mode 2026-04-27 09:04:51 -07:00
aie2_solver.c accel/amdxdna: Set default DPM level based on QoS for temporal-only mode 2026-04-27 09:04:34 -07:00
aie2_solver.h accel/amdxdna: Enhance power management settings 2024-12-16 15:50:32 -06:00
aie4_ctx.c accel/amdxdna: Add command doorbell and wait support 2026-05-07 14:07:34 -07:00
aie4_host_queue.h accel/amdxdna: Add command doorbell and wait support 2026-05-07 14:07:34 -07:00
aie4_message.c accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie4_msg_priv.h accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie4_pci.c accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie4_pci.h accel/amdxdna: Add AIE4 work buffer initialization 2026-05-07 14:09:33 -07:00
aie4_sriov.c accel/amdxdna: Add basic support for AIE4 devices 2026-04-01 10:11:53 -07:00
amdxdna_cbuf.c accel/amdxdna: Add carveout memory support for non-IOMMU systems 2026-05-05 08:27:04 -07:00
amdxdna_cbuf.h accel/amdxdna: Add carveout memory support for non-IOMMU systems 2026-05-05 08:27:04 -07:00
amdxdna_ctx.c accel/amdxdna: Fix use-after-free of mm_struct in job scheduler 2026-07-16 20:05:28 -07:00
amdxdna_ctx.h accel/amdxdna: Fix use-after-free in debug BO command handling 2026-07-01 14:57:45 -07:00
amdxdna_debugfs.c accel/amdxdna: Add carveout memory support for non-IOMMU systems 2026-05-05 08:27:04 -07:00
amdxdna_debugfs.h accel/amdxdna: Add carveout memory support for non-IOMMU systems 2026-05-05 08:27:04 -07:00
amdxdna_error.h accel/amdxdna: Support getting last hardware error 2025-10-16 09:32:48 -07:00
amdxdna_gem.c accel/amdxdna: Fix potential NULL pointer dereference of abo->client 2026-07-07 20:49:28 -07:00
amdxdna_gem.h accel/amdxdna: Fix potential NULL pointer dereference of abo->client 2026-07-07 20:49:28 -07:00
amdxdna_iommu.c accel/amdxdna: Fix iommu domain lifetime race during device removal 2026-06-29 10:44:03 -07:00
amdxdna_mailbox_helper.c accel/amdxdna: Remove casting mailbox payload pointer 2025-01-13 14:21:39 -06:00
amdxdna_mailbox_helper.h accel/amdxdna: Add IOCTL parameter for telemetry data 2025-11-04 09:04:21 -08:00
amdxdna_mailbox.c accel/amdxdna: Improve tracing for job lifecycle and mailbox RX worker 2026-04-22 08:35:21 -07:00
amdxdna_mailbox.h accel/amdxdna: Add basic support for AIE4 devices 2026-04-01 10:11:53 -07:00
amdxdna_pci_drv.c accel/amdxdna: Check init_srcu_struct() return value 2026-07-07 20:49:19 -07:00
amdxdna_pci_drv.h accel/amdxdna: Fix amdxdna_client lifetime race during device removal 2026-06-29 10:33:30 -07:00
amdxdna_pm.c accel/amdxdna: Fix dead lock for suspend and resume 2026-02-23 09:24:17 -08:00
amdxdna_pm.h accel/amdxdna: Fix dead lock for suspend and resume 2026-02-23 09:24:17 -08:00
amdxdna_sysfs.c accel/amdxdna: Get device revision to derive VBNV string 2026-04-17 09:13:40 -07:00
amdxdna_ubuf.c Merge drm/drm-next into drm-misc-next 2026-05-28 11:27:53 +02:00
amdxdna_ubuf.h accel/amdxdna: Refactor GEM BO handling and add helper APIs for address retrieval 2026-03-20 22:12:49 -07:00
Kconfig accel/amdxdna: Add a new driver for AMD AI Engine 2024-11-22 11:41:26 -07:00
Makefile accel/amdxdna: Add AIE4 VF hardware context create and destroy 2026-05-07 14:07:34 -07:00
npu1_regs.c accel/amdxdna: Add expandable device heap support 2026-05-18 16:03:57 -07:00
npu3_regs.c accel/amdxdna: Add command doorbell and wait support 2026-05-07 14:07:34 -07:00
npu4_regs.c accel/amdxdna: Add expandable device heap support 2026-05-18 16:03:57 -07:00
npu5_regs.c accel/amdxdna: Add expandable device heap support 2026-05-18 16:03:57 -07:00
npu6_regs.c accel/amdxdna: Add expandable device heap support 2026-05-18 16:03:57 -07:00
TODO accel/amdxdna: Support firmware debug buffer 2025-10-20 09:07:12 -07:00