linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hpsa updates
@ 2020-07-20 21:52 Don Brace
  2020-07-20 21:52 ` [PATCH 1/4] hpsa: correct rare oob condition Don Brace
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Don Brace @ 2020-07-20 21:52 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

---

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 | 6 +++++-
 drivers/scsi/hpsa.h | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

--
Signature

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

* [PATCH 1/4] hpsa: correct rare oob condition
  2020-07-20 21:52 [PATCH 0/4] hpsa updates Don Brace
@ 2020-07-20 21:52 ` Don Brace
  2020-07-20 21:52 ` [PATCH 2/4] hpsa: increase qd for external luns Don Brace
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Don Brace @ 2020-07-20 21:52 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] 7+ messages in thread

* [PATCH 2/4] hpsa: increase qd for external luns
  2020-07-20 21:52 [PATCH 0/4] hpsa updates Don Brace
  2020-07-20 21:52 ` [PATCH 1/4] hpsa: correct rare oob condition Don Brace
@ 2020-07-20 21:52 ` Don Brace
  2020-07-20 21:53 ` [PATCH 3/4] hpsa: increase ctlr eh timeout Don Brace
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Don Brace @ 2020-07-20 21:52 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] 7+ messages in thread

* [PATCH 3/4] hpsa: increase ctlr eh timeout
  2020-07-20 21:52 [PATCH 0/4] hpsa updates Don Brace
  2020-07-20 21:52 ` [PATCH 1/4] hpsa: correct rare oob condition Don Brace
  2020-07-20 21:52 ` [PATCH 2/4] hpsa: increase qd for external luns Don Brace
@ 2020-07-20 21:53 ` Don Brace
  2020-07-20 21:53 ` [PATCH 4/4] hpsa: bump version Don Brace
  2020-07-21  3:51 ` [PATCH 0/4] hpsa updates Martin K. Petersen
  4 siblings, 0 replies; 7+ messages in thread
From: Don Brace @ 2020-07-20 21:53 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 |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 9b1edc541ed0..bd96bb6d0e0a 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;
@@ -2149,6 +2150,9 @@ static int hpsa_slave_configure(struct scsi_device *sdev)
 			sdev->eh_timeout = HPSA_EH_PTRAID_TIMEOUT;
 			blk_queue_rq_timeout(sdev->request_queue,
 						HPSA_EH_PTRAID_TIMEOUT);
+		} else if (is_hba_lunid(sd->scsi3addr)) {
+			sdev->eh_timeout = CTLR_TIMEOUT;
+			blk_queue_rq_timeout(sdev->request_queue, CTLR_TIMEOUT);
 		} else {
 			queue_depth = sd->queue_depth != 0 ?
 					sd->queue_depth : sdev->host->can_queue;


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

* [PATCH 4/4] hpsa: bump version
  2020-07-20 21:52 [PATCH 0/4] hpsa updates Don Brace
                   ` (2 preceding siblings ...)
  2020-07-20 21:53 ` [PATCH 3/4] hpsa: increase ctlr eh timeout Don Brace
@ 2020-07-20 21:53 ` Don Brace
  2020-07-21  3:51 ` [PATCH 0/4] hpsa updates Martin K. Petersen
  4 siblings, 0 replies; 7+ messages in thread
From: Don Brace @ 2020-07-20 21:53 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 bd96bb6d0e0a..90c36d75bf92 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] 7+ messages in thread

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

On Mon, 20 Jul 2020 16:52:46 -0500, Don Brace wrote:

> 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

Applied to 5.9/scsi-queue, thanks!

[1/4] scsi: hpsa: Correct rare oob condition
      https://git.kernel.org/mkp/scsi/c/a1cc279c246a
[2/4] scsi: hpsa: Increase queue depth for external LUNs
      https://git.kernel.org/mkp/scsi/c/3fcb972bc1d7
[3/4] scsi: hpsa: Increase controller error handling timeout
      https://git.kernel.org/mkp/scsi/c/c73deaf3b001
[4/4] scsi: hpsa: Bump version
      https://git.kernel.org/mkp/scsi/c/afea24189508

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* [PATCH 1/4] hpsa: correct rare oob condition
  2020-07-27 19:01 [PATCH V2 " Don Brace
@ 2020-07-27 19:01 ` Don Brace
  0 siblings, 0 replies; 7+ messages in thread
From: Don Brace @ 2020-07-27 19:01 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] 7+ messages in thread

end of thread, other threads:[~2020-07-27 19:01 UTC | newest]

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

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).