From patchwork Mon Jul 27 19:58:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687523 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 A7B01912 for ; Mon, 27 Jul 2020 19:58:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9560C20759 for ; Mon, 27 Jul 2020 19:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729109AbgG0T6b (ORCPT ); Mon, 27 Jul 2020 15:58:31 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:62013 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbgG0T6b (ORCPT ); Mon, 27 Jul 2020 15:58:31 -0400 IronPort-SDR: vWvd8a5nqLPh/JLoVGpGUZ6EQsFCUpjDZnOt7ifG0g4eZLINh3ai6pTNyKFxHWyKjI8wCkg+Uh 4IZ2g8ps5XMOj5RzIWUgGhIytVQmox/CPhzxbVIeVn24NCan/sO5Yqnu2ogU2yGwDOFwUc8DL7 qF+GWqqi70juZ7osIbUByy8THJ2dpN3JvrreVlAYnLKzwjCVjiAeN440/R8tCGjYWK9/7ue53a T7LBFjfjYtBTwxsPnwOti7WNXIbq6rnuLls8FNhUH8k7iYmWtk2V6mtEwRUvbAyp0LHAaBznrf nJs= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="84786778" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2020 12:58:29 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 27 Jul 2020 12:57:45 -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, 27 Jul 2020 12:58:27 -0700 Subject: [PATCH V3 1/4] hpsa: correct rare oob condition From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:58:28 -0500 Message-ID: <159587990819.28270.9067960539097372726.stgit@brunhilda> In-Reply-To: <159587987792.28270.15427178888235104199.stgit@brunhilda> References: <159587987792.28270.15427178888235104199.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 27 19:58:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687525 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 133B6138C for ; Mon, 27 Jul 2020 19:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F219D207BB for ; Mon, 27 Jul 2020 19:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbgG0T6f (ORCPT ); Mon, 27 Jul 2020 15:58:35 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:62013 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbgG0T6f (ORCPT ); Mon, 27 Jul 2020 15:58:35 -0400 IronPort-SDR: GOQ9psn5B2hIz+m4+TCjNEQZEKhv4/fDMFBKwl0bvz/khZM7AQhknCrWo3JU2LX9UlUQvJt6nG f6RwgQuQy8LCXBl1qMZmlRTVzzUk/PSLA/jGCKmoShGnN5LO4hmC+vLJHjIRRWEXXmGzsz43r8 /3zZ50ecicjxi2cwLfErhvqirV7gJPcb2Wj+REzgQgdp5ES7Jcfl3Vr77I5NF7kqLo3Mfqq62a 5zcG8gbdIhPAs5rOSG/K6AnVTRQrk83+4lUSDl0NJ/2y/VIlsBdVH/PmiqErqLSR1MYaoFQGVa CQs= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="84786794" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2020 12:58:35 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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, 27 Jul 2020 12:58:33 -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, 27 Jul 2020 12:57:50 -0700 Subject: [PATCH V3 2/4] hpsa: increase qd for external luns From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:58:33 -0500 Message-ID: <159587991396.28270.15645031529296231253.stgit@brunhilda> In-Reply-To: <159587987792.28270.15427178888235104199.stgit@brunhilda> References: <159587987792.28270.15427178888235104199.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 27 19:58:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687527 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 A82C3912 for ; Mon, 27 Jul 2020 19:58:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9930120759 for ; Mon, 27 Jul 2020 19:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729117AbgG0T6l (ORCPT ); Mon, 27 Jul 2020 15:58:41 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:53027 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbgG0T6l (ORCPT ); Mon, 27 Jul 2020 15:58:41 -0400 IronPort-SDR: ZWwnnyu0sFJmGyPk9F5vONAbc30blvUNA+l26a+uLnuCJ9M9DMJ63EK7wi4xb1mEOKoen/Qk2P xQsxon9rejFtXSy3j0brQstRcL4jox8mOF4b1XbVKmh8JUZZ08qdPR8OGEhtBlEecWhWOiGrAh S7+01qJhlzH6u1uXy8d8SZqx39Pxh3f7oQtr1YD01psvQya0jZcflK3kONipIGcc+Izw2Azcg9 vyBZPALAgoICOBospo4VXK1mV+h+pE3ypVNEHNs8OBJhpZ6bVvHHQuAkqhsS01a1KTXmzxCp+O vF0= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="89304408" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2020 12:58:40 -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, 27 Jul 2020 12:58:39 -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, 27 Jul 2020 12:58:38 -0700 Subject: [PATCH V3 3/4] hpsa: increase ctlr eh timeout From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:58:39 -0500 Message-ID: <159587991974.28270.4662610217523649944.stgit@brunhilda> In-Reply-To: <159587987792.28270.15427178888235104199.stgit@brunhilda> References: <159587987792.28270.15427178888235104199.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 | 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); From patchwork Mon Jul 27 19:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687529 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 F14C1912 for ; Mon, 27 Jul 2020 19:59:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDF7520759 for ; Mon, 27 Jul 2020 19:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729220AbgG0T7J (ORCPT ); Mon, 27 Jul 2020 15:59:09 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:53054 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728092AbgG0T7I (ORCPT ); Mon, 27 Jul 2020 15:59:08 -0400 IronPort-SDR: YN1HS/X3OOR2+fljVxOuPU252wEFZoNSv3a7xZw56lYo5kSvgrFzIsdtFDFKGGpbjMvvobC29k Sub27s9czHO2MDJowGWQcZdAEDCwd2isBqzpmmiel4f0XZqYu/rNf5mwXJQ/2Pw32i9g5yENLQ hwx6chFS/Q3r8vYQ5lL+C8pz5TdGw1q9ZsXjHy/HEDaSzLoj0sOyjOx+COOY1/U+krgGtxFoCm RkmJiAXP6wDE0/jFTJzyYsOhkEEZUEQ2zXS5lT6e0KmP15HJPmcvH/L7pIEZGTHp+tjVpL5DRc B3s= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="89304415" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2020 12:58:46 -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, 27 Jul 2020 12:58:45 -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, 27 Jul 2020 12:58:02 -0700 Subject: [PATCH V3 4/4] hpsa: bump version From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:58:45 -0500 Message-ID: <159587992554.28270.4152101997461324683.stgit@brunhilda> In-Reply-To: <159587987792.28270.15427178888235104199.stgit@brunhilda> References: <159587987792.28270.15427178888235104199.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 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"