Skip to contentSkip to conversation

hpsa updates

PATCH Applied Don Brace 3 participants 16 messages Feb 23, 2016 – Feb 24, 2016

Subsystems (2)
lore
Share & tools
lore

Don Brace

author
#0 lore raw

cover hpsa updates

These patches are based on Linus's tree

The changes are:
- stop requesting enclosure info for external devices
- add in SMR support
- correct lun data caching macro definition
- add abort support for hba devices
- check for null pointer in ioaccel2 path
- remove definition for sanitize_inquiry_string This patch depends on
- commit ac10a3e4ed64
("Export function scsi_scan.c:sanitize_inquiry_string")
- update copyright information
---

Don Brace (7):
hpsa: do not get enclosure info for external devices
hpsa: add SMR drive support
hpsa: correct lun data caching bitmap definition
hpsa: correct abort tmf for hba devices
hpsa: check for a null phys_disk pointer in ioaccel2 path
hpsa: remove function definition for sanitize_inquiry_string
hpsa: update copyright information

 drivers/scsi/hpsa.c     |   52 +++++++++++++++++++++++++----------------------
 drivers/scsi/hpsa.h     |    3 ++-
 drivers/scsi/hpsa_cmd.h |    5 +++--
 3 files changed, 33 insertions(+), 27 deletions(-)

--
Signature

author
#1 lore raw

PATCH 1/7 hpsa: do not get enclosure info for external devices

Stop annoying "Error, could not get enclosure information" messages.

---
 drivers/scsi/hpsa.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/hpsa.c +5 -2
index 38ce0e3..098e8de 100644
@@ -3208,8 +3208,10 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h,
 
 	bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]);
 
-	if (bmic_device_index == 0xFF00)
+	if (bmic_device_index == 0xFF00 || MASKED_DEVICE(&rle->lunid[0])) {
+		rc = IO_OK;
 		goto out;
+	}
 
 	bssbp = kzalloc(sizeof(*bssbp), GFP_KERNEL);
 	if (!bssbp)
@@ -4197,7 +4199,8 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 			ncurrent++;
 			break;
 		case TYPE_ENCLOSURE:
-			hpsa_get_enclosure_info(h, lunaddrbytes,
+			if (!this_device->external)
+				hpsa_get_enclosure_info(h, lunaddrbytes,
 						physdev_list, phys_dev_index,
 						this_device);
 			ncurrent++;
author
#3 lore raw

PATCH 2/7 hpsa: add SMR drive support

In reply to Don Brace
---
 drivers/scsi/hpsa.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/scsi/hpsa.c +10 -2
index 098e8de..671ad57 100644
@@ -809,7 +809,8 @@ static ssize_t path_info_show(struct device *dev,
 				PAGE_SIZE - output_len,
 				"PORT: %.2s ",
 				phys_connector);
-		if (hdev->devtype == TYPE_DISK && hdev->expose_device) {
+		if ((hdev->devtype == TYPE_DISK || hdev->devtype == TYPE_ZBC) &&
+			hdev->expose_device) {
 			if (box == 0 || box == 0xFF) {
 				output_len += scnprintf(buf + output_len,
 					PAGE_SIZE - output_len,
@@ -1166,6 +1167,7 @@ static void hpsa_show_dev_msg(const char *level, struct ctlr_info *h,
 		snprintf(label, LABEL_SIZE, "enclosure");
 		break;
 	case TYPE_DISK:
+	case TYPE_ZBC:
 		if (dev->external)
 			snprintf(label, LABEL_SIZE, "external");
 		else if (!is_logical_dev_addr_mode(dev->scsi3addr))
@@ -1636,6 +1638,8 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
 				continue;
 			if (dev[j]->devtype != TYPE_DISK)
 				continue;
+			if (dev[j]->devtype != TYPE_ZBC)
+				continue;
 			if (is_logical_device(dev[j]))
 				continue;
 			if (dev[j]->ioaccel_handle != dd[i].ioaccel_handle)
@@ -1681,6 +1685,8 @@ static void hpsa_update_log_drive_phys_drive_ptrs(struct ctlr_info *h,
 			continue;
 		if (dev[i]->devtype != TYPE_DISK)
 			continue;
+		if (dev[i]->devtype != TYPE_ZBC)
+			continue;
 		if (!is_logical_device(dev[i]))
 			continue;
 
@@ -3715,7 +3721,8 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 	hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
 		sizeof(this_device->device_id));
 
-	if (this_device->devtype == TYPE_DISK &&
+	if ((this_device->devtype == TYPE_DISK ||
+		this_device->devtype == TYPE_ZBC) &&
 		is_logical_dev_addr_mode(scsi3addr)) {
 		int volume_offline;
 
@@ -4183,6 +4190,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 				ncurrent++;
 			break;
 		case TYPE_DISK:
+		case TYPE_ZBC:
 			if (this_device->physical_device) {
 				/* The disk is in HBA mode. */
 				/* Never use RAID mapper in HBA mode. */
author
#5 lore raw

PATCH 3/7 hpsa: correct lun data caching bitmap definition

In reply to Don Brace

The bitmap was changed after this definition was added to the driver. Correcting the bitmap definition.

---
 drivers/scsi/hpsa_cmd.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/hpsa_cmd.h +1 -1
index 6a919ad..dffda96 100644
@@ -289,7 +289,7 @@ struct SenseSubsystem_info {
 #define BMIC_IDENTIFY_CONTROLLER 0x11
 #define BMIC_SET_DIAG_OPTIONS 0xF4
 #define BMIC_SENSE_DIAG_OPTIONS 0xF5
-#define HPSA_DIAG_OPTS_DISABLE_RLD_CACHING 0x40000000
+#define HPSA_DIAG_OPTS_DISABLE_RLD_CACHING 0x80000000
 #define BMIC_SENSE_SUBSYSTEM_INFORMATION 0x66
 #define BMIC_SENSE_STORAGE_BOX_PARAMS 0x65
 
author
#7 lore raw

PATCH 4/7 hpsa: correct abort tmf for hba devices

In reply to Don Brace

Aborts were not being sent down to HBA devices

---
 drivers/scsi/hpsa.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/hpsa.c +7 -5
index 671ad57..589b44e 100644
@@ -5846,7 +5846,7 @@ static int hpsa_send_abort_ioaccel2(struct ctlr_info *h,
 }
 
 static int hpsa_send_abort_both_ways(struct ctlr_info *h,
-	unsigned char *scsi3addr, struct CommandList *abort, int reply_queue)
+	struct hpsa_scsi_dev_t *dev, struct CommandList *abort, int reply_queue)
 {
 	/*
 	 * ioccelerator mode 2 commands should be aborted via the
@@ -5855,14 +5855,16 @@ static int hpsa_send_abort_both_ways(struct ctlr_info *h,
 	 * Change abort to physical device reset when abort TMF is unsupported.
 	 */
 	if (abort->cmd_type == CMD_IOACCEL2) {
-		if (HPSATMF_IOACCEL_ENABLED & h->TMFSupportFlags)
+		if ((HPSATMF_IOACCEL_ENABLED & h->TMFSupportFlags) ||
+			dev->physical_device)
 			return hpsa_send_abort_ioaccel2(h, abort,
 						reply_queue);
 		else
-			return hpsa_send_reset_as_abort_ioaccel2(h, scsi3addr,
+			return hpsa_send_reset_as_abort_ioaccel2(h,
+							dev->scsi3addr,
 							abort, reply_queue);
 	}
-	return hpsa_send_abort(h, scsi3addr, abort, reply_queue);
+	return hpsa_send_abort(h, dev->scsi3addr, abort, reply_queue);
 }
 
 /* Find out which reply queue a command was meant to return on */
@@ -6000,7 +6002,7 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc)
 		cmd_free(h, abort);
 		return FAILED;
 	}
-	rc = hpsa_send_abort_both_ways(h, dev->scsi3addr, abort, reply_queue);
+	rc = hpsa_send_abort_both_ways(h, dev, abort, reply_queue);
 	atomic_inc(&h->abort_cmds_available);
 	wake_up_all(&h->abort_cmd_wait_queue);
 	if (rc != 0) {
author
#9 lore raw

PATCH 5/7 hpsa: check for a null phys_disk pointer in ioaccel2 path

In reply to Don Brace

An oops can occur when submitting ioaccel2 commands
when the phys_disk pointer is NULL in hpsa_scsi_ioaccel_raid_map. Happens when there are configuration changes during I/O operations.

If the phys_disk pointer is NULL, send the command down the RAID path.

---
 drivers/scsi/hpsa.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/hpsa.c +2 -0
index 589b44e..edbecf8 100644
@@ -4981,6 +4981,8 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
 		return IO_ACCEL_INELIGIBLE;
 
 	c->phys_disk = dev->phys_disk[map_index];
+	if (!c->phys_disk)
+		return IO_ACCEL_INELIGIBLE;
 
 	disk_handle = dd[map_index].ioaccel_handle;
 	disk_block = le64_to_cpu(map->disk_starting_blk) +
author
#11 lore raw

PATCH 6/7 hpsa: remove function definition for sanitize_inquiry_string

In reply to Don Brace

This patch depends on patch
- commit ac10a3e4ed64
("Export function scsi_scan.c:sanitize_inquiry_string")

---
 drivers/scsi/hpsa.c |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
drivers/scsi/hpsa.c +2 -14
index edbecf8..725eb8d 100644
@@ -3665,18 +3665,6 @@ static int hpsa_device_supports_aborts(struct ctlr_info *h,
 	return rc;
 }
 
-static void sanitize_inquiry_string(unsigned char *s, int len)
-{
-	bool terminated = false;
-
-	for (; len > 0; (--len, ++s)) {
-		if (*s == 0)
-			terminated = true;
-		if (terminated || *s < 0x20 || *s > 0x7e)
-			*s = ' ';
-	}
-}
-
 static int hpsa_update_device_info(struct ctlr_info *h,
 	unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device,
 	unsigned char *is_OBDR_device)
@@ -3707,8 +3695,8 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 		goto bail_out;
 	}
 
-	sanitize_inquiry_string(&inq_buff[8], 8);
-	sanitize_inquiry_string(&inq_buff[16], 16);
+	scsi_sanitize_inquiry_string(&inq_buff[8], 8);
+	scsi_sanitize_inquiry_string(&inq_buff[16], 16);
 
 	this_device->devtype = (inq_buff[0] & 0x1f);
 	memcpy(this_device->scsi3addr, scsi3addr, 8);
author
#13 lore raw

PATCH 7/7 hpsa: update copyright information

In reply to Don Brace
---
 drivers/scsi/hpsa.c     |    3 ++-
 drivers/scsi/hpsa.h     |    3 ++-
 drivers/scsi/hpsa_cmd.h |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/scsi/hpsa.c +2 -1
index 725eb8d..5be944c 100644
@@ -1,5 +1,6 @@
 /*
  *    Disk Array driver for HP Smart Array SAS controllers
+ *    Copyright 2016 Microsemi Corporation
  *    Copyright 2014-2015 PMC-Sierra, Inc.
  *    Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
  *
@@ -12,7 +13,7 @@
  *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  *    NON INFRINGEMENT.  See the GNU General Public License for more details.
  *
- *    Questions/Comments/Bugfixes to [email protected]
+ *    Questions/Comments/Bugfixes to [email protected]
  *
  */
 
drivers/scsi/hpsa.h +2 -1
index fdd39fc..d06bb74 100644
@@ -1,5 +1,6 @@
 /*
  *    Disk Array driver for HP Smart Array SAS controllers
+ *    Copyright 2016 Microsemi Corporation
  *    Copyright 2014-2015 PMC-Sierra, Inc.
  *    Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
  *
@@ -12,7 +13,7 @@
  *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  *    NON INFRINGEMENT.  See the GNU General Public License for more details.
  *
- *    Questions/Comments/Bugfixes to [email protected]
+ *    Questions/Comments/Bugfixes to [email protected]
  *
  */
 #ifndef HPSA_H
drivers/scsi/hpsa_cmd.h +2 -1
index dffda96..a5be153 100644
@@ -1,5 +1,6 @@
 /*
  *    Disk Array driver for HP Smart Array SAS controllers
+ *    Copyright 2016 Microsemi Corporation
  *    Copyright 2014-2015 PMC-Sierra, Inc.
  *    Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
  *
@@ -12,7 +13,7 @@
  *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  *    NON INFRINGEMENT.  See the GNU General Public License for more details.
  *
- *    Questions/Comments/Bugfixes to [email protected]
+ *    Questions/Comments/Bugfixes to [email protected]
  *
  */
 #ifndef HPSA_CMD_H
#15 lore raw
In reply to Don Brace
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Don" == Don Brace <[email protected]> writes:

Don> These patches are based on Linus's tree The changes are: - stop Don> requesting enclosure info for external devices - add in SMR support Don> - correct lun data caching macro definition - add abort support for Don> hba devices - check for null pointer in ioaccel2 path - remove Don> definition for sanitize_inquiry_string This patch depends on - Don> commit ac10a3e4ed64 ("Export function
Don> scsi_scan.c:sanitize_inquiry_string") - update copyright Don> information ---

Applied to 4.6/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering