[PATCH v2 0/2] virtio: PCI ERS permanent failure teardown for virtio-blk
From: Xixin Liu
Date: Fri Jul 31 2026 - 04:29:25 EST
Hi,
This series adds PCI AER error_detected for virtio-pci and completes
virtio-blk teardown when ERS reports pci_channel_io_perm_failure.
virtio-pci only registered reset_prepare/reset_done. The recovery core
treats devices without error_detected as NO_AER_DRIVER and does not
deliver perm_failure to the driver after a failed recovery. When bus
reset fails (reproduced on QEMU with DLLLA not set within 100 ms after
secondary bus reset), virtio-blk disks stay live even though virtqueues
may already have been torn down during the frozen phase.
Patch 1 registers error_detected (frozen quiesce + perm_failure notify).
Patch 2 calls the virtio driver shutdown hook from virtio-pci on
perm_failure and implements virtio-blk shutdown with blk_mark_disk_dead().
Changes since v1 (thanks for the review on v1):
- Disclose LLM help on the commit message (Assisted-by); ASCII only
- virtblk_shutdown: virtio_break_device() before flush_work()
- virtio_queue_rq: drop disk_live(); keep NULL vqs/vdev guards only
(broken vq already fails in virtqueue_add)
Based on linux-next next-20260730.
Thanks,
Xixin Liu
---
Xixin Liu (2):
virtio-pci: add error_detected for PCI AER recovery
virtio-blk: mark disk dead on ERS permanent failure
drivers/block/virtio_blk.c | 31 ++++++++++++++++++++++++
drivers/virtio/virtio_pci_common.c | 38 ++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
--
2.43.0