Skip to contentSkip to conversation

scsi: introduce short_inquiry flag for broken host adapters

PATCH In review Vitaly Kuznetsov 3 participants 4 messages Sep 3, 2015 – Sep 15, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: introduce short_inquiry flag for broken host adapters

Some host adapters (e.g. Hyper-V storvsc) are known for not respecting the SPC-2/3/4 requirement for 'INQUIRY data (see table ...) shall contain at least 36 bytes'. As a result we get tons on 'scsi 0:7:1:1: scsi scan:
INQUIRY result too short (5), using 36' messages on console. This can be problematic for slow consoles. Introduce short_inquiry host template flag to avoid printing error messages for such adapters.

---
Changes since v1:
- This is a successor of previously sent "scsi_scan: move 'INQUIRY result too short' message to debug level" patch. Instead of moving the message to debug level for all adapters introduce a special 'short_inquiry' flag for host template [inspired by James Bottomley].

---
 drivers/scsi/scsi_scan.c   | 7 ++++---
 drivers/scsi/storvsc_drv.c | 1 +
 include/scsi/scsi_host.h   | 6 ++++++
 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/scsi/scsi_scan.c +4 -3
index f9f3f82..f1d00a0 100644
@@ -701,9 +701,10 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
 	 * strings.
 	 */
 	if (sdev->inquiry_len < 36) {
-		sdev_printk(KERN_INFO, sdev,
-			    "scsi scan: INQUIRY result too short (%d),"
-			    " using 36\n", sdev->inquiry_len);
+		if (!sdev->host->hostt->short_inquiry)
+			sdev_printk(KERN_INFO, sdev,
+				    "scsi scan: INQUIRY result too short (%d),"
+				    " using 36\n", sdev->inquiry_len);
 		sdev->inquiry_len = 36;
 	}
 
drivers/scsi/storvsc_drv.c +1 -0
index 3c6584f..f3b4d0f 100644
@@ -1711,6 +1711,7 @@ static struct scsi_host_template scsi_driver = {
 	/* Make sure we dont get a sg segment crosses a page boundary */
 	.dma_boundary =		PAGE_SIZE-1,
 	.no_write_same =	1,
+	.short_inquiry =	1,
 };
 
 enum {
include/scsi/scsi_host.h +6 -0
index e113c75..7b022af 100644
@@ -454,6 +454,12 @@ struct scsi_host_template {
 	unsigned no_async_abort:1;
 
 	/*
+	 * True if this host adapter returns short (<36 bytes) responses to
+	 * some INQUIRY requests.
+	 */
+	unsigned short_inquiry:1;
+
+	/*
 	 * Countdown for host blocking with no commands outstanding.
 	 */
 	unsigned int max_host_blocked;
Signature · 1 line
2.4.3
#1 lore raw
Quoted 7 lines · Vitaly Kuznetsov

Some host adapters (e.g. Hyper-V storvsc) are known for not respecting the SPC-2/3/4 requirement for 'INQUIRY data (see table ...) shall contain at least 36 bytes'. As a result we get tons on 'scsi 0:7:1:1: scsi scan:
INQUIRY result too short (5), using 36' messages on console. This can be problematic for slow consoles. Introduce short_inquiry host template flag to avoid printing error messages for such adapters.

Quoted 7 lines

---
Changes since v1:
- This is a successor of previously sent "scsi_scan: move 'INQUIRY result too short' message to debug level" patch. Instead of moving the message to debug level for all adapters introduce a special 'short_inquiry' flag for host template [inspired by James Bottomley].

James,

sorry for the ping but can you please let me know your opinion? This is not a 'cosmetic fix', serial port on Hyper-V is extremely slow and users get softlockups just because we output too much. Here is a freshly booted guest with SCSI and FC adapters connected:

# dmesg | grep -c INQUIRY
2076

(my other pernding '[PATCH] scsi_scan: don't dump trace when scsi_prep_async_scan() is called twice' is related to the same issue).

See also: https://lkml.org/lkml/2015/9/6/119

Thanks,

[...]

Signature · 1 line
  Vitaly
maintainer
#2 lore raw
Quoted 19 lines · Vitaly Kuznetsov
Quoted 7 lines · Vitaly Kuznetsov

Some host adapters (e.g. Hyper-V storvsc) are known for not respecting the SPC-2/3/4 requirement for 'INQUIRY data (see table ...) shall contain at least 36 bytes'. As a result we get tons on 'scsi 0:7:1:1: scsi scan:
INQUIRY result too short (5), using 36' messages on console. This can be problematic for slow consoles. Introduce short_inquiry host template flag to avoid printing error messages for such adapters.

Quoted 7 lines

---
Changes since v1:
- This is a successor of previously sent "scsi_scan: move 'INQUIRY result too short' message to debug level" patch. Instead of moving the message to debug level for all adapters introduce a special 'short_inquiry' flag for host template [inspired by James Bottomley].

James,

Quoted 7 lines

sorry for the ping but can you please let me know your opinion? This is not a 'cosmetic fix', serial port on Hyper-V is extremely slow and users get softlockups just because we output too much. Here is a freshly booted guest with SCSI and FC adapters connected:

# dmesg | grep -c INQUIRY
2076

It needs a review ... preferably from someone who validates that we don't get any adverse impact from the missing inquiry data

Quoted 2 lines

(my other pernding '[PATCH] scsi_scan: don't dump trace when scsi_prep_async_scan() is called twice' is related to the same issue).

So does this.

James

Quoted 6 lines

See also: https://lkml.org/lkml/2015/9/6/119

Thanks,

[...]

#3 lore raw
Quoted 42 lines

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Tuesday, September 15, 2015 11:24 AM
To: Vitaly Kuznetsov <[email protected]>
Cc: [email protected]; [email protected]; KY Srinivasan <[email protected]>; Long Li <[email protected]>; Dexuan Cui <[email protected]>
Subject: Re: [PATCH v2] scsi: introduce short_inquiry flag for broken host adapters

Quoted 3 lines · Vitaly Kuznetsov
Quoted 1 line · Vitaly Kuznetsov

Some host adapters (e.g. Hyper-V storvsc) are known for not respecting

the

Quoted 11 lines
Quoted 11 lines

SPC-2/3/4 requirement for 'INQUIRY data (see table ...) shall contain at least 36 bytes'. As a result we get tons on 'scsi 0:7:1:1: scsi scan:
INQUIRY result too short (5), using 36' messages on console. This can be problematic for slow consoles. Introduce short_inquiry host template flag to avoid printing error messages for such adapters.

---
Changes since v1:
- This is a successor of previously sent "scsi_scan: move 'INQUIRY result too short' message to debug level" patch. Instead of moving the

message

Quoted 5 lines
Quoted 2 lines

to debug level for all adapters introduce a special 'short_inquiry' flag for host template [inspired by James Bottomley].

James,

Quoted 7 lines

sorry for the ping but can you please let me know your opinion? This is not a 'cosmetic fix', serial port on Hyper-V is extremely slow and users get softlockups just because we output too much. Here is a freshly booted guest with SCSI and FC adapters connected:

# dmesg | grep -c INQUIRY
2076
Quoted 7 lines

It needs a review ... preferably from someone who validates that we don't get any adverse impact from the missing inquiry data

Quoted 2 lines

(my other pernding '[PATCH] scsi_scan: don't dump trace when scsi_prep_async_scan() is called twice' is related to the same issue).

So does this.

James,

I will review the code and test this as well.

Regards,

K. Y

Quoted 16 lines

James

Quoted 1 line

See also:

https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flkml.or
g%2flkml%2f2015%2f9%2f6%2f119&data=01%7c01%7ckys%40microsoft.com %7c7a6e9ccabb2f43c0a01108d2bdfad826%7c72f988bf86f141af91ab2d7cd011 db47%7c1&sdata=t3IGLMiG2sU4VJfmGiYKGMy22d3IxHbGQZop63nrV7Y%3d

Quoted 5 lines

Thanks,

[...]