From patchwork Wed Apr 10 05:29:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10893155 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 2B0EF1805 for ; Wed, 10 Apr 2019 05:30:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BBAA289E2 for ; Wed, 10 Apr 2019 05:30:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1726289F0; Wed, 10 Apr 2019 05:30:27 +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 8488D289E2 for ; Wed, 10 Apr 2019 05:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbfDJFa1 (ORCPT ); Wed, 10 Apr 2019 01:30:27 -0400 Received: from mail-eopbgr800082.outbound.protection.outlook.com ([40.107.80.82]:20544 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726693AbfDJFa0 (ORCPT ); Wed, 10 Apr 2019 01:30:26 -0400 Received: from DM5PR07CA0036.namprd07.prod.outlook.com (2603:10b6:3:16::22) by DM5PR07MB4022.namprd07.prod.outlook.com (2603:10b6:4:b2::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Wed, 10 Apr 2019 05:30:24 +0000 Received: from CO1NAM05FT021.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by DM5PR07CA0036.outlook.office365.com (2603:10b6:3:16::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.14 via Frontend Transport; Wed, 10 Apr 2019 05:30:24 +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 CO1NAM05FT021.mail.protection.outlook.com (10.152.96.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1792.7 via Frontend Transport; Wed, 10 Apr 2019 05:30:23 +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, 9 Apr 2019 22:29:19 -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 x3A5TJQR022168; Tue, 9 Apr 2019 22:29:20 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x3A5TJml022167; Tue, 9 Apr 2019 22:29:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 1/2] qla2xxx: Fix device staying in blocked state Date: Tue, 9 Apr 2019 22:29:15 -0700 Message-ID: <20190410052916.22129-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190410052916.22129-1-hmadhani@marvell.com> References: <20190410052916.22129-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131993478241020754;(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)(346002)(396003)(376002)(136003)(39860400002)(2980300002)(1110001)(339900001)(189003)(199004)(76176011)(36756003)(110136005)(68736007)(85426001)(50466002)(1076003)(6666004)(97736004)(53936002)(69596002)(54906003)(5660300002)(14444005)(26826003)(36906005)(316002)(42186006)(80596001)(305945005)(16586007)(15650500001)(4326008)(356004)(48376002)(498600001)(76130400001)(486006)(126002)(2616005)(336012)(8676002)(86362001)(81156014)(446003)(11346002)(476003)(51416003)(81166006)(2906002)(26005)(106466001)(47776003)(87636003)(8936002)(105606002)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB4022;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: 67156c9c-ce21-42f1-ef97-08d6bd75a1a8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600139)(711020)(4605104)(2017052603328);SRVR:DM5PR07MB4022; X-MS-TrafficTypeDiagnostic: DM5PR07MB4022: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00032065B2 X-Microsoft-Antispam-Message-Info: rTlJhk1+i93YpgLBAhwQxmCo5FQcb0SoBmD+wsIBQrtA9xcyehXiBm9LCK1vSkvsTYYJ5NjX2e8lZPYE7xu40Kh1uid3RXO5Eefa98JTHU8H+llPFHG9/ORZWlE5dVUfYJEfFyuM/l5a7/OrE4B/duN4qTNU+JcfqL2GkzFhbRqw3nDqhdTJ/xSuJHcG0KEo+S7cz7H4rMZCw4MsZ+OgriGZXvMKFr683Kq2ioisDOSnZx4MgSOSuwkCjBd0qTszM6bsRN7R3C3XizhF68uUg7J9xixTA4uviSiuQNb1NkpVZYiTErf1xccpSJBldm3C/tG1PsHOTl1wujqfJJ9sP/Oy28Fj6r5McbdA4nM7IgQ2+LU184AF4U/fZKuraurLh8htGkkpRy21WiJDURBrvhxZO12JJD0ZG1IcvHz+4sA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2019 05:30:23.7608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67156c9c-ce21-42f1-ef97-08d6bd75a1a8 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: DM5PR07MB4022 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 discvored that after some event in SAN if 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 --- 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 582d1663f971..697eee1d8847 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -980,6 +980,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; @@ -1160,8 +1162,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;