From patchwork Tue Oct 22 19:36:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 11205283 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 9D79D14E5 for ; Tue, 22 Oct 2019 19:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B84D21872 for ; Tue, 22 Oct 2019 19:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="aTeko+Z6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388136AbfJVTgz (ORCPT ); Tue, 22 Oct 2019 15:36:55 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:55906 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732623AbfJVTgz (ORCPT ); Tue, 22 Oct 2019 15:36:55 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MJZe1B007872; Tue, 22 Oct 2019 12:36:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=WeF2NDmeJM35579Gy7dFq6s67RlMX/UKTbJQDpqcBRI=; b=aTeko+Z6HG3tummM4wA3cf6YtmU/QcjXXCBGiA31E7swAwPdIK3YNjUU0T3GuISMMJla E1LWAUVBxWS07KXs1W48ad/Tg59E72BnvsgwB5LiHWWxVnUvVhMXx/S5jlO30N6YRjvj C3n6ZwrRy6ZQKLZt1Tk8xhg9J8ok/AMKZXhyxVFBbyyTilADxgVcgpxwjRBG4WNcTapF 7lL+Mcuv2qXbepX0R8veNERpPFF/iHg9EJQZB0/toaBYwHtxHUGkrBjKvhPHOmyDQ6Ua LsgEEcYqihtHzETM3Q1syVd3pGpY/a8hfCauRh3iTu25+5D6DeDiiKZNQ2TPZD4nukwM 6A== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2vsw612f9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 12:36:49 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 12:36:47 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 12:36:47 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 752783F7040; Tue, 22 Oct 2019 12:36:47 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x9MJalJO007115; Tue, 22 Oct 2019 12:36:47 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x9MJalW0007114; Tue, 22 Oct 2019 12:36:47 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 1/2] qla2xxx: Initialized mailbox to prevent driver load failure Date: Tue, 22 Oct 2019 12:36:42 -0700 Message-ID: <20191022193643.7076-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20191022193643.7076-1-hmadhani@marvell.com> References: <20191022193643.7076-1-hmadhani@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_06:2019-10-22,2019-10-22 signatures=0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch fixes issue with Gen7 adapter in a blade enviornment, where one of the port will not be detected by driver. Firmware expectes mailbox 11 to be set or clear by driver for newer ISP. Following message is seen in the log file [ 18.810892] qla2xxx [0000:d8:00.0]-1820:1: **** Failed=102 mb[0]=4005 mb[1]=37 mb[2]=20 mb[3]=8 [ 18.819596] cmd=2 **** Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_mbx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 1cc6913f76c4..4a1f21c11758 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -702,6 +702,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) mcp->mb[2] = LSW(risc_addr); mcp->mb[3] = 0; mcp->mb[4] = 0; + mcp->mb[11] = 0; ha->flags.using_lr_setting = 0; if (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { @@ -746,7 +747,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) if (ha->flags.exchoffld_enabled) mcp->mb[4] |= ENABLE_EXCHANGE_OFFLD; - mcp->out_mb |= MBX_4|MBX_3|MBX_2|MBX_1; + mcp->out_mb |= MBX_4 | MBX_3 | MBX_2 | MBX_1 | MBX_11; mcp->in_mb |= MBX_3 | MBX_2 | MBX_1; } else { mcp->mb[1] = LSW(risc_addr); From patchwork Tue Oct 22 19:36:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 11205281 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 A9E6F913 for ; Tue, 22 Oct 2019 19:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88EEF21872 for ; Tue, 22 Oct 2019 19:36:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="nKDJbWIm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388081AbfJVTgy (ORCPT ); Tue, 22 Oct 2019 15:36:54 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:29566 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731806AbfJVTgy (ORCPT ); Tue, 22 Oct 2019 15:36:54 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MJXSf7027747; Tue, 22 Oct 2019 12:36:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=XwVs91KWKhW+wWr5yph0TIzknryv1igNCvvk0Sr9wuU=; b=nKDJbWImu14UUoKFDsoy63cUwzYwQinSDi9fj5FQlae1vyf02sZVL8JWZxFoM1eRCb9J YOw8TJ9qCd+U8YZKFL3YnBsoze5UUOOhxJ+gzA1o0Gi1KxtXswidH5ap2MKW7nZkRj0d qDlxN88g6shjMZ5jIHCJJpEAOpmFVfLmguHTNE7KfbplMbz7Ol+12VpMt3GjKEeg008P X9kguHrKVAgy/84dvlMeFPCJQVqOMERNBAs3NUJ2Uv3/88c6eQsvr0ibOP/tpkaLB9K1 AxBoz5mHNLYwsJTCcwjFWQ0vbwR6WuwczApmqT3uD/lqnJwQMFpKq6CCz4/6OPpsVMKg xw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjha14e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 12:36:51 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 12:36:50 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 12:36:50 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id A94FC3F703F; Tue, 22 Oct 2019 12:36:50 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x9MJaoAI007119; Tue, 22 Oct 2019 12:36:50 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x9MJaogS007118; Tue, 22 Oct 2019 12:36:50 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 2/2] qla2xxx: Fix partial flash write of MBI Date: Tue, 22 Oct 2019 12:36:43 -0700 Message-ID: <20191022193643.7076-3-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20191022193643.7076-1-hmadhani@marvell.com> References: <20191022193643.7076-1-hmadhani@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_06:2019-10-22,2019-10-22 signatures=0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Quinn Tran For new adapter with multiple flash regions to write to, current code allows FW & Boot regions to be written, while other regions are blocked via sysfs. The fix is to block all flash read/write through sysfs interface. Fixes: e81d1bcbde06 ("scsi: qla2xxx: Further limit FLASH region write access from SysFS") Cc: stable@vger.kernel.org # 5.2 Signed-off-by: Quinn Tran Signed-off-by: Girish Basrur Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 8b3015361428..8705ca6395e4 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -440,9 +440,6 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, valid = 0; if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) valid = 1; - else if (start == (ha->flt_region_boot * 4) || - start == (ha->flt_region_fw * 4)) - valid = 1; else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) valid = 1; if (!valid) { @@ -489,8 +486,10 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, "Writing flash region -- 0x%x/0x%x.\n", ha->optrom_region_start, ha->optrom_region_size); - ha->isp_ops->write_optrom(vha, ha->optrom_buffer, + rval = ha->isp_ops->write_optrom(vha, ha->optrom_buffer, ha->optrom_region_start, ha->optrom_region_size); + if (rval) + rval = -EIO; break; default: rval = -EINVAL;