Received: by 10.192.165.156 with SMTP id m28csp61919imm; Tue, 10 Apr 2018 16:25:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+6j0jaXs1Q3gN+YUH3OYTIWN+AMQVwQmQK4bQ/3mSJZLtJtNaZ6XuyT49pN5hz4i9onx+B X-Received: by 10.98.223.16 with SMTP id u16mr1980071pfg.146.1523402744859; Tue, 10 Apr 2018 16:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402744; cv=none; d=google.com; s=arc-20160816; b=s5S2dVIPAELXTDBwLMHRfo+eaxaGJGM7UAcPSPKBh4FT/gQh6Q/60hq2aprQvVSHmb r7I4aOsW4obNpB+ClWM4mx/cKvJfbxvZmWU+RVDDUKdqQkFlmiuJZ3BP8J1VFxngpmgm 7jqnX8mwzwI8yKrz/JHaHzlloOlmH9pMvWr1ryt5ktPGlrTm3U3kMBo3in0T1i5Cy4Le 5Afrxhz4vewbx2ZWuowG9BN9OXBKDwA9/cN4XftWsbhlEGrVfz4X5IBsrpYHwfb107Wb ylG5GF0pmZ/343tgJ19rT4YNhfkc3blxMEgxv0xgcEEfC8dEmLirXZPJ6nibDFBNNCVk NAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+Elct+Py373ddh0UqVGzIEqYgHKdWnM/7Clk8vdQNgE=; b=L8tZduiOYFrI09Vcq6uvJsrj2r9uffrG8mdagO+l09OXXqUgVZo4mSI60yXSOLdtTv u+cWqGO912M3E7xNiut98Q4hnf8agFwUor2srZUWNo2f4RgLLWdhqUmuvtrcCVmefo2G 6Ul8/OJRcWLcSPAb/J7ZdR5exi8YlKlpUS6c94u16PUnbCau641+mvQgxNvicLiL7gw/ AHUsbhlSuIcmze+5vZE5ypIOB50a7pI/Mpgxu58m6vQxpXk38aTaJzdpkkzMBQR74Op3 21zAkGhyb83hhkYTAMncU3wI7a0mj2cItGYINkNV2fyLm/N9DIdrpllSa099nI35nPwN wEQg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8-v6si3434196plb.554.2018.04.10.16.25.08; Tue, 10 Apr 2018 16:25:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752750AbeDJWaz (ORCPT + 99 others); Tue, 10 Apr 2018 18:30:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40184 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbeDJWax (ORCPT ); Tue, 10 Apr 2018 18:30:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F08BFDF6; Tue, 10 Apr 2018 22:30:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sumit Saxena , Shivasharan S , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.15 095/168] scsi: megaraid_sas: unload flag should be set after scsi_remove_host is called Date: Wed, 11 Apr 2018 00:23:57 +0200 Message-Id: <20180410212804.293649500@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 pc u32 pd_seq_map_sz; instance = pci_get_drvdata(pdev); - instance->unload = 1; host = instance->host; fusion = instance->ctrl_context; @@ -6833,6 +6832,7 @@ static void megasas_detach_one(struct pc if (instance->fw_crash_state != UNAVAILABLE) megasas_free_host_crash_buffer(instance); scsi_remove_host(instance->host); + instance->unload = 1; if (megasas_wait_for_adapter_operational(instance)) goto skip_firing_dcmds;