All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
@ 2014-12-16 21:21 ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi
  Cc: K. Y. Srinivasan

The first two patches in this series are a resend; these were submitted
some months ago and as far as I know, there were no outstanding issues.

Win8 and win8 r2 hosts do support SPC-3 features but claim SPC-2 compliance.
This issue is fixed here as well.

K. Y. Srinivasan (4):
  Drivers: scsi: storvsc: In responce to a scan event, scan the host
  Drivers: scsi: storvsc: Force discovery of LUNs that may have been
    removed.
  Drivers: scsi: storvsc: Fix a bug in storvsc limits
  Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2
    hosts

 drivers/scsi/storvsc_drv.c |   71 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 57 insertions(+), 14 deletions(-)

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
@ 2014-12-16 21:21 ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi

The first two patches in this series are a resend; these were submitted
some months ago and as far as I know, there were no outstanding issues.

Win8 and win8 r2 hosts do support SPC-3 features but claim SPC-2 compliance.
This issue is fixed here as well.

K. Y. Srinivasan (4):
  Drivers: scsi: storvsc: In responce to a scan event, scan the host
  Drivers: scsi: storvsc: Force discovery of LUNs that may have been
    removed.
  Drivers: scsi: storvsc: Fix a bug in storvsc limits
  Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2
    hosts

 drivers/scsi/storvsc_drv.c |   71 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 57 insertions(+), 14 deletions(-)

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan the host
  2014-12-16 21:21 ` K. Y. Srinivasan
@ 2014-12-16 21:21   ` K. Y. Srinivasan
  -1 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi
  Cc: K. Y. Srinivasan

The virtual HBA that storvsc implements can support multiple channels and
targets. So, scan the host when the host notifies that a scan is needed.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e3ba251..0a96fef 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -426,21 +426,16 @@ done:
 	kfree(wrk);
 }
 
-static void storvsc_bus_scan(struct work_struct *work)
+static void storvsc_host_scan(struct work_struct *work)
 {
 	struct storvsc_scan_work *wrk;
-	int id, order_id;
+	struct Scsi_Host *host;
 
 	wrk = container_of(work, struct storvsc_scan_work, work);
-	for (id = 0; id < wrk->host->max_id; ++id) {
-		if (wrk->host->reverse_ordering)
-			order_id = wrk->host->max_id - id - 1;
-		else
-			order_id = id;
-
-		scsi_scan_target(&wrk->host->shost_gendev, 0,
-				order_id, SCAN_WILD_CARD, 1);
-	}
+	host = wrk->host;
+
+	scsi_scan_host(host);
+
 	kfree(wrk);
 }
 
@@ -1198,7 +1193,7 @@ static void storvsc_on_receive(struct hv_device *device,
 		if (!work)
 			return;
 
-		INIT_WORK(&work->work, storvsc_bus_scan);
+		INIT_WORK(&work->work, storvsc_host_scan);
 		work->host = stor_device->host;
 		schedule_work(&work->work);
 		break;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan the host
@ 2014-12-16 21:21   ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi

The virtual HBA that storvsc implements can support multiple channels and
targets. So, scan the host when the host notifies that a scan is needed.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e3ba251..0a96fef 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -426,21 +426,16 @@ done:
 	kfree(wrk);
 }
 
-static void storvsc_bus_scan(struct work_struct *work)
+static void storvsc_host_scan(struct work_struct *work)
 {
 	struct storvsc_scan_work *wrk;
-	int id, order_id;
+	struct Scsi_Host *host;
 
 	wrk = container_of(work, struct storvsc_scan_work, work);
-	for (id = 0; id < wrk->host->max_id; ++id) {
-		if (wrk->host->reverse_ordering)
-			order_id = wrk->host->max_id - id - 1;
-		else
-			order_id = id;
-
-		scsi_scan_target(&wrk->host->shost_gendev, 0,
-				order_id, SCAN_WILD_CARD, 1);
-	}
+	host = wrk->host;
+
+	scsi_scan_host(host);
+
 	kfree(wrk);
 }
 
@@ -1198,7 +1193,7 @@ static void storvsc_on_receive(struct hv_device *device,
 		if (!work)
 			return;
 
-		INIT_WORK(&work->work, storvsc_bus_scan);
+		INIT_WORK(&work->work, storvsc_host_scan);
 		work->host = stor_device->host;
 		schedule_work(&work->work);
 		break;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may have been removed.
  2014-12-16 21:21   ` K. Y. Srinivasan
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  -1 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi
  Cc: K. Y. Srinivasan

The host asks the guest to scan when a LUN is removed or added.
The only way a guest can identify the removed LUN is when an I/O is
attempted on a removed LUN - the SRB status code indicates that the LUN
is invalid. We currently handle this SRB status and remove the device.

Rather than waiting for an I/O to remove the device, force the discovery of
LUNs that may have been removed prior to discovering LUNs that may have
been added.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 0a96fef..a7163c6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -430,10 +430,36 @@ static void storvsc_host_scan(struct work_struct *work)
 {
 	struct storvsc_scan_work *wrk;
 	struct Scsi_Host *host;
+	struct scsi_device *sdev;
+	unsigned long flags;
 
 	wrk = container_of(work, struct storvsc_scan_work, work);
 	host = wrk->host;
 
+	/*
+	 * Before scanning the host, first check to see if any of the
+	 * currrently known devices have been hot removed. We issue a
+	 * "unit ready" command against all currently known devices.
+	 * This I/O will result in an error for devices that have been
+	 * removed. As part of handling the I/O error, we remove the device.
+	 *
+	 * When a LUN is added or removed, the host sends us a signal to
+	 * scan the host. Thus we are forced to discover the LUNs that
+	 * may have been removed this way.
+	 */
+	mutex_lock(&host->scan_mutex);
+	spin_lock_irqsave(host->host_lock, flags);
+	list_for_each_entry(sdev, &host->__devices, siblings) {
+		spin_unlock_irqrestore(host->host_lock, flags);
+		scsi_test_unit_ready(sdev, 1, 1, NULL);
+		spin_lock_irqsave(host->host_lock, flags);
+		continue;
+	}
+	spin_unlock_irqrestore(host->host_lock, flags);
+	mutex_unlock(&host->scan_mutex);
+	/*
+	 * Now scan the host to discover LUNs that may have been added.
+	 */
 	scsi_scan_host(host);
 
 	kfree(wrk);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may have been removed.
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi

The host asks the guest to scan when a LUN is removed or added.
The only way a guest can identify the removed LUN is when an I/O is
attempted on a removed LUN - the SRB status code indicates that the LUN
is invalid. We currently handle this SRB status and remove the device.

Rather than waiting for an I/O to remove the device, force the discovery of
LUNs that may have been removed prior to discovering LUNs that may have
been added.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 0a96fef..a7163c6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -430,10 +430,36 @@ static void storvsc_host_scan(struct work_struct *work)
 {
 	struct storvsc_scan_work *wrk;
 	struct Scsi_Host *host;
+	struct scsi_device *sdev;
+	unsigned long flags;
 
 	wrk = container_of(work, struct storvsc_scan_work, work);
 	host = wrk->host;
 
+	/*
+	 * Before scanning the host, first check to see if any of the
+	 * currrently known devices have been hot removed. We issue a
+	 * "unit ready" command against all currently known devices.
+	 * This I/O will result in an error for devices that have been
+	 * removed. As part of handling the I/O error, we remove the device.
+	 *
+	 * When a LUN is added or removed, the host sends us a signal to
+	 * scan the host. Thus we are forced to discover the LUNs that
+	 * may have been removed this way.
+	 */
+	mutex_lock(&host->scan_mutex);
+	spin_lock_irqsave(host->host_lock, flags);
+	list_for_each_entry(sdev, &host->__devices, siblings) {
+		spin_unlock_irqrestore(host->host_lock, flags);
+		scsi_test_unit_ready(sdev, 1, 1, NULL);
+		spin_lock_irqsave(host->host_lock, flags);
+		continue;
+	}
+	spin_unlock_irqrestore(host->host_lock, flags);
+	mutex_unlock(&host->scan_mutex);
+	/*
+	 * Now scan the host to discover LUNs that may have been added.
+	 */
 	scsi_scan_host(host);
 
 	kfree(wrk);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits
  2014-12-16 21:21   ` K. Y. Srinivasan
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  -1 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi
  Cc: K. Y. Srinivasan

Commit 4cd83ecdac20d30725b4f96e5d7814a1e290bc7e changed the limits to
reflect the values on the host. It turns out that WS2008R2 cannot
correctly handle these new limits. Fix this bug by setting the limits
based on the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index a7163c6..fdc5164 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1782,6 +1782,9 @@ static int storvsc_probe(struct hv_device *device,
 	bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
 	int target = 0;
 	struct storvsc_device *stor_device;
+	int max_luns_per_target;
+	int max_targets;
+	int max_channels;
 
 	/*
 	 * Based on the windows host we are running on,
@@ -1795,12 +1798,18 @@ static int storvsc_probe(struct hv_device *device,
 		vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
 		vmstor_current_major = VMSTOR_WIN7_MAJOR;
 		vmstor_current_minor = VMSTOR_WIN7_MINOR;
+		max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET;
+		max_targets = STORVSC_IDE_MAX_TARGETS;
+		max_channels = STORVSC_IDE_MAX_CHANNELS;
 		break;
 	default:
 		sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
 		vmscsi_size_delta = 0;
 		vmstor_current_major = VMSTOR_WIN8_MAJOR;
 		vmstor_current_minor = VMSTOR_WIN8_MINOR;
+		max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET;
+		max_targets = STORVSC_MAX_TARGETS;
+		max_channels = STORVSC_MAX_CHANNELS;
 		break;
 	}
 
@@ -1848,9 +1857,9 @@ static int storvsc_probe(struct hv_device *device,
 		break;
 
 	case SCSI_GUID:
-		host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
-		host->max_id = STORVSC_MAX_TARGETS;
-		host->max_channel = STORVSC_MAX_CHANNELS - 1;
+		host->max_lun = max_luns_per_target;
+		host->max_id = max_targets;
+		host->max_channel = max_channels - 1;
 		break;
 
 	default:
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi

Commit 4cd83ecdac20d30725b4f96e5d7814a1e290bc7e changed the limits to
reflect the values on the host. It turns out that WS2008R2 cannot
correctly handle these new limits. Fix this bug by setting the limits
based on the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index a7163c6..fdc5164 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1782,6 +1782,9 @@ static int storvsc_probe(struct hv_device *device,
 	bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
 	int target = 0;
 	struct storvsc_device *stor_device;
+	int max_luns_per_target;
+	int max_targets;
+	int max_channels;
 
 	/*
 	 * Based on the windows host we are running on,
@@ -1795,12 +1798,18 @@ static int storvsc_probe(struct hv_device *device,
 		vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
 		vmstor_current_major = VMSTOR_WIN7_MAJOR;
 		vmstor_current_minor = VMSTOR_WIN7_MINOR;
+		max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET;
+		max_targets = STORVSC_IDE_MAX_TARGETS;
+		max_channels = STORVSC_IDE_MAX_CHANNELS;
 		break;
 	default:
 		sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
 		vmscsi_size_delta = 0;
 		vmstor_current_major = VMSTOR_WIN8_MAJOR;
 		vmstor_current_minor = VMSTOR_WIN8_MINOR;
+		max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET;
+		max_targets = STORVSC_MAX_TARGETS;
+		max_channels = STORVSC_MAX_CHANNELS;
 		break;
 	}
 
@@ -1848,9 +1857,9 @@ static int storvsc_probe(struct hv_device *device,
 		break;
 
 	case SCSI_GUID:
-		host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
-		host->max_id = STORVSC_MAX_TARGETS;
-		host->max_channel = STORVSC_MAX_CHANNELS - 1;
+		host->max_lun = max_luns_per_target;
+		host->max_id = max_targets;
+		host->max_channel = max_channels - 1;
 		break;
 
 	default:
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/4] Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2 hosts
  2014-12-16 21:21   ` K. Y. Srinivasan
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  -1 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi
  Cc: K. Y. Srinivasan

On win8 and win8 r2 hosts force SPC-3 compliance for MSFT virtual disks.
Ubuntu has been carrying a similar patch outside the tree for a while now.
Starting with win10, the host will support SPC-3 compliance. Based on all
the testing that has been done on win8 and win8 r2 hosts, we are comfortable
claiming SPC-3 compliance on these hosts as well. This will enable TRIM
support on these hosts.

Suggested by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index fdc5164..7487e07 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1468,6 +1468,19 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 	 */
 	sdevice->sdev_bflags |= msft_blist_flags;
 
+	/*
+	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
+	 * if the device is a MSFT virtual device.
+	 */
+	if (!strncmp(sdevice->vendor, "Msft", 4)) {
+		switch (vmbus_proto_version) {
+		case VERSION_WIN8:
+		case VERSION_WIN8_1:
+			sdevice->scsi_level = SCSI_SPC_3;
+			break;
+		}
+	}
+
 	return 0;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/4] Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2 hosts
@ 2014-12-16 21:21     ` K. Y. Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: K. Y. Srinivasan @ 2014-12-16 21:21 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi

On win8 and win8 r2 hosts force SPC-3 compliance for MSFT virtual disks.
Ubuntu has been carrying a similar patch outside the tree for a while now.
Starting with win10, the host will support SPC-3 compliance. Based on all
the testing that has been done on win8 and win8 r2 hosts, we are comfortable
claiming SPC-3 compliance on these hosts as well. This will enable TRIM
support on these hosts.

Suggested by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/scsi/storvsc_drv.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index fdc5164..7487e07 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1468,6 +1468,19 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 	 */
 	sdevice->sdev_bflags |= msft_blist_flags;
 
+	/*
+	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
+	 * if the device is a MSFT virtual device.
+	 */
+	if (!strncmp(sdevice->vendor, "Msft", 4)) {
+		switch (vmbus_proto_version) {
+		case VERSION_WIN8:
+		case VERSION_WIN8_1:
+			sdevice->scsi_level = SCSI_SPC_3;
+			break;
+		}
+	}
+
 	return 0;
 }
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* RE: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
  2014-12-16 21:21 ` K. Y. Srinivasan
  (?)
  (?)
@ 2014-12-29 21:07 ` KY Srinivasan
  2014-12-30  9:32     ` hch
  -1 siblings, 1 reply; 20+ messages in thread
From: KY Srinivasan @ 2014-12-29 21:07 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, ohering, jbottomley,
	hch, linux-scsi



> -----Original Message-----
> From: K. Y. Srinivasan [mailto:kys@microsoft.com]
> Sent: Tuesday, December 16, 2014 1:21 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org
> Cc: KY Srinivasan
> Subject: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
> 
> The first two patches in this series are a resend; these were submitted some
> months ago and as far as I know, there were no outstanding issues.
> 
> Win8 and win8 r2 hosts do support SPC-3 features but claim SPC-2
> compliance.
> This issue is fixed here as well.
> 
> K. Y. Srinivasan (4):
>   Drivers: scsi: storvsc: In responce to a scan event, scan the host
>   Drivers: scsi: storvsc: Force discovery of LUNs that may have been
>     removed.
>   Drivers: scsi: storvsc: Fix a bug in storvsc limits
>   Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2
>     hosts

Christoph,

Should I be resending these patches.

Regards,

K. Y
> 
>  drivers/scsi/storvsc_drv.c |   71
> +++++++++++++++++++++++++++++++++++--------
>  1 files changed, 57 insertions(+), 14 deletions(-)
> 
> --
> 1.7.4.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
  2014-12-29 21:07 ` [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues KY Srinivasan
@ 2014-12-30  9:32     ` hch
  0 siblings, 0 replies; 20+ messages in thread
From: hch @ 2014-12-30  9:32 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: gregkh, linux-kernel, devel, ohering, jbottomley, linux-scsi

On Mon, Dec 29, 2014 at 09:07:59PM +0000, KY Srinivasan wrote:
> Should I be resending these patches.

I don't need a resend, I need a review for the patches.  Note that for
driver patches I'm also fine with a review from a co worker, as long as
it's a real review not just a rubber stamp.

Talking about process:  for the next submission please only use
"storvsc:  " as the subject prefix, I had to remove "Drivers: scsi: "
which doesn'd add useful information every time so far.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
@ 2014-12-30  9:32     ` hch
  0 siblings, 0 replies; 20+ messages in thread
From: hch @ 2014-12-30  9:32 UTC (permalink / raw)
  To: KY Srinivasan
  Cc: linux-scsi, gregkh, ohering, jbottomley, linux-kernel, devel

On Mon, Dec 29, 2014 at 09:07:59PM +0000, KY Srinivasan wrote:
> Should I be resending these patches.

I don't need a resend, I need a review for the patches.  Note that for
driver patches I'm also fine with a review from a co worker, as long as
it's a real review not just a rubber stamp.

Talking about process:  for the next submission please only use
"storvsc:  " as the subject prefix, I had to remove "Drivers: scsi: "
which doesn'd add useful information every time so far.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
  2014-12-30  9:32     ` hch
@ 2014-12-30 16:22       ` KY Srinivasan
  -1 siblings, 0 replies; 20+ messages in thread
From: KY Srinivasan @ 2014-12-30 16:22 UTC (permalink / raw)
  To: hch; +Cc: gregkh, linux-kernel, devel, ohering, jbottomley, linux-scsi



> -----Original Message-----
> From: hch@infradead.org [mailto:hch@infradead.org]
> Sent: Tuesday, December 30, 2014 1:32 AM
> To: KY Srinivasan
> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
> 
> On Mon, Dec 29, 2014 at 09:07:59PM +0000, KY Srinivasan wrote:
> > Should I be resending these patches.
> 
> I don't need a resend, I need a review for the patches.  Note that for driver
> patches I'm also fine with a review from a co worker, as long as it's a real
> review not just a rubber stamp.

Thanks; will do.
> 
> Talking about process:  for the next submission please only use
> "storvsc:  " as the subject prefix, I had to remove "Drivers: scsi: "
> which doesn'd add useful information every time so far.
Ok.

Regards,

K. Y

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
@ 2014-12-30 16:22       ` KY Srinivasan
  0 siblings, 0 replies; 20+ messages in thread
From: KY Srinivasan @ 2014-12-30 16:22 UTC (permalink / raw)
  To: hch; +Cc: linux-scsi, gregkh, ohering, jbottomley, linux-kernel, devel



> -----Original Message-----
> From: hch@infradead.org [mailto:hch@infradead.org]
> Sent: Tuesday, December 30, 2014 1:32 AM
> To: KY Srinivasan
> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
> 
> On Mon, Dec 29, 2014 at 09:07:59PM +0000, KY Srinivasan wrote:
> > Should I be resending these patches.
> 
> I don't need a resend, I need a review for the patches.  Note that for driver
> patches I'm also fine with a review from a co worker, as long as it's a real
> review not just a rubber stamp.

Thanks; will do.
> 
> Talking about process:  for the next submission please only use
> "storvsc:  " as the subject prefix, I had to remove "Drivers: scsi: "
> which doesn'd add useful information every time so far.
Ok.

Regards,

K. Y

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan the host
  2014-12-16 21:21   ` K. Y. Srinivasan
                     ` (3 preceding siblings ...)
  (?)
@ 2014-12-30 19:21   ` Long Li
  -1 siblings, 0 replies; 20+ messages in thread
From: Long Li @ 2014-12-30 19:21 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, ohering, jbottomley,
	hch, linux-scsi



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of K. Y. Srinivasan
> Sent: Tuesday, December 16, 2014 1:22 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org
> Subject: [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan
> the host
> 
> The virtual HBA that storvsc implements can support multiple channels and
> targets. So, scan the host when the host notifies that a scan is needed.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c |   19 +++++++------------
>  1 files changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
> e3ba251..0a96fef 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -426,21 +426,16 @@ done:
>  	kfree(wrk);
>  }
> 
> -static void storvsc_bus_scan(struct work_struct *work)
> +static void storvsc_host_scan(struct work_struct *work)
>  {
>  	struct storvsc_scan_work *wrk;
> -	int id, order_id;
> +	struct Scsi_Host *host;
> 
>  	wrk = container_of(work, struct storvsc_scan_work, work);
> -	for (id = 0; id < wrk->host->max_id; ++id) {
> -		if (wrk->host->reverse_ordering)
> -			order_id = wrk->host->max_id - id - 1;
> -		else
> -			order_id = id;
> -
> -		scsi_scan_target(&wrk->host->shost_gendev, 0,
> -				order_id, SCAN_WILD_CARD, 1);
> -	}
> +	host = wrk->host;
> +
> +	scsi_scan_host(host);
> +
>  	kfree(wrk);
>  }
> 
> @@ -1198,7 +1193,7 @@ static void storvsc_on_receive(struct hv_device
> *device,
>  		if (!work)
>  			return;
> 
> -		INIT_WORK(&work->work, storvsc_bus_scan);
> +		INIT_WORK(&work->work, storvsc_host_scan);
>  		work->host = stor_device->host;
>  		schedule_work(&work->work);
>  		break;
> --
> 1.7.4.1
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may have been removed.
  2014-12-16 21:21     ` K. Y. Srinivasan
  (?)
@ 2014-12-30 19:22     ` Long Li
  -1 siblings, 0 replies; 20+ messages in thread
From: Long Li @ 2014-12-30 19:22 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, ohering, jbottomley,
	hch, linux-scsi



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of K. Y. Srinivasan
> Sent: Tuesday, December 16, 2014 1:22 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org
> Subject: [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may
> have been removed.
> 
> The host asks the guest to scan when a LUN is removed or added.
> The only way a guest can identify the removed LUN is when an I/O is
> attempted on a removed LUN - the SRB status code indicates that the LUN is
> invalid. We currently handle this SRB status and remove the device.
> 
> Rather than waiting for an I/O to remove the device, force the discovery of
> LUNs that may have been removed prior to discovering LUNs that may have
> been added.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c |   26 ++++++++++++++++++++++++++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
> 0a96fef..a7163c6 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -430,10 +430,36 @@ static void storvsc_host_scan(struct work_struct
> *work)  {
>  	struct storvsc_scan_work *wrk;
>  	struct Scsi_Host *host;
> +	struct scsi_device *sdev;
> +	unsigned long flags;
> 
>  	wrk = container_of(work, struct storvsc_scan_work, work);
>  	host = wrk->host;
> 
> +	/*
> +	 * Before scanning the host, first check to see if any of the
> +	 * currrently known devices have been hot removed. We issue a
> +	 * "unit ready" command against all currently known devices.
> +	 * This I/O will result in an error for devices that have been
> +	 * removed. As part of handling the I/O error, we remove the device.
> +	 *
> +	 * When a LUN is added or removed, the host sends us a signal to
> +	 * scan the host. Thus we are forced to discover the LUNs that
> +	 * may have been removed this way.
> +	 */
> +	mutex_lock(&host->scan_mutex);
> +	spin_lock_irqsave(host->host_lock, flags);
> +	list_for_each_entry(sdev, &host->__devices, siblings) {
> +		spin_unlock_irqrestore(host->host_lock, flags);
> +		scsi_test_unit_ready(sdev, 1, 1, NULL);
> +		spin_lock_irqsave(host->host_lock, flags);
> +		continue;
> +	}
> +	spin_unlock_irqrestore(host->host_lock, flags);
> +	mutex_unlock(&host->scan_mutex);
> +	/*
> +	 * Now scan the host to discover LUNs that may have been added.
> +	 */
>  	scsi_scan_host(host);
> 
>  	kfree(wrk);
> --
> 1.7.4.1
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits
  2014-12-16 21:21     ` K. Y. Srinivasan
  (?)
@ 2014-12-30 19:24     ` Long Li
  -1 siblings, 0 replies; 20+ messages in thread
From: Long Li @ 2014-12-30 19:24 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, ohering, jbottomley,
	hch, linux-scsi



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of K. Y. Srinivasan
> Sent: Tuesday, December 16, 2014 1:22 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org
> Subject: [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits
> 
> Commit 4cd83ecdac20d30725b4f96e5d7814a1e290bc7e changed the limits to
> reflect the values on the host. It turns out that WS2008R2 cannot correctly
> handle these new limits. Fix this bug by setting the limits based on the host.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c |   15 ++++++++++++---
>  1 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
> a7163c6..fdc5164 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1782,6 +1782,9 @@ static int storvsc_probe(struct hv_device *device,
>  	bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
>  	int target = 0;
>  	struct storvsc_device *stor_device;
> +	int max_luns_per_target;
> +	int max_targets;
> +	int max_channels;
> 
>  	/*
>  	 * Based on the windows host we are running on, @@ -1795,12
> +1798,18 @@ static int storvsc_probe(struct hv_device *device,
>  		vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
>  		vmstor_current_major = VMSTOR_WIN7_MAJOR;
>  		vmstor_current_minor = VMSTOR_WIN7_MINOR;
> +		max_luns_per_target =
> STORVSC_IDE_MAX_LUNS_PER_TARGET;
> +		max_targets = STORVSC_IDE_MAX_TARGETS;
> +		max_channels = STORVSC_IDE_MAX_CHANNELS;
>  		break;
>  	default:
>  		sense_buffer_size =
> POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
>  		vmscsi_size_delta = 0;
>  		vmstor_current_major = VMSTOR_WIN8_MAJOR;
>  		vmstor_current_minor = VMSTOR_WIN8_MINOR;
> +		max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET;
> +		max_targets = STORVSC_MAX_TARGETS;
> +		max_channels = STORVSC_MAX_CHANNELS;
>  		break;
>  	}
> 
> @@ -1848,9 +1857,9 @@ static int storvsc_probe(struct hv_device *device,
>  		break;
> 
>  	case SCSI_GUID:
> -		host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
> -		host->max_id = STORVSC_MAX_TARGETS;
> -		host->max_channel = STORVSC_MAX_CHANNELS - 1;
> +		host->max_lun = max_luns_per_target;
> +		host->max_id = max_targets;
> +		host->max_channel = max_channels - 1;
>  		break;
> 
>  	default:
> --
> 1.7.4.1
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 4/4] Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2 hosts
  2014-12-16 21:21     ` K. Y. Srinivasan
  (?)
@ 2014-12-30 19:28     ` Long Li
  -1 siblings, 0 replies; 20+ messages in thread
From: Long Li @ 2014-12-30 19:28 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, ohering, jbottomley,
	hch, linux-scsi



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of K. Y. Srinivasan
> Sent: Tuesday, December 16, 2014 1:22 PM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; ohering@suse.com;
> jbottomley@parallels.com; hch@infradead.org; linux-scsi@vger.kernel.org
> Subject: [PATCH 4/4] Drivers: scsi: storvsc: Force SPC-3 compliance on win8
> and win8 r2 hosts
> 
> On win8 and win8 r2 hosts force SPC-3 compliance for MSFT virtual disks.
> Ubuntu has been carrying a similar patch outside the tree for a while now.
> Starting with win10, the host will support SPC-3 compliance. Based on all the
> testing that has been done on win8 and win8 r2 hosts, we are comfortable
> claiming SPC-3 compliance on these hosts as well. This will enable TRIM
> support on these hosts.
> 
> Suggested by: James Bottomley
> <James.Bottomley@HansenPartnership.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
> fdc5164..7487e07 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1468,6 +1468,19 @@ static int storvsc_device_configure(struct
> scsi_device *sdevice)
>  	 */
>  	sdevice->sdev_bflags |= msft_blist_flags;
> 
> +	/*
> +	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
> +	 * if the device is a MSFT virtual device.
> +	 */
> +	if (!strncmp(sdevice->vendor, "Msft", 4)) {
> +		switch (vmbus_proto_version) {
> +		case VERSION_WIN8:
> +		case VERSION_WIN8_1:
> +			sdevice->scsi_level = SCSI_SPC_3;
> +			break;
> +		}
> +	}
> +
>  	return 0;
>  }
> 
> --
> 1.7.4.1
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues
  2014-12-16 21:21 ` K. Y. Srinivasan
                   ` (2 preceding siblings ...)
  (?)
@ 2015-01-05 19:25 ` Christoph Hellwig
  -1 siblings, 0 replies; 20+ messages in thread
From: Christoph Hellwig @ 2015-01-05 19:25 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: gregkh, linux-kernel, devel, ohering, jbottomley, linux-scsi

Thanks, applied to scsi-for-3.20.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-01-05 19:25 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-16 21:21 [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues K. Y. Srinivasan
2014-12-16 21:21 ` K. Y. Srinivasan
2014-12-16 21:21 ` [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan the host K. Y. Srinivasan
2014-12-16 21:21   ` K. Y. Srinivasan
2014-12-16 21:21   ` [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may have been removed K. Y. Srinivasan
2014-12-16 21:21     ` K. Y. Srinivasan
2014-12-30 19:22     ` Long Li
2014-12-16 21:21   ` [PATCH 3/4] Drivers: scsi: storvsc: Fix a bug in storvsc limits K. Y. Srinivasan
2014-12-16 21:21     ` K. Y. Srinivasan
2014-12-30 19:24     ` Long Li
2014-12-16 21:21   ` [PATCH 4/4] Drivers: scsi: storvsc: Force SPC-3 compliance on win8 and win8 r2 hosts K. Y. Srinivasan
2014-12-16 21:21     ` K. Y. Srinivasan
2014-12-30 19:28     ` Long Li
2014-12-30 19:21   ` [PATCH 1/4] Drivers: scsi: storvsc: In responce to a scan event, scan the host Long Li
2014-12-29 21:07 ` [PATCH 0/4] Drivers: scsi: storvsc: Fix miscellaneous issues KY Srinivasan
2014-12-30  9:32   ` hch
2014-12-30  9:32     ` hch
2014-12-30 16:22     ` KY Srinivasan
2014-12-30 16:22       ` KY Srinivasan
2015-01-05 19:25 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.