linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/4] hpsa updates
@ 2020-07-27 19:58 Don Brace
  2020-07-27 19:58 ` [PATCH V3 1/4] hpsa: correct rare oob condition Don Brace
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Don Brace @ 2020-07-27 19:58 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

These patches are based on Linus's tree

The changes are:
hpsa-correct-rare-oob-condition
 - Rare condition where a spare is first in
   PHYS LUN list.
hpsa-increase-qd-for-external-luns
 - Improve performance for PTRAID devices
   - Such as MSA devices.
hpsa-increase-ctlr-eh-timeout
 - Increase timeout for commands issued to
   controller device.
 - Improve multipath failover handling.
hpsa-bump-version

Changes since V1:
 - corrected uninitialized variable issue in
   hpsa-slave-destroy in patch:
        hpsa-increase-ctlr-eh-timeout
   Reported by: Dan Carpenter <dan.carpenter@oracle.com>
   Reported by: Joseph Szczypek <jszczype@redhat.com>

Changes since V2:
 - Forgot to add the version number to the
   patches.

---

Don Brace (4):
      hpsa: correct rare oob condition
      hpsa: increase qd for external luns
      hpsa: increase ctlr eh timeout
      hpsa: bump version


 drivers/scsi/hpsa.c | 15 ++++++++++-----
 drivers/scsi/hpsa.h |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)

--
Signature

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

* [PATCH V3 1/4] hpsa: correct rare oob condition
  2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
@ 2020-07-27 19:58 ` Don Brace
  2020-07-27 19:58 ` [PATCH V3 2/4] hpsa: increase qd for external luns Don Brace
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Don Brace @ 2020-07-27 19:58 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

There are some rare conditions where a spare
is first in the device list causing an array
out-of-bounds condition.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/hpsa.c |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 81d0414e2117..9b1edc541ed0 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3443,9 +3443,14 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h,
 	struct ErrorInfo *ei = NULL;
 	struct bmic_sense_storage_box_params *bssbp = NULL;
 	struct bmic_identify_physical_device *id_phys = NULL;
-	struct ext_report_lun_entry *rle = &rlep->LUN[rle_index];
+	struct ext_report_lun_entry *rle;
 	u16 bmic_device_index = 0;
 
+	if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
+		return;
+
+	rle = &rlep->LUN[rle_index];
+
 	encl_dev->eli =
 		hpsa_get_enclosure_logical_identifier(h, scsi3addr);
 
@@ -4174,6 +4179,9 @@ static void hpsa_get_ioaccel_drive_info(struct ctlr_info *h,
 	int rc;
 	struct ext_report_lun_entry *rle;
 
+	if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
+		return;
+
 	rle = &rlep->LUN[rle_index];
 
 	dev->ioaccel_handle = rle->ioaccel_handle;
@@ -4198,7 +4206,12 @@ static void hpsa_get_path_info(struct hpsa_scsi_dev_t *this_device,
 	struct ReportExtendedLUNdata *rlep, int rle_index,
 	struct bmic_identify_physical_device *id_phys)
 {
-	struct ext_report_lun_entry *rle = &rlep->LUN[rle_index];
+	struct ext_report_lun_entry *rle;
+
+	if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
+		return;
+
+	rle = &rlep->LUN[rle_index];
 
 	if ((rle->device_flags & 0x08) && this_device->ioaccel_handle)
 		this_device->hba_ioaccel_enabled = 1;
@@ -4420,7 +4433,8 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 		/*
 		 * Skip over some devices such as a spare.
 		 */
-		if (!tmpdevice->external && physical_device) {
+		if (phys_dev_index >= 0 && !tmpdevice->external &&
+			physical_device) {
 			skip_device = hpsa_skip_device(h, lunaddrbytes,
 					&physdev_list->LUN[phys_dev_index]);
 			if (skip_device)


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

* [PATCH V3 2/4] hpsa: increase qd for external luns
  2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
  2020-07-27 19:58 ` [PATCH V3 1/4] hpsa: correct rare oob condition Don Brace
@ 2020-07-27 19:58 ` Don Brace
  2020-07-27 19:58 ` [PATCH V3 3/4] hpsa: increase ctlr eh timeout Don Brace
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Don Brace @ 2020-07-27 19:58 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

- increase queue_depth for PTRAID devices
   - improves performance.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/hpsa.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index f8c88fc7b80a..6b87d9815b35 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -57,7 +57,7 @@ struct hpsa_sas_phy {
 	bool added_to_port;
 };
 
-#define EXTERNAL_QD 7
+#define EXTERNAL_QD 128
 struct hpsa_scsi_dev_t {
 	unsigned int devtype;
 	int bus, target, lun;		/* as presented to the OS */


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

* [PATCH V3 3/4] hpsa: increase ctlr eh timeout
  2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
  2020-07-27 19:58 ` [PATCH V3 1/4] hpsa: correct rare oob condition Don Brace
  2020-07-27 19:58 ` [PATCH V3 2/4] hpsa: increase qd for external luns Don Brace
@ 2020-07-27 19:58 ` Don Brace
  2020-07-27 19:58 ` [PATCH V3 4/4] hpsa: bump version Don Brace
  2020-07-29  2:54 ` [PATCH V3 0/4] hpsa updates Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Don Brace @ 2020-07-27 19:58 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

Increase the timeout value for commands sent to
the controller device.

- controller can become slow to respond to INQUIRIES
  resulting in the SML off-lining the controller
  device.
- when large RAID volumes are created along with
  I/O stress, the controller can be slow to respond
  to INQUIRIES.
  - set/sense config along with device resets
    can delay controller responses.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/hpsa.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 9b1edc541ed0..9286e60b8cc4 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2134,6 +2134,7 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
 }
 
 /* configure scsi device based on internal per-device structure */
+#define CTLR_TIMEOUT (120 * HZ)
 static int hpsa_slave_configure(struct scsi_device *sdev)
 {
 	struct hpsa_scsi_dev_t *sd;
@@ -2144,17 +2145,21 @@ static int hpsa_slave_configure(struct scsi_device *sdev)
 
 	if (sd) {
 		sd->was_removed = 0;
+		queue_depth = sd->queue_depth != 0 ?
+				sd->queue_depth : sdev->host->can_queue;
 		if (sd->external) {
 			queue_depth = EXTERNAL_QD;
 			sdev->eh_timeout = HPSA_EH_PTRAID_TIMEOUT;
 			blk_queue_rq_timeout(sdev->request_queue,
 						HPSA_EH_PTRAID_TIMEOUT);
-		} else {
-			queue_depth = sd->queue_depth != 0 ?
-					sd->queue_depth : sdev->host->can_queue;
 		}
-	} else
+		if (is_hba_lunid(sd->scsi3addr)) {
+			sdev->eh_timeout = CTLR_TIMEOUT;
+			blk_queue_rq_timeout(sdev->request_queue, CTLR_TIMEOUT);
+		}
+	} else {
 		queue_depth = sdev->host->can_queue;
+	}
 
 	scsi_change_queue_depth(sdev, queue_depth);
 


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

* [PATCH V3 4/4] hpsa: bump version
  2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
                   ` (2 preceding siblings ...)
  2020-07-27 19:58 ` [PATCH V3 3/4] hpsa: increase ctlr eh timeout Don Brace
@ 2020-07-27 19:58 ` Don Brace
  2020-07-29  2:54 ` [PATCH V3 0/4] hpsa updates Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Don Brace @ 2020-07-27 19:58 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

Reviewed-off-by: Gerry Morong <gerry.morong@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.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 9286e60b8cc4..91794a50b31f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -59,7 +59,7 @@
  * HPSA_DRIVER_VERSION must be 3 byte values (0-255) separated by '.'
  * with an optional trailing '-' followed by a byte value (0-255).
  */
-#define HPSA_DRIVER_VERSION "3.4.20-170"
+#define HPSA_DRIVER_VERSION "3.4.20-200"
 #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")"
 #define HPSA "hpsa"
 


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

* Re: [PATCH V3 0/4] hpsa updates
  2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
                   ` (3 preceding siblings ...)
  2020-07-27 19:58 ` [PATCH V3 4/4] hpsa: bump version Don Brace
@ 2020-07-29  2:54 ` Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-07-29  2:54 UTC (permalink / raw)
  To: Don Brace
  Cc: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD, linux-scsi


Don,

> These patches are based on Linus's tree

... and therefore they don't apply. Mainly because I already merged an
earlier version of these.

 - Always submit your patches against my queue branch

 - If there are changes in v3 compared to what I have already merged,
   please submit incremental patches

 - Please work on your commit messages. See section 2 in
   Documentation/process/submitting-patches.rst.

Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-07-29  2:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 19:58 [PATCH V3 0/4] hpsa updates Don Brace
2020-07-27 19:58 ` [PATCH V3 1/4] hpsa: correct rare oob condition Don Brace
2020-07-27 19:58 ` [PATCH V3 2/4] hpsa: increase qd for external luns Don Brace
2020-07-27 19:58 ` [PATCH V3 3/4] hpsa: increase ctlr eh timeout Don Brace
2020-07-27 19:58 ` [PATCH V3 4/4] hpsa: bump version Don Brace
2020-07-29  2:54 ` [PATCH V3 0/4] hpsa updates Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).