All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] hpsa compatility fixes
@ 2016-11-18  7:32 Hannes Reinecke
  2016-11-18  7:32 ` [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte Hannes Reinecke
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Hannes Reinecke @ 2016-11-18  7:32 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Don Brace, Martin Wilck,
	linux-scsi, Hannes Reinecke

Hi all,

this is a patchset to get hpsa working on older controllers.
Most notably older controller do not support the extended REPORT PHYS
command, so we need to fallback to the legacy version here.
I've also added a new sysfs HBA attribute 'ctlr_num', which displays
the current controller number. With that attribute one can construct
legacy '/dev/ccissX' symlinks to facilitate an update from older
installations using the cciss driver.

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
  hpsa: use correct DID_NO_CONNECT hostbyte
  hpsa: fallback to use legacy REPORT PHYS command
  hpsa: add 'ctlr_num' sysfs attribute

 drivers/scsi/hpsa.c | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)

-- 
1.8.5.6


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

* [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte
  2016-11-18  7:32 [PATCH 0/3] hpsa compatility fixes Hannes Reinecke
@ 2016-11-18  7:32 ` Hannes Reinecke
  2016-11-29  2:02   ` Don Brace
  2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Hannes Reinecke @ 2016-11-18  7:32 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Don Brace, Martin Wilck,
	linux-scsi, Hannes Reinecke, Hannes Reinecke

NOT_READY is a sense key, not a legit scsi hostbyte value.
Use DID_NO_CONNECT instead.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ea64c01..488e17c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5493,7 +5493,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
 
 	dev = cmd->device->hostdata;
 	if (!dev) {
-		cmd->result = NOT_READY << 16; /* host byte */
+		cmd->result = DID_NO_CONNECT << 16;
 		cmd->scsi_done(cmd);
 		return 0;
 	}
-- 
1.8.5.6


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

* [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
  2016-11-18  7:32 [PATCH 0/3] hpsa compatility fixes Hannes Reinecke
  2016-11-18  7:32 ` [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte Hannes Reinecke
@ 2016-11-18  7:32 ` Hannes Reinecke
  2016-11-22 13:21   ` Martin Wilck
                     ` (2 more replies)
  2016-11-18  7:32 ` [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute Hannes Reinecke
  2016-11-29 16:11 ` [PATCH 0/3] hpsa compatility fixes Martin K. Petersen
  3 siblings, 3 replies; 11+ messages in thread
From: Hannes Reinecke @ 2016-11-18  7:32 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Don Brace, Martin Wilck,
	linux-scsi, Hannes Reinecke, Hannes Reinecke

Older SmartArray controller do not support the extended REPORT PHYS
command, so fallback to use the legacy version here.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/hpsa.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 488e17c..3d89f74 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3628,8 +3628,32 @@ static int hpsa_scsi_do_report_luns(struct ctlr_info *h, int logical,
 static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
 		struct ReportExtendedLUNdata *buf, int bufsize)
 {
-	return hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
-						HPSA_REPORT_PHYS_EXTENDED);
+	int rc;
+	struct ReportLUNdata *lbuf;
+
+	rc = hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
+				      HPSA_REPORT_PHYS_EXTENDED);
+	if (!rc || !hpsa_allow_any)
+		return rc;
+
+	/* REPORT PHYS EXTENDED is not supported */
+	lbuf = kzalloc(sizeof(*lbuf), GFP_KERNEL);
+	if (!lbuf)
+		return -ENOMEM;
+
+	rc = hpsa_scsi_do_report_luns(h, 0, lbuf, sizeof(*lbuf), 0);
+	if (!rc) {
+		int i;
+		u32 nphys;
+
+		/* Copy ReportLUNdata header */
+		memcpy(buf, lbuf, 8);
+		nphys = be32_to_cpu(*((__be32 *)lbuf->LUNListLength)) / 24;
+		for (i = 0; i < nphys; i++)
+			memcpy(buf->LUN[i].lunid, lbuf->LUN[i], 8);
+	}
+	kfree(lbuf);
+	return rc;
 }
 
 static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
-- 
1.8.5.6


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

* [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute
  2016-11-18  7:32 [PATCH 0/3] hpsa compatility fixes Hannes Reinecke
  2016-11-18  7:32 ` [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte Hannes Reinecke
  2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
@ 2016-11-18  7:32 ` Hannes Reinecke
  2016-11-29  2:03   ` Don Brace
  2016-11-29 16:11 ` [PATCH 0/3] hpsa compatility fixes Martin K. Petersen
  3 siblings, 1 reply; 11+ messages in thread
From: Hannes Reinecke @ 2016-11-18  7:32 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Don Brace, Martin Wilck,
	linux-scsi, Hannes Reinecke, Hannes Reinecke

Add a sysfs attribute 'ctlr_num' holding the current HPSA controller
number. This is required to construct compability 'cciss' links.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/hpsa.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 3d89f74..5834117 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -867,6 +867,16 @@ static ssize_t path_info_show(struct device *dev,
 	return output_len;
 }
 
+static ssize_t host_show_ctlr_num(struct device *dev,
+	struct device_attribute *attr, char *buf)
+{
+	struct ctlr_info *h;
+	struct Scsi_Host *shost = class_to_shost(dev);
+
+	h = shost_to_hba(shost);
+	return snprintf(buf, 20, "%d\n", h->ctlr);
+}
+
 static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
 static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
 static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
@@ -890,6 +900,8 @@ static DEVICE_ATTR(resettable, S_IRUGO,
 	host_show_resettable, NULL);
 static DEVICE_ATTR(lockup_detected, S_IRUGO,
 	host_show_lockup_detected, NULL);
+static DEVICE_ATTR(ctlr_num, S_IRUGO,
+	host_show_ctlr_num, NULL);
 
 static struct device_attribute *hpsa_sdev_attrs[] = {
 	&dev_attr_raid_level,
@@ -910,6 +922,7 @@ static DEVICE_ATTR(lockup_detected, S_IRUGO,
 	&dev_attr_hp_ssd_smart_path_status,
 	&dev_attr_raid_offload_debug,
 	&dev_attr_lockup_detected,
+	&dev_attr_ctlr_num,
 	NULL,
 };
 
-- 
1.8.5.6


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

* Re: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
  2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
@ 2016-11-22 13:21   ` Martin Wilck
  2016-11-29 16:10   ` Martin K. Petersen
  2016-12-01 21:50   ` Don Brace
  2 siblings, 0 replies; 11+ messages in thread
From: Martin Wilck @ 2016-11-22 13:21 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Don Brace, Martin Wilck,
	linux-scsi, Hannes Reinecke

On Fri, 2016-11-18 at 08:32 +0100, Hannes Reinecke wrote:
> Older SmartArray controller do not support the extended REPORT PHYS
> command, so fallback to use the legacy version here.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>

Tested-by: Martin Wilck <mwilck@suse.com>

> ---
>  drivers/scsi/hpsa.c | 28 ++++++++++++++++++++++++++--
>  1 file changed, 26 insertions(+), 2 deletions(-)

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


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

* RE: [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte
  2016-11-18  7:32 ` [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte Hannes Reinecke
@ 2016-11-29  2:02   ` Don Brace
  0 siblings, 0 replies; 11+ messages in thread
From: Don Brace @ 2016-11-29  2:02 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Martin Wilck, linux-scsi,
	Hannes Reinecke

> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@suse.de]
> Sent: Friday, November 18, 2016 1:33 AM
> To: Martin K. Petersen
> Cc: Christoph Hellwig; James Bottomley; Don Brace; Martin Wilck; linux-
> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
> Subject: [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte
> 
> EXTERNAL EMAIL
> 
> 
> NOT_READY is a sense key, not a legit scsi hostbyte value.
> Use DID_NO_CONNECT instead.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/hpsa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index ea64c01..488e17c 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -5493,7 +5493,7 @@ static int hpsa_scsi_queue_command(struct
> Scsi_Host *sh, struct scsi_cmnd *cmd)
> 
>         dev = cmd->device->hostdata;
>         if (!dev) {
> -               cmd->result = NOT_READY << 16; /* host byte */
> +               cmd->result = DID_NO_CONNECT << 16;
>                 cmd->scsi_done(cmd);
>                 return 0;
>         }
> --
> 1.8.5.6

Acked-by: Don Brace <don.brace@microsemi.com>

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

* RE: [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute
  2016-11-18  7:32 ` [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute Hannes Reinecke
@ 2016-11-29  2:03   ` Don Brace
  0 siblings, 0 replies; 11+ messages in thread
From: Don Brace @ 2016-11-29  2:03 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Martin Wilck, linux-scsi,
	Hannes Reinecke

> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@suse.de]
> Sent: Friday, November 18, 2016 1:33 AM
> To: Martin K. Petersen
> Cc: Christoph Hellwig; James Bottomley; Don Brace; Martin Wilck; linux-
> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
> Subject: [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute
> 
> EXTERNAL EMAIL
> 
> 
> Add a sysfs attribute 'ctlr_num' holding the current HPSA controller
> number. This is required to construct compability 'cciss' links.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/hpsa.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 3d89f74..5834117 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -867,6 +867,16 @@ static ssize_t path_info_show(struct device *dev,
>         return output_len;
>  }
> 
> +static ssize_t host_show_ctlr_num(struct device *dev,
> +       struct device_attribute *attr, char *buf)
> +{
> +       struct ctlr_info *h;
> +       struct Scsi_Host *shost = class_to_shost(dev);
> +
> +       h = shost_to_hba(shost);
> +       return snprintf(buf, 20, "%d\n", h->ctlr);
> +}
> +
>  static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
>  static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
>  static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
> @@ -890,6 +900,8 @@ static DEVICE_ATTR(resettable, S_IRUGO,
>         host_show_resettable, NULL);
>  static DEVICE_ATTR(lockup_detected, S_IRUGO,
>         host_show_lockup_detected, NULL);
> +static DEVICE_ATTR(ctlr_num, S_IRUGO,
> +       host_show_ctlr_num, NULL);
> 
>  static struct device_attribute *hpsa_sdev_attrs[] = {
>         &dev_attr_raid_level,
> @@ -910,6 +922,7 @@ static DEVICE_ATTR(lockup_detected, S_IRUGO,
>         &dev_attr_hp_ssd_smart_path_status,
>         &dev_attr_raid_offload_debug,
>         &dev_attr_lockup_detected,
> +       &dev_attr_ctlr_num,
>         NULL,
>  };
> 
> --
> 1.8.5.6

Acked-by: Don Brace <don.brace@microsemi.com>


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

* Re: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
  2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
  2016-11-22 13:21   ` Martin Wilck
@ 2016-11-29 16:10   ` Martin K. Petersen
  2016-12-01 21:50   ` Don Brace
  2 siblings, 0 replies; 11+ messages in thread
From: Martin K. Petersen @ 2016-11-29 16:10 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	Don Brace, Martin Wilck, linux-scsi, Hannes Reinecke

>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> Older SmartArray controller do not support the extended REPORT
Hannes> PHYS command, so fallback to use the legacy version here.

Don: Please review.

Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 0/3] hpsa compatility fixes
  2016-11-18  7:32 [PATCH 0/3] hpsa compatility fixes Hannes Reinecke
                   ` (2 preceding siblings ...)
  2016-11-18  7:32 ` [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute Hannes Reinecke
@ 2016-11-29 16:11 ` Martin K. Petersen
  3 siblings, 0 replies; 11+ messages in thread
From: Martin K. Petersen @ 2016-11-29 16:11 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	Don Brace, Martin Wilck, linux-scsi

>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> Hi all, this is a patchset to get hpsa working on older
Hannes> controllers.  Most notably older controller do not support the
Hannes> extended REPORT PHYS command, so we need to fallback to the
Hannes> legacy version here.  I've also added a new sysfs HBA attribute
Hannes> 'ctlr_num', which displays the current controller number. With
Hannes> that attribute one can construct legacy '/dev/ccissX' symlinks
Hannes> to facilitate an update from older installations using the cciss
Hannes> driver.

Applied patches 1 and 3. Patch 2 is awaiting feedback from Microsemi.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* RE: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
  2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
  2016-11-22 13:21   ` Martin Wilck
  2016-11-29 16:10   ` Martin K. Petersen
@ 2016-12-01 21:50   ` Don Brace
  2016-12-02 10:23     ` Hannes Reinecke
  2 siblings, 1 reply; 11+ messages in thread
From: Don Brace @ 2016-12-01 21:50 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Martin Wilck, linux-scsi,
	Hannes Reinecke


> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@suse.de]
> Sent: Friday, November 18, 2016 1:33 AM
> To: Martin K. Petersen
> Cc: Christoph Hellwig; James Bottomley; Don Brace; Martin Wilck; linux-
> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
> Subject: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
> 
> EXTERNAL EMAIL
> 
> 
> Older SmartArray controller do not support the extended REPORT PHYS
> command, so fallback to use the legacy version here.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/hpsa.c | 28 ++++++++++++++++++++++++++--
>  1 file changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 488e17c..3d89f74 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -3628,8 +3628,32 @@ static int hpsa_scsi_do_report_luns(struct
> ctlr_info *h, int logical,
>  static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
>                 struct ReportExtendedLUNdata *buf, int bufsize)
>  {
> -       return hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
> -                                               HPSA_REPORT_PHYS_EXTENDED);
> +       int rc;
> +       struct ReportLUNdata *lbuf;
> +
> +       rc = hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
> +                                     HPSA_REPORT_PHYS_EXTENDED);
> +       if (!rc || !hpsa_allow_any)
> +               return rc;
> +
> +       /* REPORT PHYS EXTENDED is not supported */
> +       lbuf = kzalloc(sizeof(*lbuf), GFP_KERNEL);
> +       if (!lbuf)
> +               return -ENOMEM;
> +
> +       rc = hpsa_scsi_do_report_luns(h, 0, lbuf, sizeof(*lbuf), 0);
> +       if (!rc) {
> +               int i;
> +               u32 nphys;
> +
> +               /* Copy ReportLUNdata header */
> +               memcpy(buf, lbuf, 8);
> +               nphys = be32_to_cpu(*((__be32 *)lbuf->LUNListLength)) / 24;
> +               for (i = 0; i < nphys; i++)
> +                       memcpy(buf->LUN[i].lunid, lbuf->LUN[i], 8);
> +       }
> +       kfree(lbuf);
> +       return rc;
>  }
> 
>  static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
> --
> 1.8.5.6

For a non-extended REPORT_PHYS, the buffer size is 8, so the divisor needs to be 8.
REPORT_PHYS_EXTENDED has been around a long time, which controller and fw are you testing this on so I can
Also run some tests.

Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation





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

* Re: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
  2016-12-01 21:50   ` Don Brace
@ 2016-12-02 10:23     ` Hannes Reinecke
  0 siblings, 0 replies; 11+ messages in thread
From: Hannes Reinecke @ 2016-12-02 10:23 UTC (permalink / raw)
  To: Don Brace, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Martin Wilck, linux-scsi,
	Hannes Reinecke

On 12/01/2016 10:50 PM, Don Brace wrote:
>
>> -----Original Message-----
>> From: Hannes Reinecke [mailto:hare@suse.de]
>> Sent: Friday, November 18, 2016 1:33 AM
>> To: Martin K. Petersen
>> Cc: Christoph Hellwig; James Bottomley; Don Brace; Martin Wilck; linux-
>> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
>> Subject: [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command
>>
>> EXTERNAL EMAIL
>>
>>
>> Older SmartArray controller do not support the extended REPORT PHYS
>> command, so fallback to use the legacy version here.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
>>  drivers/scsi/hpsa.c | 28 ++++++++++++++++++++++++++--
>>  1 file changed, 26 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
>> index 488e17c..3d89f74 100644
>> --- a/drivers/scsi/hpsa.c
>> +++ b/drivers/scsi/hpsa.c
>> @@ -3628,8 +3628,32 @@ static int hpsa_scsi_do_report_luns(struct
>> ctlr_info *h, int logical,
>>  static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
>>                 struct ReportExtendedLUNdata *buf, int bufsize)
>>  {
>> -       return hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
>> -                                               HPSA_REPORT_PHYS_EXTENDED);
>> +       int rc;
>> +       struct ReportLUNdata *lbuf;
>> +
>> +       rc = hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
>> +                                     HPSA_REPORT_PHYS_EXTENDED);
>> +       if (!rc || !hpsa_allow_any)
>> +               return rc;
>> +
>> +       /* REPORT PHYS EXTENDED is not supported */
>> +       lbuf = kzalloc(sizeof(*lbuf), GFP_KERNEL);
>> +       if (!lbuf)
>> +               return -ENOMEM;
>> +
>> +       rc = hpsa_scsi_do_report_luns(h, 0, lbuf, sizeof(*lbuf), 0);
>> +       if (!rc) {
>> +               int i;
>> +               u32 nphys;
>> +
>> +               /* Copy ReportLUNdata header */
>> +               memcpy(buf, lbuf, 8);
>> +               nphys = be32_to_cpu(*((__be32 *)lbuf->LUNListLength)) / 24;
>> +               for (i = 0; i < nphys; i++)
>> +                       memcpy(buf->LUN[i].lunid, lbuf->LUN[i], 8);
>> +       }
>> +       kfree(lbuf);
>> +       return rc;
>>  }
>>
>>  static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
>> --
>> 1.8.5.6
>
> For a non-extended REPORT_PHYS, the buffer size is 8, so the divisor needs to be 8.
> REPORT_PHYS_EXTENDED has been around a long time, which controller and fw are you testing this on so I can
> Also run some tests.
>
That was seen on an Smart Array 64xx.
Yes, I know, horribly ancient.

But this was sort-of the idea, namely that we can use 'hpsa' as a 
complete replacement for cciss.

I'll be fixing up the patch and resubmit it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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

end of thread, other threads:[~2016-12-02 10:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18  7:32 [PATCH 0/3] hpsa compatility fixes Hannes Reinecke
2016-11-18  7:32 ` [PATCH 1/3] hpsa: use correct DID_NO_CONNECT hostbyte Hannes Reinecke
2016-11-29  2:02   ` Don Brace
2016-11-18  7:32 ` [PATCH 2/3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
2016-11-22 13:21   ` Martin Wilck
2016-11-29 16:10   ` Martin K. Petersen
2016-12-01 21:50   ` Don Brace
2016-12-02 10:23     ` Hannes Reinecke
2016-11-18  7:32 ` [PATCH 3/3] hpsa: add 'ctlr_num' sysfs attribute Hannes Reinecke
2016-11-29  2:03   ` Don Brace
2016-11-29 16:11 ` [PATCH 0/3] hpsa compatility fixes Martin K. Petersen

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.