Received: by 10.213.65.68 with SMTP id h4csp1854068imn; Mon, 19 Mar 2018 15:18:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELsfamu6GAUiVtXM2LDGMd+PgDEi7aMomsjiGI2Q5IOkqme5mwdBGOQ0HRetiNvRM8RSsTLY X-Received: by 10.98.166.14 with SMTP id t14mr5870009pfe.195.1521497881445; Mon, 19 Mar 2018 15:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521497881; cv=none; d=google.com; s=arc-20160816; b=uftCJMW0YA4b11G9yJzD06eUlNbqidnhKnIYEVmyuateiwhHDqxtOX13AlEoIy8B95 VnXM53k/6SmrFkNzm6lcM1PAg9cKFtoCjFgXJDWJsCuqnI/uqF8I8RALeF36ceSSkY8w +cX62+H/UwDEKh4eHkI4+4Nv1A2mm+FC769qRYUGsIm+ov6mjnsxI0aMPIX0CcHyd5zw ld4gJURV6eVS6SLaKqPKX/bDdZsw/5SeBdnVvBgBBWlLbxeEJK/hURqWVWyOFiblzvG2 NfvBFFw/QnvtgYfU72fs+sv4ZjECppX6TXdOKVRjcbNbnHZTM+Mldz/YgR1F9JBxSupn aT1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9p8TIv6kZRZeKQeJYAT51YjTAiILu7XzDiQZpEL4M7Q=; b=swRJUvgMZwGftEFbzhXmQUuwRJLJpJx48+eKJCrC9NMXlSwcKIY2iPRyINIJ7RSRQ7 bITOXqniiamAtGVEx722CrTIRDndPWkIkoML7V8B63R11k4CrOWI6oT4+fLDb9QvyUIf ZDCk06aWCURAqqALwITT0czrkuBgVdAW2ONLkdOU6uazi7DyzSku2rVoA/z5bYOnmDn6 csJy0wXZcWIQRlKAwW0Bmle3UdejSKzvTwJQHC0FLR/2C3S+PFywBfupbY8/RPocuahW eI5zww+g3ZdKWxvorwjOQrQ4rXxwS+DrLa34f9aWDSdbhEp5zCdaUAYG89FrnShPepwa u/JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=dTMrDFd1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si146120pgp.16.2018.03.19.15.17.47; Mon, 19 Mar 2018 15:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=dTMrDFd1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030479AbeCSWPk (ORCPT + 99 others); Mon, 19 Mar 2018 18:15:40 -0400 Received: from mail-by2nam01on0114.outbound.protection.outlook.com ([104.47.34.114]:57771 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933430AbeCSPuD (ORCPT ); Mon, 19 Mar 2018 11:50:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9p8TIv6kZRZeKQeJYAT51YjTAiILu7XzDiQZpEL4M7Q=; b=dTMrDFd18KyVOaA8ytO2HMdfBxLrGxjzcY42rSaGn3YaplsnAE024vjU+c9ifuS+7Phs6dEZwraDKpxQwdGwQ/rKYl0NQoaG0mOuXrqwsrqmg+gNGt7cNmgjVZOjy/dW0V3Zat8dxDiq5ulgzu36I0xMiaaGqr9Yru4F1gIITrs= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1109.namprd21.prod.outlook.com (52.132.130.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:45 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:45 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Shivasharan S , Sumit Saxena , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 107/124] scsi: megaraid_sas: unload flag should be set after scsi_remove_host is called Thread-Topic: [PATCH AUTOSEL for 4.15 107/124] scsi: megaraid_sas: unload flag should be set after scsi_remove_host is called Thread-Index: AQHTv5nL5+KrWPvNrU+IhEnDFAIzkA== Date: Mon, 19 Mar 2018 15:48:59 +0000 Message-ID: <20180319154645.11350-107-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1109;7:ZfbZ8j7zn36FUMVQVvtNKRirlp1z/8hBs9EdKYa6QRjhaJXZtbdG6GkdYDRW2XKF9vRySX/i+8ychmc98TGQTVyFPHjGMVUZ4S5FwCUA5Q7R676IpvdcSWXHmYmJr33nQOuM+1k9/bnQWrXdO7h7nnwgWcnAFGOKReoPJryZQPOtzBBtNN/c3VuV2+H3IbzXOgfxsTDTERXs0v+7veuP7B4Q39yD7gHynsAw/6EE0i1fXcOVh9J7aFbVsqBeJoLt;20:X03rKN+yQ7FYv1cHxO3lov/Y+LGfKsJCR0WnTI4skaEc85C/zAQQ6d818fcRoTeMd6CxlD75jC7HGtysED0mwCnYnkeNy4zPmMmIVxazWvVI0pJqX0rXrELDd5QxYZCk7pCdD+V7voe8we5SGNnvhg+MrvHAB4DjVR87uI6qtP8= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dc33ae19-40ce-49c8-8ed3-08d58db109e8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1109; x-ms-traffictypediagnostic: DM5PR2101MB1109: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1109;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1109; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(376002)(346002)(199004)(189003)(81166006)(10290500003)(107886003)(81156014)(106356001)(6506007)(8676002)(3846002)(36756003)(8936002)(97736004)(6116002)(1076002)(102836004)(68736007)(6666003)(3280700002)(2950100002)(3660700001)(478600001)(72206003)(59450400001)(2906002)(14454004)(76176011)(66066001)(6512007)(5250100002)(10090500001)(2501003)(53936002)(6486002)(6436002)(26005)(316002)(22452003)(305945005)(7736002)(4326008)(25786009)(86362001)(86612001)(5660300001)(2900100001)(99286004)(54906003)(186003)(105586002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1109;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: opbFs+bBsptO19H8IYWz1Rdsp/+sVAz6wrfbE+0gySVu10ZEJnCNfWH51dxPSK2KtPx9EclLk3aAVUJtA+IMSBVEMo+Sw/GcRC68Rh55YdhDbkF5ukQdRS96M6RAc06G0wHCmj4TNPjAnHKazqX91uW7ufpO7aclcR4NnUuAK24GR/C1ch7qAJGJVzCO5PZ+kdIPeC8jAjVkpLNq4o+I0FPK8j8I5DRqvsTQeIOZCLbvf6t1j6Sposc1mGO4SqebOzsYjQNHJA7Gedyie+a3TQrJSZ4dtdmdyePHlHxclDeGUQBLO1sSe3s+jwXhp/CXDKqpXetbOU32kvK2hKlAjw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc33ae19-40ce-49c8-8ed3-08d58db109e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:59.4973 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shivasharan S [ Upstream commit f3f7920b3910171b2999c7dc2335eb9f583e44f2 ] Issue - Driver returns DID_NO_CONNECT when unload is in progress, indicated using instance->unload flag. In case of dynamic unload of driver, this flag is set before calling scsi_remove_host(). While doing manual driver unload, user will see lots of prints for Sync Cache command with DID_NO_CONNECT status. Fix - Set the instance->unload flag after scsi_remove_host(). Allow device removal process to be completed and do not block any command before that. SCSI commands (like SYNC_CACHE) are received (as part of scsi_remove_host) by driver during unload will be submitted further down to the drives. Signed-off-by: Sumit Saxena Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megar= aid/megaraid_sas_base.c index cc54bdb5c712..d4129469a73c 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6822,7 +6822,6 @@ static void megasas_detach_one(struct pci_dev *pdev) u32 pd_seq_map_sz; =20 instance =3D pci_get_drvdata(pdev); - instance->unload =3D 1; host =3D instance->host; fusion =3D instance->ctrl_context; =20 @@ -6833,6 +6832,7 @@ static void megasas_detach_one(struct pci_dev *pdev) if (instance->fw_crash_state !=3D UNAVAILABLE) megasas_free_host_crash_buffer(instance); scsi_remove_host(instance->host); + instance->unload =3D 1; =20 if (megasas_wait_for_adapter_operational(instance)) goto skip_firing_dcmds; --=20 2.14.1