Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1590869imm; Thu, 18 Oct 2018 00:25:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV61K/ZnE0BcD95tcGFAFWGawuQilN+94Yyt8HuuXh+rUdAH2+oqvZD9xUKGD5J4VKsLzFRye X-Received: by 2002:a63:ec11:: with SMTP id j17-v6mr27190058pgh.388.1539847516918; Thu, 18 Oct 2018 00:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539847516; cv=none; d=google.com; s=arc-20160816; b=rRJETVvcp0Eg0LUzuXmt9zCkyYmllHFYeGlFTPnkDkCtEhbu+kkhlHmoTCKAIYDc8g cm8hsiXmMhBePAsQidVbvYRZz6yKbbOUQB8ptGdWzYEJvBt10tbujKP1MZGxmNNgdvgw djnOoehPIhCgo3GXEMDh/HQvItUpo777MpFvp9QPrijA36FXwj2Fa5K60zjSmV6wCFe8 U34AiBJnf8uc5950oSxPZwX9YtN3tfaOOJ5whpEYqdXoDE8JkU6FJTr4aW2yIRdZ8ZUI mfWGFqtGGm+norcGAnEdsY9IiKHxWtybxd0aE+/e33wXU3Ra9fuAAZswb29NTAZYWHZN Q1dw== 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=O7kIxwq2qKHcExhNfWzmcsriRPxkNspejgUxQxEv01Y=; b=SSvfutBxuN2c7G8O46dJJ0mchoO5K6W6PaSPmuFMF34FJagHECt8xXg+YmqLa3Yq2Z 2Mqrj6Oc/7iMQuGUnvtawel1J5vBfptM0hlCf9vq7iaQL3gfnbvWHNzcOJ8I1bE4eNjj AqlNcqh2YL1yEQnvVSN0JZXw1l4lLA8Q9PnDYFQ22bOt2Gp2mmJb1pj42L0LsnZGVI7D qZWoUj5salfxL3Ys4ttp+bWuT080/bZ3L5rpDMYFlqCYx6v5BUWiJytoOBhfhBdzhXgR mWpiEcMac7i+Bk5QDCMe7b+qKuoQHyo0xravD4WjvCb9eY+RhQRTxSPfVORimgF9PfZj KLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jr9P8hsO; 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 bj3-v6si19470246plb.12.2018.10.18.00.25.01; Thu, 18 Oct 2018 00:25:16 -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=jr9P8hsO; 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 S1727649AbeJRPXJ (ORCPT + 99 others); Thu, 18 Oct 2018 11:23:09 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44357 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbeJRPXJ (ORCPT ); Thu, 18 Oct 2018 11:23:09 -0400 Received: by mail-qt1-f194.google.com with SMTP id x24-v6so1561765qtx.11; Thu, 18 Oct 2018 00:23: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=O7kIxwq2qKHcExhNfWzmcsriRPxkNspejgUxQxEv01Y=; b=jr9P8hsOVn+LrrHJMQESCTGZakg+cJlWvuVArNccQja+NdHig6POM0QkIDNuj6ggv8 nyQ5cWw2aXCqpPM0Mo2QdU+2R2JP28LUpgbrAlKXi9eBQ+0D03Z4OjXQdzTRgxkQNkyY WhxUDzYizChbQDM3KYxEcqWG2s5G8JQZbiQwnoKg74W0C2vAhBv0anXHv9nEXVT3N+JA TaZGecbJqW/cg756u1gx++UqpXWQd2nR9i+q5ej+hRKGmmlnwfx+YmtClpaImYxbgbWz MxUbhCuz+ei6BfVZieJD2ARy2q8UtxR1Q+lsy+jJwkw5D452aOsJowMJEbxTJmscPbI7 zs0A== 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=O7kIxwq2qKHcExhNfWzmcsriRPxkNspejgUxQxEv01Y=; b=XsC/eUNsSLOxKjwAytTthFlDDsSPZGksSaQ3n62rsHXXtCADb7XD9CCnHWlcpqL2Tw TB/6X1G8ocf2lprHOS3bYrjXDlTOqbKXAFURN2eJV+TgXgZto35UTF3j85x/aLacB0xA ZdPS4Daqxvs2MPgjvb4C7b9HpCiZt2jkfutYpyt5hd97lbbMD23p1tp9CZ8FRYMbUjHG LYRRAlvnQ54c9HLCh67FtcsD9Vu/sDfYgmUllvinlxyt2TN74Ui3/d10ZIVj7uZP4mLu oOydlA/PxD/3iue+LMc/US4byLiBeZbt0VGP6d3CtsTJJRu99ZlrsyjKvvhWn2co6+wv OdzA== X-Gm-Message-State: ABuFfojzS5RtJFCBNpMNicviklmJV1uALNP5lpcyjN2JPxvEada5+V99 CEyUG2colGASdQuZxsNqdkzox9WkCZzUmTZTFNfINgVZ+6o= X-Received: by 2002:ac8:6784:: with SMTP id b4-v6mr28081655qtp.373.1539847410128; Thu, 18 Oct 2018 00:23: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: From: Andy Shevchenko Date: Thu, 18 Oct 2018 10:23: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, Oliver , 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 Thu, Oct 18, 2018 at 10:11 AM Suganath Prabu Subramani wrote: > > > > On Wed, Oct 17, 2018 at 2:02 PM Andy Shevchenko wrote: >> >> 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 >> Yes it is same, but i feel original code is more readable. OK (I didn't compare assembly, but I assume this is slow path). >> 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 -- With Best Regards, Andy Shevchenko