]> www.infradead.org Git - users/willy/pagecache.git/commit
virtio_pci: Add support for PCIe Function Level Reset
authorIsrael Rukshin <israelr@nvidia.com>
Wed, 27 Nov 2024 06:57:31 +0000 (08:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Jan 2025 14:39:26 +0000 (09:39 -0500)
commita0ec4fb63f5ce15732f8dadc63c931bdf9ff98b5
treeabbb9b9f82df4529095f108a9b786652c275043a
parenta3b9c053d82a9e524746f5473ad1bd18e9894bfa
virtio_pci: Add support for PCIe Function Level Reset

Implement support for Function Level Reset (FLR) in virtio_pci devices.
This change adds reset_prepare and reset_done callbacks, allowing
drivers to properly handle FLR operations.

Without this patch, performing and recovering from an FLR is not possible
for virtio_pci devices. This implementation ensures proper FLR handling
and recovery for both physical and virtual functions.

The device reset can be triggered in case of error or manually via
sysfs:
echo 1 > /sys/bus/pci/devices/$PCI_ADDR/reset

Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: <1732690652-3065-2-git-send-email-israelr@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio.c
drivers/virtio/virtio_pci_common.c
include/linux/virtio.h