From patchwork Mon Jul 20 21:52:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11674581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B84CC6C1 for ; Mon, 20 Jul 2020 21:52:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8D0422B4E for ; Mon, 20 Jul 2020 21:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbgGTVwx (ORCPT ); Mon, 20 Jul 2020 17:52:53 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:52323 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgGTVwx (ORCPT ); Mon, 20 Jul 2020 17:52:53 -0400 IronPort-SDR: 70AXjcBYHQBA3ZMOneKpD5xjkpa2fOyS9iSTsvNvXZwv5b2h25IkkmSwVf/rLdOzFLYtRm4SL/ m3wZgLO8wACHXbmSFNIVFxbzRQ6ZHA3tbFRC16hEeLyDwFmApJaHM3F9owvhSdm3YQ9l3RIt5+ oPK2S45Z6XWNJTA+RvF+EHfCLlU1xV77ojo8y7/IZvYr/toe0/Jufl+MhJWvJv/9O5e/ViiJYx +ixUlX/PuPyee70L/4QxVeUkD88Cp2pnlM2MaqmfN31WWk0v06+uQnGimi34I0228ZoQGoureK rtQ= X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="88394290" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2020 14:52:52 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 20 Jul 2020 14:52:52 -0700 Received: from [127.0.1.1] (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 20 Jul 2020 14:52:12 -0700 Subject: [PATCH 1/4] hpsa: correct rare oob condition From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 20 Jul 2020 16:52:51 -0500 Message-ID: <159528197176.24772.14659026352708896249.stgit@brunhilda> In-Reply-To: <159528193513.24772.2142294136346611232.stgit@brunhilda> References: <159528193513.24772.2142294136346611232.stgit@brunhilda> User-Agent: StGit/0.23-dirty MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- 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) From patchwork Mon Jul 20 21:52:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11674583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE6766C1 for ; Mon, 20 Jul 2020 21:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B817F22BEF for ; Mon, 20 Jul 2020 21:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgGTVw7 (ORCPT ); Mon, 20 Jul 2020 17:52:59 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:18946 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgGTVw7 (ORCPT ); Mon, 20 Jul 2020 17:52:59 -0400 IronPort-SDR: b32ShKgfaR2LCai+SsW9dJvQu5bCPcXUnTbQeQi+QFSiMvuMDp0X1qJ8LAgyo2yR58YmNJpXOV TuHngtCUQy1qtEQz4MJtP2oNpPprnKXYfFOHW34hO00hq7qpasJUIiglmgsAmPoJ5nNf0Ue/Sn 5FlHfHDdVSSFBsf5q5h5dqhMlvc0ntDdgFbstMYqLdHSKeVr0qJbUHw84a5OMISGtZ3JVz/6CF m2E8b3aiKCEYkBFSkeZov+ZQeG5HJ1ko42ZPtVnyMH9rVaUYGPKC0Rqy0jOT3SQhYJdMzCVaaX 1pQ= X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="19897244" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2020 14:52:58 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 20 Jul 2020 14:52:58 -0700 Received: from [127.0.1.1] (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 20 Jul 2020 14:52:20 -0700 Subject: [PATCH 2/4] hpsa: increase qd for external luns From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 20 Jul 2020 16:52:57 -0500 Message-ID: <159528197765.24772.15623281371636788406.stgit@brunhilda> In-Reply-To: <159528193513.24772.2142294136346611232.stgit@brunhilda> References: <159528193513.24772.2142294136346611232.stgit@brunhilda> User-Agent: StGit/0.23-dirty MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org - increase queue_depth for PTRAID devices - improves performance. Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- 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 */ From patchwork Mon Jul 20 21:53:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11674585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 049B06C1 for ; Mon, 20 Jul 2020 21:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E19FA22B4E for ; Mon, 20 Jul 2020 21:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbgGTVxF (ORCPT ); Mon, 20 Jul 2020 17:53:05 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:18961 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgGTVxF (ORCPT ); Mon, 20 Jul 2020 17:53:05 -0400 IronPort-SDR: 5+I1Vj0XtYa786FC6mVR6qUBRqMfDxxe+0jh2o55K+CV5t+Vww5ls0Nwbcp/Zo6DD+Pz1tLAuo xuqSJQu3V0oryNtkcW9jr4wNzY0B7OwO4Ltb/lQF5Gw0g+q7FtZzIU++S15Xq+IhprbvmHh8v/ NEkqxy0YqtovtvW19o+gK4d1FREwfNzXHUUw7UwI5zhVeW0gq9Ydti4AuGgeoKDHbLb4GiTRui 08rZHf/lpDMp5qm2rncDbj+6sVDj8GN8WNtqCe8eOO7ngAuHBJ78905/eJfsJmPAka3qQrEejH QiI= X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="19897266" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2020 14:53:04 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 20 Jul 2020 14:53:03 -0700 Received: from [127.0.1.1] (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 20 Jul 2020 14:53:03 -0700 Subject: [PATCH 3/4] hpsa: increase ctlr eh timeout From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 20 Jul 2020 16:53:03 -0500 Message-ID: <159528198335.24772.7963614374905470122.stgit@brunhilda> In-Reply-To: <159528193513.24772.2142294136346611232.stgit@brunhilda> References: <159528193513.24772.2142294136346611232.stgit@brunhilda> User-Agent: StGit/0.23-dirty MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- 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; From patchwork Mon Jul 20 21:53:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11674587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CBD56C1 for ; Mon, 20 Jul 2020 21:53:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 505C222BEF for ; Mon, 20 Jul 2020 21:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbgGTVxL (ORCPT ); Mon, 20 Jul 2020 17:53:11 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:18961 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgGTVxK (ORCPT ); Mon, 20 Jul 2020 17:53:10 -0400 IronPort-SDR: E8g57/CJxM9YVZwjB6kLiRcsxzE6FNiwdKovTkR1sgItvnUMjNKzq4y2k8sYHs3RQVNIeI88i5 7SVekfeyHbsaE1k+44N0fkVR/hvDrAe2JtxuwKN5JyiX90dQHmCizNzwyG3TE+q1MMv7/AvIAo SYy04a4q7lsxXg7VIZuCqExZCDorN/+qJ3ryNhf9tZaHx+zVMroBvl1Sf+4LmkLXxkZpvPpHcV uEP67V+/fHK3rbR6hWTH1MIxYkJrm5NzT+xz+tsUDTF2M9yVPrrO0ZfQwWcJS+rZWX5hT3Af34 4U8= X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="19897280" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2020 14:53:09 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 20 Jul 2020 14:53:09 -0700 Received: from [127.0.1.1] (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 20 Jul 2020 14:52:32 -0700 Subject: [PATCH 4/4] hpsa: bump version From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 20 Jul 2020 16:53:09 -0500 Message-ID: <159528198909.24772.9189002306398058371.stgit@brunhilda> In-Reply-To: <159528193513.24772.2142294136346611232.stgit@brunhilda> References: <159528193513.24772.2142294136346611232.stgit@brunhilda> User-Agent: StGit/0.23-dirty MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Reviewed-off-by: Gerry Morong Signed-off-by: Don Brace --- 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"