From patchwork Wed Jul 18 21:29:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10533321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 018EC600F4 for ; Wed, 18 Jul 2018 21:30:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E544629A0F for ; Wed, 18 Jul 2018 21:30:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D93B029A37; Wed, 18 Jul 2018 21:30:08 +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,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3A95929BA1 for ; Wed, 18 Jul 2018 21:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730511AbeGRWJy (ORCPT ); Wed, 18 Jul 2018 18:09:54 -0400 Received: from mail-bl2nam02on0089.outbound.protection.outlook.com ([104.47.38.89]:52672 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730524AbeGRWJx (ORCPT ); Wed, 18 Jul 2018 18:09:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=REIWPVv21xLL6vsIJ8k/c2zClRgB1Fvh7qmEj+bHqB0=; b=Ltjasgr9/e8x0r35PdsASuL7xLfnvncvmU72CUK3ByZ7dMeGe2oHKcatQBeCOzrbU3iLM3QLhaW17AzqeXu3VDybl3R+KQMtzLQ1eqToUXXVarTRKOMjn28TmThEjbtnnuJW4RsQ1pS/r1FllVCp4v0YixlQMyqh0ayNig3xqe0= Received: from CO2PR07CA0049.namprd07.prod.outlook.com (2603:10b6:100::17) by DM5PR07MB4072.namprd07.prod.outlook.com (2603:10b6:4:b3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Wed, 18 Jul 2018 21:30:01 +0000 Received: from BY2NAM05FT008.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by CO2PR07CA0049.outlook.office365.com (2603:10b6:100::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 18 Jul 2018 21:30:01 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2NAM05FT008.mail.protection.outlook.com (10.152.100.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.995.0 via Frontend Transport; Wed, 18 Jul 2018 21:30:00 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 18 Jul 2018 14:29:57 -0700 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 w6ILTu4B013497; Wed, 18 Jul 2018 14:29:56 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6ILTuSm013496; Wed, 18 Jul 2018 14:29:56 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 3/5] qla2xxx: Fix driver unload by shutting down chip Date: Wed, 18 Jul 2018 14:29:53 -0700 Message-ID: <20180718212955.13450-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180718212955.13450-1-himanshu.madhani@cavium.com> References: <20180718212955.13450-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(39860400002)(376002)(2980300002)(438002)(189003)(199004)(4326008)(87636003)(478600001)(72206003)(54906003)(42186006)(2906002)(2616005)(476003)(126002)(11346002)(16586007)(186003)(6666003)(106002)(44832011)(106466001)(110136005)(486006)(80596001)(316002)(36756003)(47776003)(48376002)(50226002)(5660300001)(50466002)(305945005)(1076002)(336012)(446003)(69596002)(575784001)(76176011)(356003)(14444005)(81156014)(8936002)(81166006)(86362001)(8676002)(26005)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB4072; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT008; 1:pWlLu1RIVwF/+56j4NwQq/DK9pEcI/HNYd12xyOUVMBzOlry1IZLhk5XDtldvR+z6ImVTBBQIpVLfmjUfEcSIhEqntk8IkLQ9sAo8EO6P3TvUaTpIEsVK3wjhfK5QUGi X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ccd93294-7c1d-4b5b-c527-08d5ecf59e66 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600067)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:DM5PR07MB4072; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB4072; 3:l64z1ySe6YJQM9SrbbYzLSnheLAM547WR8ujAW577sSlCVVncoi/amhbaWrQGe2hnmAWCsq/Be3Yr/Lw4dG06cgvkgFj+Dgojki4rtAhVjcsB9zJ/SsCpSoGOnK9b94QUpDwDBtM4p4vvIMirw+cwfXOVeHlrH1hVGFFVXGrk2JLq6AnYHgZLg7+6XtRLIHvVwip8jOR1Gho3WhWPjM6ki1zN3GAltkZpvzIChI7l63bFQLvPVoHgZYg5NHG2O6tmR6WMVOSF/CYEwrWOa9CpITzfbYycJa3dd5hgTQHAx5B34jsUpuxzgmSYSQk6sdTFXadocMXV+2kMlcQeQpX1tyXEhhxmlvVdjfiROokDKE=; 25:M9k1MAKDZeh0RBGtu6EG1o1BhTGzIFdFP12nZT2OHDcTfKHfTwYPTHdulkFZqWxglsNFU2SJ9GPMuYSCluCUFQjpxHtEX01NcUVRCsSXNyPZOcBPB81KQodkADCEysz2AOVpHrd28r21bM3VZlmJ4lcb19ZDGzIYiUSGIaq/0b+5YYs7zHyC1BIcrR4p8tYZcTe2B15AEoNrjLBDN5OxCQ7BUJqXd2wiyFDQ4QRwAZonNCxWPzVPj2dg2CJUfUmJhBREC4y/Yo/Bdze17HjmUA85/yvaojj8beFKcBClM2JjJ4rAcc0ydIAzu+bLTS89dyKi1flnrWP8woCaArIYVw== X-MS-TrafficTypeDiagnostic: DM5PR07MB4072: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB4072; 31:Nyf2gRjSJHxiA0b7cNpQqX85QMEtfyc/3QbJS+BOswhgdbbcjQpjAgRL5QQ2meBFUNscLlpbpr7RtAm7lqpqDkiETDuiL4PI5f00I/zIBGD8925UMA9yjIaYDtN+ikWvQnHLfC+YEB3nCmr6aa4eRnHcnl6PMIrHipJ5WAbY3cXg9vjZvjMBzLKW3UGg+0eV65EXgn/ITu5JggNtTLeZqVsO0Bs70k4uiV2ZLtEqO8Q=; 20:NF1S7K8GExpbkh3VOinU9+AkHOPoX4bUeFNMuOlE3Z+909S4/8OwZj9ygR6vxgsk+RaWRQQC0V+x1JtiulNls+zy8LGhEVa9zz8DOajW1Rq5G6tfwlpdkcUdiUWCa18EiZ+kvi4svznAtW3g/RFXi0s9ZWbMcdvo6YY+kbZTNfNPKk3Lw6xzwtjlwEFfxaeKNnDk40d05aQrKrDhehMMSKkbWGXG6mmp1h8yOOMOURct+D0W99aiQ3/Jzixp6lYkc5ZwzkkdIxiUMwG14OCJXvxaOJL+SuYrKZZAhauoAvzxFvvfUk44SmemFyjJV3yYhqtYpBotmC9ql4tc3ZyMQg84brCXnY8XGJ+0gZ0n8whkO1A8E0RFSdsAMsfNR5K6PR+YiY80Vd+TNGdi0t+8BZsc5e4XEez5zvkILkVZqTUICJ+0wYxL5oRJeH/O0L4ocTJOyISFyQJ6l7ybmgawB7lN74etn8ezkDggCAef/1TuNc7hu1J2g77F//rEHdrz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DM5PR07MB4072; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB4072; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB4072; 4:rNhe6pp9FYRagQViYdl4IArGKDq68JTBQ58WmkFO6pCDPRPDrP4lA8N9K/9bNqMlz0UjE8mYI689i02z/8fGWcmtMdLMvo8PwyEV+D2wLPoG5vhXR2izdLdzvvHQwHurK8bPIckFfglP+XS4dPKUUyXWpbdnG/NbWmdls9C9MFrfBChRdaV20VokaGqulwxciJT590/gUm+zexf8GrJzXn5lIZLcWfcgmxmysURB3MxlUhpHANTSew+AXb2nE2HKcpntsyU/qLe0uMhQ21WYfgIppdvCOtYPcnlYY6SmKIhXPZEBLc8QAWx7ahA3V8R81T1G13NKSI8y20kscoNMZugb1mCmN3kz3qDYLJ5bJK0= X-Forefront-PRVS: 0737B96801 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB4072; 23:jTgMTixoprb9bjqf3GasEZLU/XhOlJY0RSI2TFv85?= =?us-ascii?Q?lv9wnehXLtlZkCEK+VJ2Y7VcdgrOpAggW0iZgQ4WN9j7QaV4Ob2gaKavTxnF?= =?us-ascii?Q?oqgwBqhhUmt5G0/chACUKAHEuF/MxPu+KbWYpJX16iDMyhuNwP4ITe+hTcoT?= =?us-ascii?Q?M/i1YxRa+vaZkj3xaCPOKBBkjQcwkLU/MIBZPNlpO7N/fLb2MWaa2TR90HEe?= =?us-ascii?Q?wQYfOTxt73d0ZWczIg4PU6aeJyJHgIPgdx5nSFuNI9yfex9TaOV0trLUgX+b?= =?us-ascii?Q?7De2bAjT6tlYjV+ShoizzH/CN1NRSxo9hcSEcHw6TaB+9a00DXAE31pe3rTj?= =?us-ascii?Q?gWSCZRoJehSW8aPvg+zG0zVVtlUTKEyR2v8X1CPSLCX08SLDfpnMI3r+RiTB?= =?us-ascii?Q?9TwtlgcY7kJEw+Wq51JYBYyxTG2LKtkNk5229fNNE1Fbr+RN81PaR0TzdDPU?= =?us-ascii?Q?ljMU0ieE6B6ti/MbRRxSnQ7fOzHirFT10bB1r0617PmKtiUF4XsyVtybItyb?= =?us-ascii?Q?FdMfwNJ2XcHYn5EdI+sOUNRtHqmPXtHEWAU0gxWSwoVPmryRIh4eyAIS3qwz?= =?us-ascii?Q?R3BowktZgl+07c4zqLc8IoEHme08UlBm3SC03JZGIzMIGNxrNZ3e1hnrVId3?= =?us-ascii?Q?hYx6v89ccLQt2XMDq/QZbN5rcTX5bpE1S+ZmU+VfkMWXPpKI36cLDBySdz/3?= =?us-ascii?Q?PbdsG9z6bYbcjQeJnqeUxbkxzs31oZ4ysjdGdPfwiIbDdgEsE733ZE0lcecm?= =?us-ascii?Q?hR2UihGkseFvt7W+QaCm4q+1tQ6/1qhqXC5nx4+ypyr3yaWnwjBgAC5VcFUv?= =?us-ascii?Q?2oZtC05WtY6wGXsxMjFnvKOsQUXT7dqHtVRiEj0xbAPTdI1RLDvnP1aoT1iF?= =?us-ascii?Q?6pF3NPqtq0vhT1CNhsTOLs2m0a9uByLMMXaKiX/ukK9WOWlPwurDL7wdBR6F?= =?us-ascii?Q?sWd8CcykbP8gWBGXilYLIP1zWLGRov4GwxKg2jD5TB//Y4LbFwTy1xUKSy0X?= =?us-ascii?Q?xlAecGISl5KxYm0KlmgqA25tuTGMFyc07qByVMAVlpFfzMPFDje/OW5E0imk?= =?us-ascii?Q?Fzb+G6wo8NiaQBlzQCBt3zAO6HR2ULbn1A/hyXWBu3UBu/Ve+pSD2tcHOj2l?= =?us-ascii?Q?B/aM4aID4Nkbh4WjwRf6NvNjE0T52HM3k2bcCMdk8cj5EqOtKdpUQ=3D=3D?= X-Microsoft-Antispam-Message-Info: o86Ku6zbr8FIkkrVIll5G25TWFFoJNAXavKUQxP47Wu0xZjHPKHN+PNb1kNfsRkIutI6KiJy60FPPXhG2Noy6+Ae00m1wPL+/OCO3O/FeJi0VA4ETJD9SxvyK2Y4hWkdzSFQjIrFIPAZeSriKxOp/4gn8NZhgH4MMWx4MJIPuxuQ20HTJ9K4w87Ee3boOk1M7anmSI9tvOmtXoSzWfp+HAf5bB48N2+/rBi5/GhdyBl0itoazfxsOlRWhg4e0ppSTyqTH3msB0MyR0jhCTHeO/raZtN5WvNtPHoQdqEhtZnaXdDeQe/bIruqQDvJ2949dzqCrBuzZxUUYbf4w8IGe+fHIMlwuh8oDLGGTR2I3ZY= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB4072; 6:l6LttqbnUCqGqBifpo71jbwGUXLDdkMdojCAD77VgOBcdGS+gORU9PX/Qkg6gebbNF8T5LEAJoQb42liopBZk8AkCWA8QVfAJmKhaGKBPuns2sbGVtAYuck3kd8sdTxJUQ+fhd/G7eAqtNCIC4DRUgf5x6+l/lHXbWfpcmdg+gVvTeV5MRhu9pRMETnWd4JA2eXJh002NBQJE59liOQY6XDLnxoOx3OUuB6ABoKitPt1N8xfiM1XJbbQyyBrK5++RmlJZlhh/eYQNIO9f71S1NFgh38uTLlIumPZP7dvAj/AH3J6yOoy+QhEIwKa3JNYdPL5qiZKjg8JOqXvEkltQ0+mSRUeRJZfiMPiX7ysT5p+4+bur9cD/6nd2P/n6exJyBFf7wjVncxvmApaVDQLYvA5Qk1kfbNOqkUn6P8bl/qdluatTC9odMxBVS16y6tsm+65K8YfETx+YkFg2ABSrg==; 5:QeroRJ78ep++CGzv0QMDdG4KQ7f34T/tumYS9Tul88Da0XUso6C1J85PSHiBbAAiMJbxM9AURW16LwKj+HDXFpF62dyI4ULfSvD0dSTfMUfDCyoLI5wXLAd85cCLfTD8TCidciT/YL9svTDIjr2+Ms7q+m3winMLhegkxrsmnP8=; 24:vMrvVh9CN3HgIJ8KCGnDxh/3mvDPaiKkFb8/P0MBuS+8CEY9sdxZus5XoqFsdGi/DOhMpCaOE/9ysETrzfMVpduiNhiNqefMaQvwZ2ugfnY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB4072; 7:Uypq+SfxVK0ZZqXxoypDqUFiGL3QdPfk9rRbvnsYKQabghDHiluIMmsxyMBKuJYCSKzIFLEEzzpMb5/6emhUqL49immJa07GTDHv+VcRA5mT18vLy+hOQZ8vVFOVYfz/YqDVHkVOO974fJbauD/NsRr0O/UQWF8HzImV3Dgj1CuJuKB4xdMC6OFH2MQ9YWkjwmQdqn0Bjr2mwpC3svV5viJctMa7xk3uA8w2y46DUza2XKpjSjbRMXDSGimRvOcr X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2018 21:30:00.9439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ccd93294-7c1d-4b5b-c527-08d5ecf59e66 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB4072 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: Quinn Tran Use chip shutdown at the start of unload to stop all DMA + traffics and bring down the laser. This prevents any link activities from triggering the driver to be re-engaged. Fixes: 4b60c82736d0 ("scsi: qla2xxx: Add fw_started flags to qpair") Cc: #4.16 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_isr.c | 3 +++ drivers/scsi/qla2xxx/qla_mbx.c | 6 ++++++ drivers/scsi/qla2xxx/qla_mid.c | 6 ++++-- drivers/scsi/qla2xxx/qla_os.c | 44 +++++++++++++++++------------------------- drivers/scsi/qla2xxx/qla_sup.c | 3 +++ 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9fa5a2557f2c..7756106d4555 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -631,6 +631,9 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) unsigned long flags; fc_port_t *fcport = NULL; + if (!vha->hw->flags.fw_started) + return; + /* Setup to process RIO completion. */ handle_cnt = 0; if (IS_CNA_CAPABLE(ha)) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7e875f575229..f0ec13d48bf3 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -4220,6 +4220,9 @@ qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req) mbx_cmd_t *mcp = &mc; struct qla_hw_data *ha = vha->hw; + if (!ha->flags.fw_started) + return QLA_SUCCESS; + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10d3, "Entered %s.\n", __func__); @@ -4289,6 +4292,9 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) mbx_cmd_t *mcp = &mc; struct qla_hw_data *ha = vha->hw; + if (!ha->flags.fw_started) + return QLA_SUCCESS; + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10d6, "Entered %s.\n", __func__); diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 2c1aaf9b7a00..aa727d07b702 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -152,10 +152,12 @@ int qla24xx_disable_vp(scsi_qla_host_t *vha) { unsigned long flags; - int ret; + int ret = QLA_SUCCESS; fc_port_t *fcport; - ret = qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL); + if (vha->hw->flags.fw_started) + ret = qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL); + atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); list_for_each_entry(fcport, &vha->vp_fcports, list) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index acc27808963c..2cd2e5ccce15 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -303,6 +303,7 @@ static void qla2x00_free_device(scsi_qla_host_t *); static int qla2xxx_map_queues(struct Scsi_Host *shost); static void qla2x00_destroy_deferred_work(struct qla_hw_data *); + struct scsi_host_template qla2xxx_driver_template = { .module = THIS_MODULE, .name = QLA2XXX_DRIVER_NAME, @@ -3603,6 +3604,8 @@ qla2x00_remove_one(struct pci_dev *pdev) base_vha = pci_get_drvdata(pdev); ha = base_vha->hw; + ql_log(ql_log_info, base_vha, 0xb079, + "Removing driver\n"); /* Indicate device removal to prevent future board_disable and wait * until any pending board_disable has completed. */ @@ -3625,6 +3628,21 @@ qla2x00_remove_one(struct pci_dev *pdev) } qla2x00_wait_for_hba_ready(base_vha); + if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha)) { + if (ha->flags.fw_started) + qla2x00_abort_isp_cleanup(base_vha); + } else if (!IS_QLAFX00(ha)) { + if (IS_QLA8031(ha)) { + ql_dbg(ql_dbg_p3p, base_vha, 0xb07e, + "Clearing fcoe driver presence.\n"); + if (qla83xx_clear_drv_presence(base_vha) != QLA_SUCCESS) + ql_dbg(ql_dbg_p3p, base_vha, 0xb079, + "Error while clearing DRV-Presence.\n"); + } + + qla2x00_try_to_stop_firmware(base_vha); + } + qla2x00_wait_for_sess_deletion(base_vha); /* @@ -3648,14 +3666,6 @@ qla2x00_remove_one(struct pci_dev *pdev) qla2x00_delete_all_vps(ha, base_vha); - if (IS_QLA8031(ha)) { - ql_dbg(ql_dbg_p3p, base_vha, 0xb07e, - "Clearing fcoe driver presence.\n"); - if (qla83xx_clear_drv_presence(base_vha) != QLA_SUCCESS) - ql_dbg(ql_dbg_p3p, base_vha, 0xb079, - "Error while clearing DRV-Presence.\n"); - } - qla2x00_abort_all_cmds(base_vha, DID_NO_CONNECT << 16); qla2x00_dfs_remove(base_vha); @@ -3715,24 +3725,6 @@ qla2x00_free_device(scsi_qla_host_t *vha) qla2x00_stop_timer(vha); qla25xx_delete_queues(vha); - - if (ha->flags.fce_enabled) - qla2x00_disable_fce_trace(vha, NULL, NULL); - - if (ha->eft) - qla2x00_disable_eft_trace(vha); - - if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha)) { - if (ha->flags.fw_started) - qla2x00_abort_isp_cleanup(vha); - } else { - if (ha->flags.fw_started) { - /* Stop currently executing firmware. */ - qla2x00_try_to_stop_firmware(vha); - ha->flags.fw_started = 0; - } - } - vha->flags.online = 0; /* turn-off interrupts on the card */ diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 04458eb19d38..4499c787165f 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -1880,6 +1880,9 @@ qla24xx_beacon_off(struct scsi_qla_host *vha) if (IS_P3P_TYPE(ha)) return QLA_SUCCESS; + if (!ha->flags.fw_started) + return QLA_SUCCESS; + ha->beacon_blink_led = 0; if (IS_QLA2031(ha) || IS_QLA27XX(ha))