Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp382007imm; Wed, 17 Oct 2018 01:33:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XVrCuaaB4h9CMby+nAX/kaL6FPfLa0j6alWCwuq6G4hB51KbX0NCxVavrmsPz2gTD5Qxx X-Received: by 2002:a63:9304:: with SMTP id b4-v6mr22986589pge.36.1539765213926; Wed, 17 Oct 2018 01:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539765213; cv=none; d=google.com; s=arc-20160816; b=j3Zl40L6yN2QRYyk7Wz4DjTuExhdBFSePYjAc/SNcwIcTFcW5w9iAfVwz7MshgIhs6 Lj6e7PYL0ZXoBZeMHGsufEYKDIrUH5u/uvha0qUbKtDCW2ZhifmWvxRHsdODfLdu94cl YdY5qAeMgtlw+HqXVQ6KjOU/02y/9bVatKYQ+Ikg24EEBz1AaRrQqZIfdvWmjhP7GDYV 7U//KbK++zMzkam4eG4//JFVX1+Tg10XepAgqT8pxjK3OAG2852xPCTAg/nL8Yh6wnQS wpComr39N4N2KGjh58twdt5lDsV4Eu5zGCknnQ/Wh2suSe43MAWKMOpZCDDztpf8QQJu ymRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gnmOvwVBiwhbr4qv0Wcjz1gEzwBhaQoYwTvhnMhd4bY=; b=CEMSyHWpVmKc9JDggyCFlYJ0f7DfhR8VtwxOEmtBkrlL5Ufk2inPPH0WX3Vj9So/hT SL91Si1mW7V67yMF8q3Id53VAr8BW+78kqnQywM0C1xYtbKOjRIZ63+l5or0B1ipcOjF XMrv6c7S48GH7vOYJF1XAwnPbEUX8AJeNNIgWMH9ncTY5HMWzC9gejBGCc/ixdZ6Jupg TjaH4uBrWlkpY5ErSGoraGCnnipUfgeMdXGyz//vmIpXq/QkrBl1ny3OF0kBXRv7QUCP 6mJnWJNBGb5kh5y+uAaCkbZTC2ngKPddpnYPGkJa3zUCAR3ny3Jv1697r3hW1x09Fx9z ptRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XqP4Gk52; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2-v6si17271328pgt.435.2018.10.17.01.33.17; Wed, 17 Oct 2018 01:33:33 -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=@gmail.com header.s=20161025 header.b=XqP4Gk52; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbeJQQ1H (ORCPT + 99 others); Wed, 17 Oct 2018 12:27:07 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38223 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbeJQQ1G (ORCPT ); Wed, 17 Oct 2018 12:27:06 -0400 Received: by mail-qt1-f196.google.com with SMTP id l9-v6so29024968qtf.5; Wed, 17 Oct 2018 01:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gnmOvwVBiwhbr4qv0Wcjz1gEzwBhaQoYwTvhnMhd4bY=; b=XqP4Gk52VAKImMyKwOb2O70F9s7eC+3G+J4qOOsauf4EFxt5OPOpqtaoq1yRpkn2Ea JtoEtVL5rQ289iz/GXD7HeuzU+cDZN9MaMJUSizwoaVS0rRqbuNHGzNbFVE6Rgi1l7Bc 3ZB6/g7hs7CSRRb3cAEo3GWvZOaWMh4zAaGaght47DJe5jpZtzLF0l2u8/qo4RH7yMy/ J9cAXnEdZfqqtsiACX5MriRWS1R/MXchsk+VTaF+45ytgfhcwesIWRhyFI4rUFGCHQQY OefBNGesldPZuX+3QmahQeT9E9OW2GYD/I3MT04G5JoZaSDi808c5VbQdf+MUsMlRDHD 0Wlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gnmOvwVBiwhbr4qv0Wcjz1gEzwBhaQoYwTvhnMhd4bY=; b=pDCq3u+xpVOXg1be8jDlfoYWlZiZZryDjkN7mvCSSgbbFpeNidqz9/Ur9kDZEeXgQw lrrlYnSq+D+y4f3E9UX6Nml6ozifzlqR23J20sAFsqCWwRnFTDLtWodil889stUq2I0Y wOSQJvXGe/18csUcRWMmdio2XLIKhCceC+I9r+ABPAI3rUYNTyv5wVo0Q41XGLjPMJeH weW7vDN/h7dGDJ54vY/lo+fEtY/bYEmUkwwSpow40rI0LiMbgOmqE76JLZKp/7lUG0Wg BckX3rbP+t6KX2UFJPg8F1eTpE2297VjJ13KXEn+ysE6uUKuvj42K46p1+cjakEuS7gY LypA== X-Gm-Message-State: ABuFfohfVq968TUSDOMVzkgBc8pdz93floHvb+WkeUchOIlgXRItbLfn y02fzUN1ksYLSnCnjoxy6nYefIX4kQNh+CMIOzM= X-Received: by 2002:ac8:190e:: with SMTP id t14-v6mr22831024qtj.327.1539765150096; Wed, 17 Oct 2018 01:32:30 -0700 (PDT) MIME-Version: 1.0 References: <1539755947-27014-1-git-send-email-suganath-prabu.subramani@broadcom.com> <1539755947-27014-3-git-send-email-suganath-prabu.subramani@broadcom.com> In-Reply-To: <1539755947-27014-3-git-send-email-suganath-prabu.subramani@broadcom.com> From: Andy Shevchenko Date: Wed, 17 Oct 2018 11:32:18 +0300 Message-ID: Subject: Re: [v5 2/4] mpt3sas: Fix Sync cache command failure during driver unload To: Suganath Prabu Subramani Cc: Bjorn Helgaas , Lukas Wunner , linux-scsi , linux-pci@vger.kernel.org, Linux Kernel Mailing List , Benjamin Herrenschmidt , ruscur@russell.cc, sbobroff@linux.ibm.com, oohall@gmail.com, Sathya Prakash , Sreekanth Reddy 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 On Wed, Oct 17, 2018 at 8:59 AM Suganath Prabu wrote: > > This is to fix Sync cache and start stop command > failures with DID_NO_CONNECT during driver unload. > > 1) Release drives first from SML, then remove internally > in driver. > 2) And allow sync cache and Start stop commands to firmware, > even when remove_host flag is set. > + if (ioc->hba_mpi_version_belonged == MPI2_VERSION) { > + if (ioc->remove_host) > + return false; > + > + return true; > + } > + > + if (ioc->remove_host) { > + > + switch (scmd->cmnd[0]) { > + case SYNCHRONIZE_CACHE: > + case START_STOP: > + return true; > + default: > + return false; > + } > + } > + > + return true; Wouldn't be the same as if (!ioc->remove_host || ioc->hba_mpi_version_belonged == MPI2_VERSION) return !ioc->remove_host; switch (scmd->cmnd[0]) { case SYNCHRONIZE_CACHE: case START_STOP: return true; default: return false; } ? -- With Best Regards, Andy Shevchenko