Displaying 11 results from an estimated 11 matches for "scsi_remove_device".
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
...rivers/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.
+ * Remove the device in this case as well
+ */
+ scsi_remove_device(sdev);
+ }
}
kf...
2012 Jul 03
2
[PATCH v2] virtio-scsi: hotplug support for virtio-scsi
...nsigned int lun = (event->lun[2] << 8) | event->lun[3];
+
+ switch (event->reason) {
+ case VIRTIO_SCSI_EVT_RESET_RESCAN:
+ scsi_add_device(shost, 0, target, lun);
+ break;
+ case VIRTIO_SCSI_EVT_RESET_REMOVED:
+ sdev = scsi_device_lookup(shost, 0, target, lun);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else {
+ pr_err("SCSI device %d 0 %d %d not found\n",
+ shost->host_no, target, lun);
+ }
+ break;
+ default:
+ pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
+ }
+}
+
+static void virtscsi_handle_event(str...
2012 Jul 03
2
[PATCH v2] virtio-scsi: hotplug support for virtio-scsi
...nsigned int lun = (event->lun[2] << 8) | event->lun[3];
+
+ switch (event->reason) {
+ case VIRTIO_SCSI_EVT_RESET_RESCAN:
+ scsi_add_device(shost, 0, target, lun);
+ break;
+ case VIRTIO_SCSI_EVT_RESET_REMOVED:
+ sdev = scsi_device_lookup(shost, 0, target, lun);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else {
+ pr_err("SCSI device %d 0 %d %d not found\n",
+ shost->host_no, target, lun);
+ }
+ break;
+ default:
+ pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
+ }
+}
+
+static void virtscsi_handle_event(str...
2012 Jul 05
1
[PATCH v3] virtio-scsi: hotplug support for virtio-scsi
...nsigned int lun = (event->lun[2] << 8) | event->lun[3];
+
+ switch (event->reason) {
+ case VIRTIO_SCSI_EVT_RESET_RESCAN:
+ scsi_add_device(shost, 0, target, lun);
+ break;
+ case VIRTIO_SCSI_EVT_RESET_REMOVED:
+ sdev = scsi_device_lookup(shost, 0, target, lun);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else {
+ pr_err("SCSI device %d 0 %d %d not found\n",
+ shost->host_no, target, lun);
+ }
+ break;
+ default:
+ pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
+ }
+}
+
+static void virtscsi_handle_event(str...
2012 Jul 05
1
[PATCH v3] virtio-scsi: hotplug support for virtio-scsi
...nsigned int lun = (event->lun[2] << 8) | event->lun[3];
+
+ switch (event->reason) {
+ case VIRTIO_SCSI_EVT_RESET_RESCAN:
+ scsi_add_device(shost, 0, target, lun);
+ break;
+ case VIRTIO_SCSI_EVT_RESET_REMOVED:
+ sdev = scsi_device_lookup(shost, 0, target, lun);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else {
+ pr_err("SCSI device %d 0 %d %d not found\n",
+ shost->host_no, target, lun);
+ }
+ break;
+ default:
+ pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
+ }
+}
+
+static void virtscsi_handle_event(str...
2019 Sep 04
0
[PATCH] scsi: virtio_scsi: unplug LUNs when events missed
...+ inq_result, inquiry_len, NULL,
> + 2, 3, NULL);
Where do the weird 2 and 3 values come from?
Most callers seem to use SD_TIMEOUT, SD_MAX_RETRIES...
> +
> + if (result == 0 && inq_result[0] >> 5) {
> + /* PQ indicates the LUN is not attached */
> + scsi_remove_device(sdev);
> + }
> + }
> +
> + kfree(inq_result);
> +}
> +
> static void virtscsi_handle_event(struct work_struct *work)
> {
> struct virtio_scsi_event_node *event_node =
> @@ -335,6 +365,7 @@ static void virtscsi_handle_event(struct work_struct *work)
> cpu_...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...device removed at scsi%u:%u:%u\n",
> + desc->bus, desc->target, desc->lun[1]);
> +
> + if (!scsi_host_get(host))
> + return;
> +
> + sdev = scsi_device_lookup(host, desc->bus, desc->target,
> + desc->lun[1]);
> + if (sdev) {
> + scsi_remove_device(sdev);
> + scsi_device_put(sdev);
> + } else
> + printk(KERN_INFO "pvscsi: failed to lookup scsi%u:%u:%u\n",
> + desc->bus, desc->target, desc->lun[1]);
> +
> + scsi_host_put(host);
> + }
> +}
> +
> +static int pvscsi_msg_pending(const...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...device removed at scsi%u:%u:%u\n",
> + desc->bus, desc->target, desc->lun[1]);
> +
> + if (!scsi_host_get(host))
> + return;
> +
> + sdev = scsi_device_lookup(host, desc->bus, desc->target,
> + desc->lun[1]);
> + if (sdev) {
> + scsi_remove_device(sdev);
> + scsi_device_put(sdev);
> + } else
> + printk(KERN_INFO "pvscsi: failed to lookup scsi%u:%u:%u\n",
> + desc->bus, desc->target, desc->lun[1]);
> +
> + scsi_host_put(host);
> + }
> +}
> +
> +static int pvscsi_msg_pending(const...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...k(KERN_INFO
+ "vmw_pvscsi: msg: device removed at scsi%u:%u:%u\n",
+ desc->bus, desc->target, desc->lun[1]);
+
+ if (!scsi_host_get(host))
+ return;
+
+ sdev = scsi_device_lookup(host, desc->bus, desc->target,
+ desc->lun[1]);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else
+ printk(KERN_INFO
+ "vmw_pvscsi: failed to lookup scsi%u:%u:%u\n",
+ desc->bus, desc->target, desc->lun[1]);
+
+ scsi_host_put(host);
+ }
+}
+
+static int pvscsi_msg_pending(const struct pvscsi_adapter *adapter)
+{...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...k(KERN_INFO
+ "vmw_pvscsi: msg: device removed at scsi%u:%u:%u\n",
+ desc->bus, desc->target, desc->lun[1]);
+
+ if (!scsi_host_get(host))
+ return;
+
+ sdev = scsi_device_lookup(host, desc->bus, desc->target,
+ desc->lun[1]);
+ if (sdev) {
+ scsi_remove_device(sdev);
+ scsi_device_put(sdev);
+ } else
+ printk(KERN_INFO
+ "vmw_pvscsi: failed to lookup scsi%u:%u:%u\n",
+ desc->bus, desc->target, desc->lun[1]);
+
+ scsi_host_put(host);
+ }
+}
+
+static int pvscsi_msg_pending(const struct pvscsi_adapter *adapter)
+{...