]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: virtio_scsi: Kick event_list unconditionally
authorJoshua Daley <jdaley@linux.ibm.com>
Wed, 25 Mar 2026 18:08:57 +0000 (19:08 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 27 Mar 2026 20:42:08 +0000 (16:42 -0400)
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@redhat.com>
Signed-off-by: Joshua Daley <jdaley@linux.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://patch.msgid.link/20260325180857.3675854-3-jdaley@linux.ibm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/virtio_scsi.c

index 64b6c942f57208257e56f823a3107e5a7193eab1..5fdaa71f065289c92029399f31467a8fe3b5fd15 100644 (file)
@@ -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;
 }