* [PATCH 1/4] hpsa: correct rare oob condition
2020-07-27 19:01 [PATCH V2 0/4] hpsa updates Don Brace
@ 2020-07-27 19:01 ` Don Brace
2020-07-27 19:01 ` [PATCH 2/4] hpsa: increase qd for external luns Don Brace
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [PATCH 2/4] hpsa: increase qd for external luns
2020-07-27 19:01 [PATCH V2 0/4] hpsa updates Don Brace
2020-07-27 19:01 ` [PATCH 1/4] hpsa: correct rare oob condition Don Brace
@ 2020-07-27 19:01 ` Don Brace
2020-07-27 19:01 ` [PATCH 3/4] hpsa: increase ctlr eh timeout Don Brace
2020-07-27 19:01 ` [PATCH 4/4] hpsa: bump version Don Brace
3 siblings, 0 replies; 6+ 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
- 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 3/4] hpsa: increase ctlr eh timeout
2020-07-27 19:01 [PATCH V2 0/4] hpsa updates Don Brace
2020-07-27 19:01 ` [PATCH 1/4] hpsa: correct rare oob condition Don Brace
2020-07-27 19:01 ` [PATCH 2/4] hpsa: increase qd for external luns Don Brace
@ 2020-07-27 19:01 ` Don Brace
2020-07-27 19:01 ` [PATCH 4/4] hpsa: bump version Don Brace
3 siblings, 0 replies; 6+ 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
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 4/4] hpsa: bump version
2020-07-27 19:01 [PATCH V2 0/4] hpsa updates Don Brace
` (2 preceding siblings ...)
2020-07-27 19:01 ` [PATCH 3/4] hpsa: increase ctlr eh timeout Don Brace
@ 2020-07-27 19:01 ` Don Brace
3 siblings, 0 replies; 6+ 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
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