Re: [PATCH 5/6] hpsa: do not print errors for unsupported report luns format

2017-08-09 Thread Hannes Reinecke
On 08/09/2017 03:46 PM, Christoph Hellwig wrote:
> I don't like the misnamed supported flag.  Either we should always ignore
> the errors, or key it off a specific flag for newer firmware.
> 
Well, there is no such hardware flag; there are several features
implemented across the board. Hence we need to store it in the driver
structure, which actually is the reason for the 'supported' flag.

I can rename it to 'legacy_board' or the like if 'supported' is not an
acceptable naming ...

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@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)


Re: [PATCH 5/6] hpsa: do not print errors for unsupported report luns format

2017-08-09 Thread Christoph Hellwig
I don't like the misnamed supported flag.  Either we should always ignore
the errors, or key it off a specific flag for newer firmware.


[PATCH 5/6] hpsa: do not print errors for unsupported report luns format

2017-08-08 Thread Hannes Reinecke
Older/Unsupported controllers might not support the 'extended'
report luns format, but as they are unsupported we don't need
to print out an error here.

Signed-off-by: Hannes Reinecke 
---
 drivers/scsi/hpsa.c | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index dbd5fbc..790958f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3588,7 +3588,7 @@ static int hpsa_scsi_do_report_luns(struct ctlr_info *h, 
int logical,
memset(scsi3addr, 0, sizeof(scsi3addr));
if (fill_cmd(c, logical ? HPSA_REPORT_LOG : HPSA_REPORT_PHYS, h,
buf, bufsize, 0, scsi3addr, TYPE_CMD)) {
-   rc = -1;
+   rc = -EAGAIN;
goto out;
}
if (extended_response)
@@ -3601,16 +3601,17 @@ static int hpsa_scsi_do_report_luns(struct ctlr_info 
*h, int logical,
if (ei->CommandStatus != 0 &&
ei->CommandStatus != CMD_DATA_UNDERRUN) {
hpsa_scsi_interpret_error(h, c);
-   rc = -1;
+   rc = -EIO;
} else {
struct ReportLUNdata *rld = buf;
 
if (rld->extended_response_flag != extended_response) {
-   dev_err(>pdev->dev,
-   "report luns requested format %u, got %u\n",
-   extended_response,
-   rld->extended_response_flag);
-   rc = -1;
+   if (h->supported)
+   dev_err(>pdev->dev,
+   "report luns requested format %u, got 
%u\n",
+   extended_response,
+   rld->extended_response_flag);
+   rc = -EOPNOTSUPP;
}
}
 out:
@@ -3626,7 +3627,10 @@ static inline int hpsa_scsi_do_report_phys_luns(struct 
ctlr_info *h,
 
rc = hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
  HPSA_REPORT_PHYS_EXTENDED);
-   if (!rc || !hpsa_allow_any)
+   if (rc == -EOPNOTSUPP) {
+   if (h->supported)
+   return rc;
+   } else if (rc < 0)
return rc;
 
/* REPORT PHYS EXTENDED is not supported */
@@ -6605,7 +6609,6 @@ static int fill_cmd(struct CommandList *c, u8 cmd, struct 
ctlr_info *h,
default:
dev_warn(>pdev->dev, "unknown command 0x%c\n", cmd);
BUG();
-   return -1;
}
} else if (cmd_type == TYPE_MSG) {
switch (cmd) {
-- 
1.8.5.6