Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4602534ybp; Mon, 7 Oct 2019 10:52:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMxpnnkpL2WtAW+lzJcNS0wXQwmBVaEcU2fJE4jxhSPejJ2vHyPHuBqw8BB5vkbLotOE/B X-Received: by 2002:aa7:ce88:: with SMTP id y8mr30933499edv.145.1570470762168; Mon, 07 Oct 2019 10:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570470762; cv=none; d=google.com; s=arc-20160816; b=ML2J+UWHLGBG0Xqbqvqe+3yzXjQ+CjLR1Qw8YwhU0TmD1yEHDKMRiUKHWBwnxlB8ql nTO/xmOPyGMTRRhg0AqFXKlY3SEaxiuVgcR4iV5cbVSbhhXa73YNmfsq7wg5WdsPQ6jR ybwKka8xGr2zXYmUDEwsTMzxqg+37JBc2enufvg/on3cNFIid8B2JiwgEh/12dbBDYzX sjHfp/GjF0mFpZEnVUa3B282lmBDIF+77CWO3+EfIJAs3pVxP/YgJ9/em1q9TX+N0Tt0 wdIkuwpC0K44oagYyZoOYciDBtptXUIXbaZegL9IC43q6ZQhjxlrNO3mSskd/RvsAYBN xAXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mnR5MVeSfmkd08lK4ffzp778Oq2vekAUBJq9yoLn9b8=; b=hXnf5cs60mcIg4qe1dHFz/OWZDeS0AaWcAiHgBsk7FiYI0a35S787ir9+Jwhe+0yz0 Ds1rnvMgZ6l0pI/sIDToGmdVLINxQDD5KD662UNk583vj1l81erFBjaQpOyjHxA3x3mu qokC76B1WMPLdb9nHmwRjZ/ZcDrWvflhsvHW22aLwUH9Ca1SgtI5dhNPxQwI+2dpVwR4 V+h0m+HuSS1IMqooiyFTCoTm0bYpy8WymeXccrwQ6qWzlTPGtyNMCB4rdoeQoXnZ6YiL 8Jd7pHHMhQ0JEF/1JsmPJKQOf3GGbM01yjHyu3gGOxvvUaun+TFqhdUqo1vM3Hdc1563 dfhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fd4Tb+2Y; 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 p14si10107195eda.411.2019.10.07.10.52.19; Mon, 07 Oct 2019 10:52:42 -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=fd4Tb+2Y; 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 S1728440AbfJGRtu (ORCPT + 99 others); Mon, 7 Oct 2019 13:49:50 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:42468 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728187AbfJGRtu (ORCPT ); Mon, 7 Oct 2019 13:49:50 -0400 Received: by mail-yb1-f196.google.com with SMTP id 4so1294307ybq.9 for ; Mon, 07 Oct 2019 10:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mnR5MVeSfmkd08lK4ffzp778Oq2vekAUBJq9yoLn9b8=; b=fd4Tb+2Yp/pikdXybI5knLc615UbbMcFORwSgAlrnFG/eDG4sPuvSRJw6ihE9x13tv MCxS27PkjSZZ10iGcnsF7h/xa9qyEpaPkKsguH31LrpEF4ZVzZ65eoGm3jFLCRJBvLdx oVIub0eY1AhumoEIAHWD1oUsTjN1q5QziIpL1JO2sd1s9EdctkIWfrs7gPcYmHNUGnTa GcX6MKhboEQnREOtpkV5O89UWHklnVnDFqalyP+l7/aEX6w+LPB8aKAm9qxeNEMk6kHA afdP66atY7coWxujzKxu+iVe8mnTCfnTFZYvNnpk+rgbOBDeym2S+FFIinxjnbDPtTkg mPKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mnR5MVeSfmkd08lK4ffzp778Oq2vekAUBJq9yoLn9b8=; b=TQO5wlAuxcZWupWIhBgP7+oM13YJvZjzfN37fXT8lTmpGUPmp9Lyc43ilekBtFcdx1 FUSalzJ002avomC6HfmFgRysbBdp4IyZ8iGdKwAPl0pbV9btx6wyKfLqcEMO4fCxK/F7 XkgIjN01PqlIBwHR+LZ1PlBKJxQa7g9kKF+Q+PU6CMkJJwlwOXrEKUFygCtDSXt3fgEJ lzX1UtOQQ4DhHh1vBMTFSiVrHOeKzz0b/dC8UtL8zl4Kr0sCk5wtBi5LAUJ/2UQtLw82 aN8WFeM0drRZuHdCKsuBmWIrkJZEP0EvZIQ1jDOR3bfLBnm0oWyJtlyTHTPcmvXDuSAH wZgQ== X-Gm-Message-State: APjAAAW1N+tenjFRbMUiAmuT+695aoMPYe8j4BsP2GNSVNsjYBwneEnj sLSAGnXGOeBBUs85O+XMJwM= X-Received: by 2002:a25:7506:: with SMTP id q6mr10435190ybc.25.1570470588791; Mon, 07 Oct 2019 10:49:48 -0700 (PDT) Received: from Serenity.nc.rr.com (cpe-2606-A000-1125-4300-3224-32FF-FE82-DC91.dyn6.twc.com. [2606:a000:1125:4300:3224:32ff:fe82:dc91]) by smtp.gmail.com with ESMTPSA id v204sm3943455ywb.23.2019.10.07.10.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:49:48 -0700 (PDT) From: Tyler Ramer To: tyaramer@gmail.com Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] nvme-pci: Shutdown when removing dead controller Date: Mon, 7 Oct 2019 13:50:11 -0400 Message-Id: <20191007175011.6753-1-tyaramer@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191007154448.GA3818@C02WT3WMHTD6> References: <20191007154448.GA3818@C02WT3WMHTD6> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shutdown the controller when nvme_remove_dead_controller is reached. If nvme_remove_dead_controller() is called, the controller won't be comming back online, so we should shut it down rather than just disabling. Remove nvme_kill_queues() as nvme_dev_remove() will take care of unquiescing queues. Signed-off-by: Tyler Ramer --- Changes since v1: * Clean up commit message * Remove nvme_kill_queues() --- drivers/nvme/host/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index c0808f9eb8ab..68d5fb880d80 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2509,8 +2509,7 @@ static void nvme_pci_free_ctrl(struct nvme_ctrl *ctrl) static void nvme_remove_dead_ctrl(struct nvme_dev *dev) { nvme_get_ctrl(&dev->ctrl); - nvme_dev_disable(dev, false); - nvme_kill_queues(&dev->ctrl); + nvme_dev_disable(dev, true); if (!queue_work(nvme_wq, &dev->remove_work)) nvme_put_ctrl(&dev->ctrl); } -- 2.23.0