From patchwork Mon Jul 27 19:01:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687411 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 3EA8813B1 for ; Mon, 27 Jul 2020 19:01:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 306962078E for ; Mon, 27 Jul 2020 19:01:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728098AbgG0TBS (ORCPT ); Mon, 27 Jul 2020 15:01:18 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:46521 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbgG0TBR (ORCPT ); Mon, 27 Jul 2020 15:01:17 -0400 IronPort-SDR: wrxnDl2RFkIkULauy/m3AXYHR69EH5nj8kuulxEEkkaC6goPymKCfPX8Wek1jD7UKXlu+SV1RW z2HCccHV9iqX/NRyJmwavbKDZ5080afuwtBooNGeg5awxKyvtSXYmz6zY00/hhOnlIt9Q6Pz+G 9Qj3munFBEQPtsJig6bjeYNpKHOMkfEFUhw9gc0NIRSuPgDCSl4Fkzu0Cb3lt50GuqO7Q8imPf eCVM8SFmYej0hjM4Jc1d9gXGr1WgluTwHNdR1fnBkWwxIYNZVXKI3PcdWzN4DSXN0zAWcUKXbi 644= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="89292297" 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:01:16 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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:01:15 -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, 27 Jul 2020 12:00:30 -0700 Subject: [PATCH 1/4] hpsa: correct rare oob condition From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:01:16 -0500 Message-ID: <159587647598.27787.15511745962413099922.stgit@brunhilda> In-Reply-To: <159587636236.27787.16970342225988726638.stgit@brunhilda> References: <159587636236.27787.16970342225988726638.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:01:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 11687413 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 1450A1392 for ; Mon, 27 Jul 2020 19:01:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F155B2078E for ; Mon, 27 Jul 2020 19:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727979AbgG0TBc (ORCPT ); Mon, 27 Jul 2020 15:01:32 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:46739 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgG0TBc (ORCPT ); Mon, 27 Jul 2020 15:01:32 -0400 IronPort-SDR: 6liB8DI4vt9HNL+gjdQAhTUCmqC9SEQWGwzsgURWR+9gJPuxHojKjyUG9Eq69a7jExe0K1W4BO bNv9kPzFWuH9xyg+MKIse4gOI7xQMVVJCKmbmOaOAzLA1OB/pCCN38zHubKV6F5u1R5W/IOaSC fcUILvCd2uljnqKLyxA7WmVp0jWQZQCcMhrXnFMQlQSqJrvCtgi2eJ1uTGbCOnv+IuD596xG1j qCDK+9Mgl0hBx1Kde/WasCY4n/IffxSVtc50OYGh3fx0dZaSAWU9lC/AQfLCZX9PS0kSiHiadF 0w4= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="89293777" 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:01:31 -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:01:21 -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:01:20 -0700 Subject: [PATCH 2/4] hpsa: increase qd for external luns From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:01:21 -0500 Message-ID: <159587648175.27787.13355905888342708678.stgit@brunhilda> In-Reply-To: <159587636236.27787.16970342225988726638.stgit@brunhilda> References: <159587636236.27787.16970342225988726638.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:01: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: 11687417 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 490811392 for ; Mon, 27 Jul 2020 19:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A05320719 for ; Mon, 27 Jul 2020 19:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728079AbgG0TBv (ORCPT ); Mon, 27 Jul 2020 15:01:51 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:46966 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgG0TBu (ORCPT ); Mon, 27 Jul 2020 15:01:50 -0400 IronPort-SDR: 5K/4ulH65MVllY/URDBcD24nitCdwxuF0bozNlXs6+EIwzLzqZvJrdUdcaS3zhFYsoQO6RWfvw UtPZjdKbq7nXYS/SXDihiMYihQ76g3eiUb/N6N0NDCQO6jfRFkDLUUeXSMT2gMsCIs8NoO/ohc BnrS/v+qO3x8UuTTzlhuyISWoGYboKqMd/InyW1LNNAcG+aagqT4Bdpj5j/sX+zlN4wfomuOHA brSJ2b0du0jmLB31SpJjjbAGDK6T9dM100PuAxrgXy20cuSdlFad/8JvJCdL9gC14TYHCiNWai waU= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="89294021" 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:01:49 -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:01:32 -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:01:32 -0700 Subject: [PATCH 3/4] hpsa: increase ctlr eh timeout From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:01:33 -0500 Message-ID: <159587649303.27787.8370512556225680281.stgit@brunhilda> In-Reply-To: <159587636236.27787.16970342225988726638.stgit@brunhilda> References: <159587636236.27787.16970342225988726638.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:01: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: 11687415 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 6917B13B1 for ; Mon, 27 Jul 2020 19:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 514372078E for ; Mon, 27 Jul 2020 19:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbgG0TBm (ORCPT ); Mon, 27 Jul 2020 15:01:42 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:40782 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgG0TBl (ORCPT ); Mon, 27 Jul 2020 15:01:41 -0400 IronPort-SDR: dUQHGQGcx3fbnf008J3fJr4hrKz0FgCuQLNO/+yCcayw0aK+KtdsNI9FRqtw/EaypJDmNNRDyl 0SMjbzVWL5neyid2CQ20NBcAGXVLZlCyM/3Yey10IE8Kf0j9zzzoVGRmvGfLOezujLUPwDUQv9 V2pwv+r1u70Ci7IyJAsKOV6W0Ncx3g3LIKRz42La5egMIyHSW8nNfYdt5XIN8Y8tbFgjtjCEPE 3wZcVLFWSIG9lylxGD1nJ+tw2To1JOaHYAksqSnC7uV7buNSb8YhWPq62hSdrLWQo8P1pfUZ7b 1tk= X-IronPort-AV: E=Sophos;i="5.75,403,1589266800"; d="scan'208";a="81443407" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2020 12:01:41 -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, 27 Jul 2020 12:01:38 -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, 27 Jul 2020 12:00:53 -0700 Subject: [PATCH 4/4] hpsa: bump version From: Don Brace To: , , , , , , , , , , CC: Date: Mon, 27 Jul 2020 14:01:39 -0500 Message-ID: <159587649899.27787.7507027995418595584.stgit@brunhilda> In-Reply-To: <159587636236.27787.16970342225988726638.stgit@brunhilda> References: <159587636236.27787.16970342225988726638.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"