From patchwork Tue Aug 13 20:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11092865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF2F81399 for ; Tue, 13 Aug 2019 21:03:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF9E5286C4 for ; Tue, 13 Aug 2019 21:03:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3A9B28741; Tue, 13 Aug 2019 21:03:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770D6286C4 for ; Tue, 13 Aug 2019 21:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbfHMVDO convert rfc822-to-8bit (ORCPT ); Tue, 13 Aug 2019 17:03:14 -0400 Received: from m9a0002g.houston.softwaregrp.com ([15.124.64.67]:37784 "EHLO m9a0002g.houston.softwaregrp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbfHMVDN (ORCPT ); Tue, 13 Aug 2019 17:03:13 -0400 Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP FOR linux-scsi@vger.kernel.org; Tue, 13 Aug 2019 21:02:42 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 13 Aug 2019 20:31:08 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 13 Aug 2019 20:31:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ShX6k/Fuz6I3juxX5mJ+sfR+JlaJ5jvSMOQAzY9EuvuTIXF8FNQbyef3cw2xWlRdSDzuKo0UARZT3qHZzgAunYqWVmF/3yw8U26iqeWmn/NNLRzMappnBCV8FUMANC6NQLmW1YlGDINjxPA/YxpUKqa2jjSmXyLMgS19UnFTNILyhDvJMslh2hfd3JB0TAVrzVaccBNRLBF/InyfG1bdYslAzvBR/a0o73ZkUZuwY6jkZfU2fT/wMP8Xhs9bJGwuWcXO9EnbAvC6uB9yBywfi6PHQgau7wMzIIzzO7QEQbZ4ldAJCWNbqaaggHWSGuWC3LaOoABbA116V7hX8McF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oCqLD57xO0gflcJfrVOgLuxP4FR6U+XweOaYdp1Vn+M=; b=DZ0QSLSWcKPWAV8gLudpP96wvaUkGAne9pGUMSXyjuvWRbfMt5YriNgBHW+teGgbzNOUZzrB9R7sISkvnuK6Npp/rRHtjFdBxUyy+5NROHvwXQTlqsm4g+CTni1qNJgWql91GUTdSZo2e3HXFK0FbU7yerx2GWBte3P2s0RfJrwGM0q8WKEg3xq3jEBq7IK/817zqQWWMEXQPTV2/1Do1a42WIy8XYKV2WXbrVhiwQ0DAyHhIxKc4gJthfADA9EXI4PCPQ5c7PgGeOfdL9zCA6/9Xy+/Le3czR0lnG4sn8v8WpxDkHdm8Iu4tp/1stBe6pI2Aie53mDUNbnidSRtKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.246.91) by CH2PR18MB3430.namprd18.prod.outlook.com (52.132.246.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.14; Tue, 13 Aug 2019 20:31:08 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a%6]) with mapi id 15.20.2157.022; Tue, 13 Aug 2019 20:31:07 +0000 From: Martin Wilck To: "Martin K. Petersen" , Himanshu Madhani CC: Bart Van Assche , Joe Carnuccio , Quinn Tran , Hannes Reinecke , Martin Wilck , "linux-scsi@vger.kernel.org" , Bart Van Assche Subject: [PATCH 1/3] scsi: qla2xxx: qla2x00_alloc_fw_dump: set ha->eft Thread-Topic: [PATCH 1/3] scsi: qla2xxx: qla2x00_alloc_fw_dump: set ha->eft Thread-Index: AQHVUhYJzKIvwNb7KkmQp5i87fb5BQ== Date: Tue, 13 Aug 2019 20:31:07 +0000 Message-ID: <20190813203034.7354-2-martin.wilck@suse.com> References: <20190813203034.7354-1-martin.wilck@suse.com> In-Reply-To: <20190813203034.7354-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0012.eurprd05.prod.outlook.com (2603:10a6:209:1::25) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:2c::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.22.0 x-originating-ip: [94.218.227.174] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e259d88d-f6f1-4cfd-be0f-08d7202d2b79 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:CH2PR18MB3430; x-ms-traffictypediagnostic: CH2PR18MB3430: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(366004)(396003)(39860400002)(136003)(376002)(346002)(199004)(189003)(71190400001)(53936002)(478600001)(64756008)(110136005)(71200400001)(66476007)(81156014)(66556008)(6486002)(81166006)(5660300002)(50226002)(54906003)(66446008)(316002)(99286004)(6512007)(6436002)(8936002)(66946007)(2906002)(86362001)(36756003)(4326008)(26005)(102836004)(186003)(4744005)(305945005)(14454004)(7736002)(256004)(25786009)(386003)(8676002)(66066001)(3846002)(6116002)(52116002)(76176011)(11346002)(2616005)(486006)(44832011)(1076003)(476003)(446003)(6506007);DIR:OUT;SFP:1102;SCL:1;SRVR:CH2PR18MB3430;H:CH2PR18MB3349.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: CMo1Q3/CrRWoaMKg8KFlvyxQvmjlWPavNayjC8tg4OoJMyF70B03elgtFNAlAKjm23WxBaZNhEm6TX9OQe3r2dv8W3r6sq+K125Jh5tdEvyiCfvqLSl/p/aNTsVM9I9EX3VO5tATa2MIjJ1nYZqLD3+nSpOg5x2iBzqWk27De4lFwSuP9yk5LiYnOPsVZ4YCsl5aMwvA1dpqbSUdpBDXJvH/d3rtAHRs/3ePtoJwhYKCiejeU5ZYKCaO/edbyirlxgxSZsjSc2ViEQy5pCqsOVhRSIoJ+XUwAVbUxvWSqXKcGMwt1y8wHz968zOFO8RHE70R7ctGj02QE1/Bw+cPl72YncD9O2pWguZu5tIROSZcVVr5sbBkVXg2JH93XGSx/uPu/md2tb5Xd/CGtlZhn7HLPw5+5ScZy1cMCoGj/nU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e259d88d-f6f1-4cfd-be0f-08d7202d2b79 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2019 20:31:07.6197 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rDHPP97Qc/etlopXTwXpYFR3XidMnsCjfOWTiPCVAJyusmRKSocbIKkyJpNbDXyEGdaWq5ARt2rqpIkO5sdYEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3430 X-OriginatorOrg: suse.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Wilck In qla2x00_alloc_fw_dump(), an existing EFT buffer (e.g. from previous invocation of qla2x00_alloc_offload_mem()) is freed. The buffer is then re-allocated, but without setting the eft and eft_dma fields to the new values. Fixes: a28d9e4ef997 "scsi: qla2xxx: Add support for multiple fwdump templates/segments" Cc: Joe Carnuccio Cc: Quinn Tran Cc: Himanshu Madhani Cc: Bart Van Assche Signed-off-by: Martin Wilck Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 535dc21..6dd68be 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3197,6 +3197,8 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ql_dbg(ql_dbg_init, vha, 0x00c3, "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); eft_size = EFT_SIZE; + ha->eft_dma = tc_dma; + ha->eft = tc; } if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { From patchwork Tue Aug 13 20:31:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11092823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFDDD746 for ; Tue, 13 Aug 2019 20:37:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B00AC286CB for ; Tue, 13 Aug 2019 20:37:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3A1F286DB; Tue, 13 Aug 2019 20:37:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D60B286CB for ; Tue, 13 Aug 2019 20:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfHMUhV convert rfc822-to-8bit (ORCPT ); Tue, 13 Aug 2019 16:37:21 -0400 Received: from m4a0039g.houston.softwaregrp.com ([15.124.2.85]:50525 "EHLO m4a0039g.houston.softwaregrp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfHMUhV (ORCPT ); Tue, 13 Aug 2019 16:37:21 -0400 Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Tue, 13 Aug 2019 20:37:02 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 13 Aug 2019 20:31:12 +0000 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (15.124.8.14) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 13 Aug 2019 20:31:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WdgsFHg9WRHMk+AgkgKpNJcuRF5XPPngxAqoOlXb97mCASA94Tmx4P5xB+54AVz5MjnQqPD+J1gB7rGaQCLQJuWQ8p4MeJm6PGy/vakJ1hBp33mjpwjPWlJKL6on3DmmMPqPprx3NZhOT83ifbM8gv0MqjDw3cTjw3Xn923DsQ3gSX3OAdnqZqzwa8NGznI8gkHIu4GWXYIZF2YSNGfu6om/Wd2ZGuIABnSL1fkNQzXksJ+vX2JuscnhdCEEa/vdTGXyUSgIy7L/tqvgMNmDY0LiBNCZhPf20Xe7ASWJuB2CpXWrdWuEzHjaX/nzOlqj2FE3mhbkzKg+UvJCQ1O8Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pMHFgC4KW17yYRwGJ640+STAc88qOecdj36EZ26KSi8=; b=FPmnrZEnndmETR6tcPC4i/np0mLiwacaEVP8P1u3ESDX9DS7LsfQ+9JLOqMP7NzrR1GBre5p1bqhTgkN2XMbXOTbUJgwkChPkKdvU5hnG/HwbEIraa7K5EqJPl5Vn3VKFQPA1sJsrkLH83HDDytXJt8CdKhGJel90gUWJ4ZJB0oogqN78k74qzr/cdwQel/2E+o5rb1QukjB+wt+IvIh4K7F0rXbqu6RRIrrYkfYQLcnL91uWFOcHmlZVpeP9Dht8HK8pBGLNeOHmyk8oaKUV50viETuEMa1R0/9OHabo8EYNT40rDdi4yp2EMZu0SsxIhLkkIstWi/nhfS4xgPIEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.246.91) by CH2PR18MB3366.namprd18.prod.outlook.com (52.132.246.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.21; Tue, 13 Aug 2019 20:31:10 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a%6]) with mapi id 15.20.2157.022; Tue, 13 Aug 2019 20:31:10 +0000 From: Martin Wilck To: "Martin K. Petersen" , Himanshu Madhani CC: Bart Van Assche , Joe Carnuccio , Quinn Tran , Hannes Reinecke , Martin Wilck , "linux-scsi@vger.kernel.org" , Bart Van Assche Subject: [PATCH 2/3] scsi: qla2xxx: unset RCE/EFT fields in failure case Thread-Topic: [PATCH 2/3] scsi: qla2xxx: unset RCE/EFT fields in failure case Thread-Index: AQHVUhYKQMcVI/ohF0qhHmiduV8LJg== Date: Tue, 13 Aug 2019 20:31:10 +0000 Message-ID: <20190813203034.7354-3-martin.wilck@suse.com> References: <20190813203034.7354-1-martin.wilck@suse.com> In-Reply-To: <20190813203034.7354-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0012.eurprd05.prod.outlook.com (2603:10a6:209:1::25) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:2c::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.22.0 x-originating-ip: [94.218.227.174] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0251b7b9-c137-49aa-e7a9-08d7202d2d22 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:CH2PR18MB3366; x-ms-traffictypediagnostic: CH2PR18MB3366: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(346002)(39860400002)(396003)(376002)(136003)(366004)(189003)(199004)(71190400001)(6436002)(8936002)(54906003)(110136005)(76176011)(2906002)(66066001)(52116002)(50226002)(71200400001)(316002)(81156014)(81166006)(4326008)(14444005)(5660300002)(6486002)(256004)(25786009)(3846002)(7736002)(1076003)(26005)(8676002)(6512007)(478600001)(53936002)(6116002)(486006)(2616005)(186003)(11346002)(14454004)(305945005)(446003)(44832011)(36756003)(66556008)(64756008)(386003)(6506007)(66946007)(66446008)(102836004)(66476007)(99286004)(476003)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:CH2PR18MB3366;H:CH2PR18MB3349.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: heIaxqtK0Wbhqw1bjnwYkOYaoVf+igJy12Ln88DnKuVPUKdJHAkdX9Yakj/TKARVyGl8E+uL/k4kLD4t+o+eV1HuifKnRFIvOQna2HzsMdhkMN5q3MkoDWOe3KH1+FbDJIgXog4oOCzF2SyikLt5oGCGS+SKVuUSscjD/mqV73Z/EPRQ1NqaVUFgHOoz2lmxayAPWr3/MtxqUU0vgnz20oKLTOmwUHRlsJSPcIrMqghchxYd+qARqXpqIiK0qmFRav22TvcIaQAF9GxIKTMXJk6+HCXnAi0WB0YMlC9V7Eovt69aEWDzxRZsaFOO/XlCstwhF8croxqRcGV0sFR2xs+QFA9x9YoIgz74kOxnsjdWf/gjn/FUFdO6hu/jqh4AzHRyHV648gvtg9M3zWF8JUzZvS0mmTN6E/0E0+eHb0I= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0251b7b9-c137-49aa-e7a9-08d7202d2d22 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2019 20:31:10.1182 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gH3WJjrP3jMeBVMjYDEylxdD7uFEo9aat8Vvx8YiDdN0mZfsoHxFJXCUHz6NmlMLiepA+JCH7se9RzxfqO8YNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3366 X-OriginatorOrg: suse.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Wilck Reset ha->rce, ha->eft and the respective dma fields if the buffers aren't mapped for some reason. Also, treat both failure cases (allocation and initialization failure) equally. The next patch modifies the failure behavior slightly again. Fixes: ad0a0b01f088 "scsi: qla2xxx: Fix Firmware dump size for Extended login and Exchange Offload" Fixes: a28d9e4ef997 "scsi: qla2xxx: Add support for multiple fwdump templates/segments" Cc: Joe Carnuccio Cc: Quinn Tran Cc: Himanshu Madhani Cc: Bart Van Assche Signed-off-by: Martin Wilck --- drivers/scsi/qla2xxx/qla_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 6dd68be..ca9c3f3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3063,6 +3063,8 @@ qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) ql_log(ql_log_warn, vha, 0x00be, "Unable to allocate (%d KB) for FCE.\n", FCE_SIZE / 1024); + ha->fce_dma = 0; + ha->fce = NULL; goto try_eft; } @@ -3111,9 +3113,12 @@ qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) ha->eft_dma = tc_dma; ha->eft = tc; + return; } eft_err: + ha->eft = NULL; + ha->eft_dma = 0; return; } @@ -3184,6 +3189,8 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ql_log(ql_log_warn, vha, 0x00c1, "Unable to allocate (%d KB) for EFT.\n", EFT_SIZE / 1024); + ha->eft = NULL; + ha->eft_dma = 0; goto allocate; } @@ -3193,6 +3200,9 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) "Unable to initialize EFT (%d).\n", rval); dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, tc_dma); + ha->eft = NULL; + ha->eft_dma = 0; + goto allocate; } ql_dbg(ql_dbg_init, vha, 0x00c3, "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); From patchwork Tue Aug 13 20:31:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11092927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BEDF1399 for ; Tue, 13 Aug 2019 21:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F057528694 for ; Tue, 13 Aug 2019 21:06:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4647286BF; Tue, 13 Aug 2019 21:06:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7228628694 for ; Tue, 13 Aug 2019 21:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbfHMVGl convert rfc822-to-8bit (ORCPT ); Tue, 13 Aug 2019 17:06:41 -0400 Received: from m9a0003g.houston.softwaregrp.com ([15.124.64.68]:45388 "EHLO m9a0003g.houston.softwaregrp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726560AbfHMVGk (ORCPT ); Tue, 13 Aug 2019 17:06:40 -0400 Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP FOR linux-scsi@vger.kernel.org; Tue, 13 Aug 2019 21:06:12 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 13 Aug 2019 20:31:13 +0000 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 13 Aug 2019 20:31:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jDXEClbP55AAOvw5V2xwNM3axuJqJ1Sys2OagHTHzdJWM7IYvBl7sRnOv+RCaMZ/g0VVE8KhNuunLQ+MrYsn31/kred1ohUchRnx1ebixjCAyNoM/tV6mqLHEefJ9Ipzq938DSgR6snbpQz9JMmG8m69nlKEVbPNXLbLwg6oQ5c7Zj89cy+Mdki6tpWk404JOs9mJCth1jE3WpvLD+6F2xxhlyKQUEmbe9jSIkJJW+GuSO32Y7JbY2+/0KSKeVGiS6tfSMF7NxN4+R77PV2TLCFitbGMoPwRIHUPvdSivCAeJCdsdOP6zGstxvVe/UFJdXrsT0ClFfRpEMJbCYyo3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q4QaegRr4INuxZtTuEd18U8xeBeNhBcoBh7Rn/BF2nc=; b=jMLLBertMXsNA+tHdlQtMXZXjWPx7hUl0iCR9uaeRGUiIDXVOGRGXes4ZfmkpFBom4hLhcUu7kE9votZIT/24g/qJjCwqG6cnD6JOjKCmFw64v5DtEov9Y7Q1LEsQ00gGaEZ7YdY+4K5DVP9UNheJO0doXtkT91t9gccg3PQo9YEQ0dv4HGCN58+sh1Ve1YyunP5lv1BBxfQ/rd0739wokA3eyieXgRCpmrXxJZIEt+sUXhZ6cg5mlQNcIgBuDe7Ua5Td300QJ9LjOHb1VUPNDIdla8nQ38ckRjleACKsYy+LJMGNs1hKOo/s+mLtBe99HiENE756SXtYjDoQaFt8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.246.91) by CH2PR18MB3366.namprd18.prod.outlook.com (52.132.246.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.21; Tue, 13 Aug 2019 20:31:12 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::8818:7a86:93d7:561a%6]) with mapi id 15.20.2157.022; Tue, 13 Aug 2019 20:31:12 +0000 From: Martin Wilck To: "Martin K. Petersen" , Himanshu Madhani CC: Bart Van Assche , Joe Carnuccio , Quinn Tran , Hannes Reinecke , Martin Wilck , "linux-scsi@vger.kernel.org" , Bart Van Assche Subject: [PATCH 3/3] scsi: qla2xxx: calculate dump size if EFT alloc fails Thread-Topic: [PATCH 3/3] scsi: qla2xxx: calculate dump size if EFT alloc fails Thread-Index: AQHVUhYLUXzRWI/JRUeS69TkO7HK1g== Date: Tue, 13 Aug 2019 20:31:11 +0000 Message-ID: <20190813203034.7354-4-martin.wilck@suse.com> References: <20190813203034.7354-1-martin.wilck@suse.com> In-Reply-To: <20190813203034.7354-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0012.eurprd05.prod.outlook.com (2603:10a6:209:1::25) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:2c::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.22.0 x-originating-ip: [94.218.227.174] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2187d57a-dc59-42f4-0669-08d7202d2e3d x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:CH2PR18MB3366; x-ms-traffictypediagnostic: CH2PR18MB3366: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(346002)(39860400002)(396003)(376002)(136003)(366004)(189003)(199004)(71190400001)(6436002)(8936002)(54906003)(110136005)(76176011)(2906002)(66066001)(52116002)(50226002)(71200400001)(316002)(81156014)(81166006)(4326008)(5660300002)(6486002)(256004)(25786009)(3846002)(7736002)(1076003)(26005)(8676002)(6512007)(478600001)(53936002)(6116002)(486006)(2616005)(186003)(11346002)(14454004)(305945005)(446003)(44832011)(36756003)(66556008)(64756008)(386003)(6506007)(66946007)(66446008)(102836004)(66476007)(99286004)(476003)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:CH2PR18MB3366;H:CH2PR18MB3349.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LKdWYEAbZ8hwDqa4L6g3M7fe7raGSGWRPVjlxiQd2foqj7IPg9WKdy88twbTNox1DP+mNErKakgNRpFg2cSeTYRAGRS8FPykjyTtPaXInXG0Bj0wNDf6pfBduwD5xQf8GEw7DJlK9GMsVKY+QxCIRiCEosv0bQNdrmnfM6KrbaPzDReqDtujuDGmJT/J/HHLbSzlLHS8TBzZQJuzmCu8HiZc535Tte2IE5vtlwSirI2YkJ+aJvZ1QX5QdWxbQe6OEVxkgSs/6kc/FC6djHXWPMXwAN8Oc+EVx4JBrE1KYHn79jZYaYtgZEE6ibbnaMsReOsUYXCA1kiVHV7nWg2qqZiVhnuBncstz1yZDVPJvqzcnjjxoCZiW8WY6hS9jn1wyzReHuUszABSFq1DlJJXzX34w/kNg6MUQcKCWR8PsD8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2187d57a-dc59-42f4-0669-08d7202d2e3d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2019 20:31:11.9271 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6ZnmQMh2lTmTCNUU9DbNz8SiKIWLkKH0Xl5cKf7rvnPSLIXTwVBJ4LWsWZpcT1x/J60NoFQmU6B8/mxqy5yicA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3366 X-OriginatorOrg: suse.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Wilck It seems right to try and calculate the dump size properly even in the error case, before allocating the dump buffers. Cc: Joe Carnuccio Cc: Quinn Tran Cc: Himanshu Madhani Cc: Bart Van Assche Signed-off-by: Martin Wilck Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ca9c3f3..8427436 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3191,7 +3191,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) EFT_SIZE / 1024); ha->eft = NULL; ha->eft_dma = 0; - goto allocate; + goto calc_dump_size; } rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); @@ -3202,7 +3202,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) tc_dma); ha->eft = NULL; ha->eft_dma = 0; - goto allocate; + goto calc_dump_size; } ql_dbg(ql_dbg_init, vha, 0x00c3, "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); @@ -3211,6 +3211,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ha->eft = tc; } +calc_dump_size: if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { struct fwdt *fwdt = ha->fwdt; uint j;