Displaying 3 results from an estimated 3 matches for "virtscsi_rescan_hotunplug".
2019 Sep 04
0
[PATCH] scsi: virtio_scsi: unplug LUNs when events missed
...rs/scsi/virtio_scsi.c
> index 297e1076e571..18df77bf371b 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -324,6 +324,36 @@ static void virtscsi_handle_param_change(struct virtio_scsi *vscsi,
> scsi_device_put(sdev);
> }
>
> +static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)
> +{
> + struct scsi_device *sdev;
> + struct Scsi_Host *shost = virtio_scsi_host(vscsi->vdev);
> + unsigned char scsi_cmd[MAX_COMMAND_SIZE];
> + int result, inquiry_len, inq_result_len = 256;
> + char *inq_result = kmalloc(inq_result_len, GFP_KERNEL)...
2020 Jul 29
3
[PATCH 0/1] virtio-scsi: fix missing unplug events when all LUNs are unplugged at the same time
virtio-scsi currently has limit of 8 outstanding notifications so when more that
8 LUNs are unplugged, some are missed.
Commit 5ff843721467 ("scsi: virtio_scsi: unplug LUNs when events missed")
Fixed this by checking the 'event overflow' bit and manually scanned the bus
to see which LUNs are still there.
However there is a corner case when all LUNs are unplugged.
In this case
2020 Jul 29
0
[PATCH 1/1] scsi: virtio-scsi: handle correctly case when all LUNs were unplugged
...om>
---
drivers/scsi/virtio_scsi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 0e0910c5b9424..c7f0c22b6f11d 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -351,6 +351,16 @@ static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)
/* PQ indicates the LUN is not attached */
scsi_remove_device(sdev);
}
+
+ else if (host_byte(result) == DID_BAD_TARGET) {
+ /*
+ * if all LUNs of a virtio-scsi device are unplugged,
+ * it will respond with BAD TARGET on any INQUIRY
+ * command.
+...