From patchwork Tue Apr 23 21:52:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10913777 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 C55981575 for ; Tue, 23 Apr 2019 21:53:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6E2728931 for ; Tue, 23 Apr 2019 21:53:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB5EE2893D; Tue, 23 Apr 2019 21:53:50 +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 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 53BC928931 for ; Tue, 23 Apr 2019 21:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbfDWVxu (ORCPT ); Tue, 23 Apr 2019 17:53:50 -0400 Received: from mail-eopbgr770058.outbound.protection.outlook.com ([40.107.77.58]:31966 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726665AbfDWVxt (ORCPT ); Tue, 23 Apr 2019 17:53:49 -0400 Received: from BN8PR07CA0026.namprd07.prod.outlook.com (2603:10b6:408:ac::39) by BN7PR07MB5361.namprd07.prod.outlook.com (2603:10b6:408:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.14; Tue, 23 Apr 2019 21:53:47 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::204) by BN8PR07CA0026.outlook.office365.com (2603:10b6:408:ac::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.12 via Frontend Transport; Tue, 23 Apr 2019 21:53:47 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1835.12 via Frontend Transport; Tue, 23 Apr 2019 21:53:47 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 23 Apr 2019 14:52:38 -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 x3NLqd6n013703; Tue, 23 Apr 2019 14:52:39 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x3NLqdKE013702; Tue, 23 Apr 2019 14:52:39 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 1/2] qla2xxx: Fix device staying in blocked state Date: Tue, 23 Apr 2019 14:52:35 -0700 Message-ID: <20190423215236.13664-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190423215236.13664-1-hmadhani@marvell.com> References: <20190423215236.13664-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132005300273581885;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(1110001)(339900001)(189003)(199004)(76130400001)(87636003)(68736007)(498600001)(2616005)(126002)(76176011)(36756003)(486006)(11346002)(85426001)(51416003)(26826003)(476003)(110136005)(54906003)(305945005)(316002)(16586007)(42186006)(26005)(4326008)(36906005)(14444005)(2906002)(8676002)(446003)(97736004)(336012)(53936002)(105606002)(5660300002)(86362001)(8936002)(48376002)(50226002)(70206006)(15650500001)(81156014)(70586007)(50466002)(6666004)(80596001)(69596002)(1076003)(47776003)(81166006)(356004);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB5361;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af522bd2-2d84-45e2-1a10-08d6c83629bd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600141)(711020)(4605104)(2017052603328);SRVR:BN7PR07MB5361; X-MS-TrafficTypeDiagnostic: BN7PR07MB5361: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0016DEFF96 X-Microsoft-Antispam-Message-Info: sX0ggeGTQdmhZ4Fn7/jRAsSJVP0YRI5PBBs+JDWFINszyzme7mMvP27i7fLGwwVt5WvKbsCRWA4RGKFn3Ysfl0nOGik9XpkmOJSEgCUiFbMkwsavJ06GtYnuU9l2wgt1QWiVKMoYahhmtNRWrZ/YEeVpbQSly45SDyvDwMXcNWQNvJbZoueoYd3kzrZEYeFIeoe6Sy0fcOQ77S1JIpwc3XYXCEXE3UE6nb1wxvz4HvNAOD78ToNGHBX+wGEwXmbUqVYX7OGJkmfRBeK+3MWrBXRid35AQWocebiEqPf2I/qCJOWnuVOdBgi1kdLIG2LYcpmc+ljL8C51CsUlOS2CULvujyzzFDBjpfETiDluWxTocc/ys48RS8JIUWhLjXJud3Yho3TnM/F1Xme5HG6itYA/VEfzgIn33r61kCKPtIw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2019 21:53:47.1039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af522bd2-2d84-45e2-1a10-08d6c83629bd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB5361 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 This patch fixes issue reported by some of the customers, who discovered that after cable pull scenario the devices disappear and path seems to remain in blocked state. Once the device reappears, driver does not seem to update path to online. This issue appears because of the defer flag creating race condition where the same session reappears. This patch fixes this issue by indicating SCSI-ML of device lost when qlt_free_session_done() is called from qlt_unreg_sess(). Fixes: 41dc529a4602a ("qla2xxx: Improve RSCN handling in driver") Signed-off-by: Quinn Tran Cc: stable@vger.kernel.org #4.19 Signed-off-by: Himanshu Madhani Reviewed-by: Ewan D. Milne --- drivers/scsi/qla2xxx/qla_target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 57cdd762230d..fc8914dd9dde 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -982,6 +982,8 @@ void qlt_free_session_done(struct work_struct *work) sess->send_els_logo); if (!IS_SW_RESV_ADDR(sess->d_id)) { + qla2x00_mark_device_lost(vha, sess, 0, 0); + if (sess->send_els_logo) { qlt_port_logo_t logo; @@ -1163,8 +1165,6 @@ void qlt_unreg_sess(struct fc_port *sess) if (sess->se_sess) vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); - qla2x00_mark_device_lost(vha, sess, 0, 0); - sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; sess->disc_state = DSC_DELETE_PEND; sess->last_rscn_gen = sess->rscn_gen;