Received: by 10.192.165.156 with SMTP id m28csp40168imm; Tue, 10 Apr 2018 15:58:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/v0CdnPQOXz69A9et6j+lcRP2xSwv/+sYnJvLEYcKF5vZp8f8riHClSrka5Q5XzJBJSS7T X-Received: by 2002:a17:902:bc89:: with SMTP id bb9-v6mr2294251plb.285.1523401128185; Tue, 10 Apr 2018 15:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401128; cv=none; d=google.com; s=arc-20160816; b=vvvbaAYCkSLtgvaZb6R/XuSPaqmN1FDKVRI4VpwVYMCLx1MxOB4beAcbozhPrhSq6q 4K5Im6NCxG5a1J0HkyI3mZ7tyQn1VLyZlX70ET7RchrhtbROpGgIogKySpvKs4LE+1Dg 6UVmKgOV95wyP2b57T80ChcdBkreq3I9glzFzGHzJ3k5fzv86w4c2DWNab3W5BJ0f7VA vN+0/un+e1LFGnOB/mgGcrYVFqN5DsJKTMr9YRjcwv7WMKAbERCQhCkygJSreAVYcU/7 xGCknSsPVBKXrHWwx1DZt6wRQUb0uZQDN4gQ49SNKAsa0vPbbN78j5GDFjk6rKmQ+W0E JFQQ== 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=LOGYXuho7AQL2znerBoaleL618i6IT6qoge2DAKNopI=; b=tzptH7d+HK1XRZrsEbMMd1Fuxo7qgtVak7CKinvWzMzQyCNB4q7UV41s4UpXTbrzhL vLsVMv3DLhAUyMZAFBrX4KuvCOKSOZEWuv1Ks0zeUdTWKEsqn97YZhZ/gadMGtfSfb33 /eqDWwkyFo8haano/map2P0Np5hfWUY35F9fcBQW02Bbs6k4MIQdyN86YXCV61u/3j2y YaCVGWIxERfxHAW6f57XYSeJrzqDS9cFAOZ1u2CedgMxNraAUWy6z5HYSjK6kr4DrUJu 3qxqUEki9eZhO1hojYAf6vW7/yIo4pBX0V+bg+Dpjgs3AqbETbGG8+SdZmxZ8B/5gAbV M9fg== 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 d6si2834111pfc.230.2018.04.10.15.58.11; Tue, 10 Apr 2018 15:58:48 -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 S1756050AbeDJWxU (ORCPT + 99 others); Tue, 10 Apr 2018 18:53:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43830 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbeDJWhf (ORCPT ); Tue, 10 Apr 2018 18:37:35 -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 261B2408; Tue, 10 Apr 2018 22:37:35 +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.14 071/138] scsi: megaraid_sas: unload flag should be set after scsi_remove_host is called Date: Wed, 11 Apr 2018 00:24:21 +0200 Message-Id: <20180410212910.373395262@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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 @@ -6605,7 +6605,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; @@ -6616,6 +6615,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;