[PATCH v4 2/2] scsi: virtio_scsi: kick event_list unconditionally

From: Joshua Daley

Date: Wed Mar 25 2026 - 14:10:34 EST


The event_list processes non-hotplug events (such as LUN capacity
changes), so remove the conditions that guard the initial kicks in
_probe() and _restore(), as well as the work cancellation in _remove().

Suggested-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
Signed-off-by: Joshua Daley <jdaley@xxxxxxxxxxxxx>
---
drivers/scsi/virtio_scsi.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 64b6c942f572..5fdaa71f0652 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -982,11 +982,10 @@ static int virtscsi_probe(struct virtio_device *vdev)

virtio_device_ready(vdev);

- if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG)) {
- for (int i = 0; i < VIRTIO_SCSI_EVENT_LEN; i++)
- INIT_WORK(&vscsi->event_list[i].work, virtscsi_handle_event);
- virtscsi_kick_event_all(vscsi);
- }
+ for (int i = 0; i < VIRTIO_SCSI_EVENT_LEN; i++)
+ INIT_WORK(&vscsi->event_list[i].work, virtscsi_handle_event);
+
+ virtscsi_kick_event_all(vscsi);

scsi_scan_host(shost);
return 0;
@@ -1003,8 +1002,7 @@ static void virtscsi_remove(struct virtio_device *vdev)
struct Scsi_Host *shost = virtio_scsi_host(vdev);
struct virtio_scsi *vscsi = shost_priv(shost);

- if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
- virtscsi_cancel_event_work(vscsi);
+ virtscsi_cancel_event_work(vscsi);

scsi_remove_host(shost);
virtscsi_remove_vqs(vdev);
@@ -1030,8 +1028,7 @@ static int virtscsi_restore(struct virtio_device *vdev)

virtio_device_ready(vdev);

- if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
- virtscsi_kick_event_all(vscsi);
+ virtscsi_kick_event_all(vscsi);

return err;
}
--
2.34.1