* [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
@ 2016-12-02 10:36 Hannes Reinecke
2016-12-03 0:36 ` Don Brace
2016-12-05 22:14 ` Martin K. Petersen
0 siblings, 2 replies; 4+ messages in thread
From: Hannes Reinecke @ 2016-12-02 10:36 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Christoph Hellwig, James Bottomley, Don Brace, linux-scsi,
Hannes Reinecke, Hannes Reinecke
Older SmartArray controllers (eg SmartArray 64xx) 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 216c137..3783ef6 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3640,8 +3640,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)) / 8;
+ 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] 4+ messages in thread
* RE: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
2016-12-02 10:36 [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
@ 2016-12-03 0:36 ` Don Brace
2016-12-03 8:00 ` Hannes Reinecke
2016-12-05 22:14 ` Martin K. Petersen
1 sibling, 1 reply; 4+ messages in thread
From: Don Brace @ 2016-12-03 0:36 UTC (permalink / raw)
To: Hannes Reinecke, Martin K. Petersen
Cc: Christoph Hellwig, James Bottomley, linux-scsi, Hannes Reinecke
> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@suse.de]
> Sent: Friday, December 02, 2016 4:36 AM
> To: Martin K. Petersen
> Cc: Christoph Hellwig; James Bottomley; Don Brace; linux-
> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
> Subject: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
>
> EXTERNAL EMAIL
>
>
> Older SmartArray controllers (eg SmartArray 64xx) 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 216c137..3783ef6 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -3640,8 +3640,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)) / 8;
> + 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
Acked-by: Don Brace <don.brace@microsemi.com>
Note: there has been zero testing on our end of these ancient controllers with the hpsa driver.
While it might work there is no official support from either us or HPE on this configuration.
Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
2016-12-03 0:36 ` Don Brace
@ 2016-12-03 8:00 ` Hannes Reinecke
0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2016-12-03 8:00 UTC (permalink / raw)
To: Don Brace, Martin K. Petersen
Cc: Christoph Hellwig, James Bottomley, linux-scsi, Hannes Reinecke
On 12/03/2016 01:36 AM, Don Brace wrote:
>> -----Original Message-----
>> From: Hannes Reinecke [mailto:hare@suse.de]
>> Sent: Friday, December 02, 2016 4:36 AM
>> To: Martin K. Petersen
>> Cc: Christoph Hellwig; James Bottomley; Don Brace; linux-
>> scsi@vger.kernel.org; Hannes Reinecke; Hannes Reinecke
>> Subject: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
>>
>> EXTERNAL EMAIL
>>
>>
>> Older SmartArray controllers (eg SmartArray 64xx) 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 216c137..3783ef6 100644
>> --- a/drivers/scsi/hpsa.c
>> +++ b/drivers/scsi/hpsa.c
>> @@ -3640,8 +3640,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)) / 8;
>> + 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
>
> Acked-by: Don Brace <don.brace@microsemi.com>
>
> Note: there has been zero testing on our end of these ancient controllers with the hpsa driver.
> While it might work there is no official support from either us or HPE on this configuration.
>
Understood. Additionally this will only ever be used if the
'hpsa_allow_any' parameter is set, which already should be a hint to the
user that he's about to enter unchartered territory.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command
2016-12-02 10:36 [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
2016-12-03 0:36 ` Don Brace
@ 2016-12-05 22:14 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-12-05 22:14 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
Don Brace, linux-scsi, Hannes Reinecke
>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:
Hannes> Older SmartArray controllers (eg SmartArray 64xx) do not support
Hannes> the extended REPORT PHYS command, so fallback to use the legacy
Hannes> version here.
Applied to 4.10/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-05 22:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02 10:36 [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command Hannes Reinecke
2016-12-03 0:36 ` Don Brace
2016-12-03 8:00 ` Hannes Reinecke
2016-12-05 22:14 ` 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.