Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp203141ybp; Thu, 3 Oct 2019 12:16:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGv0miX7+vU0zrfaBxd2QTGNZ7ACD/W1lsF4ToZNYzr0Xy2Fsi2DugXKFM5BOryOMSHL+0 X-Received: by 2002:a50:a8c5:: with SMTP id k63mr11262985edc.122.1570130182235; Thu, 03 Oct 2019 12:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570130182; cv=none; d=google.com; s=arc-20160816; b=XtXHb1+ueSpfULCBXJVfst0QGtB6SeYVHlx4fiG25IAukfbVImv9IHgb1i36tZNfDN yK6UqCLMHQ9qQuJSciFC+H2Gt+ndACiB4KJoJeo+ZkF3EARF+fEU3WFCuzLiu/SSTnFa WFY/TX459Ed30g33sPofM50sDTmlYQoHsXmRils4p+67YcOID1QeMKJ91YxE1tN6yDXd mSAV4yZhPe3NU2IEgC61Tw2j6Efq5JuTl5A1oE9au8O86bXMJlaJ0nCBXZzEXeRl46I/ 7IhNis5XSxGd0vvACEVYxI406SjXPAnTJFTK6wC+s3em9MEMZtQ9WNsh4FbmzdREJUqK MXtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=kR8Zy1YrMRxTBtPohNQSd/AqP79mcgM2qqBmsukmkyI=; b=gCQ5T52A9Gb9kyOGAyZ4ggt97Pqbzp3qpsSqw8v7JO8//YVv/T42k83Wzs9gbyk/uu lsVxHbDug7o2kgdRpkcstDv685a7fCABX4FTY1JMN+QMSM8hJev3PCuSfJODykuwQF3A QB4PdKQY+lGNXLfSOVRtKq8A8hbdKLtmWqxJPsLIm8zHw0TWEYZD1wqH2lpR+hyTh3jP cfuDNhXCtsWkQNup95TY/3CIUK51vUcS7fJYhftu8VpRmOOkC1HaLUu2/mPBhAkvx8x+ JdH3p/BjQUYNpFSknAkuR+9C+PPEeYwWVWAyN1lQA4DMgCoM0pwAScwWLEDmFI7zFx5B TgYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=se77SjyV; 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 p8si1733066ejf.58.2019.10.03.12.15.57; Thu, 03 Oct 2019 12:16:22 -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=se77SjyV; 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 S1729225AbfJCTNJ (ORCPT + 99 others); Thu, 3 Oct 2019 15:13:09 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:32925 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbfJCTNI (ORCPT ); Thu, 3 Oct 2019 15:13:08 -0400 Received: by mail-io1-f67.google.com with SMTP id z19so8248446ior.0 for ; Thu, 03 Oct 2019 12:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=kR8Zy1YrMRxTBtPohNQSd/AqP79mcgM2qqBmsukmkyI=; b=se77SjyVATxLFOZM67qjxeZ6JxrN0Fjp0aVCUA1pBKktbIzqSWVh1TFERJq6YKaGJC xg4VQFzjWMXBt84K4G4NL9GZ6Uujcw25j8eMYP5o/fOr8qR3VuSODEFu8IOndrfU0fUE JVl5yWlUmf10315yQLrSdtz7/3QtJLK8YNfoVIZvzNj4XckX8jqaVVHFbA0qIAy2k+s2 Cp7BhycojGSNLdD8YwHpQL+R2UBF/HZ+MIM1Lk0fbeEeLCZc4K9XA008b/HIYOXUudtM LWfLEXL6b0UiR0bvuAjW1fDQjdE7hPpktN9fneHWgfI4lMORqVroCz/RuDmgNQavEHtq wFMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=kR8Zy1YrMRxTBtPohNQSd/AqP79mcgM2qqBmsukmkyI=; b=U4g+UBVBU49/lu2gKTjQBOlo7AUlefNCyaem/v/pnemZ131w96r4uiJ4SPBNUjmOOB zD0b6P8YgDol8RgXJI8SsTuVL3+1Tl3fE+Rp21uOqBbtoKi8C7M00GFDTxJEowvFziXU LF+aeEJsZLgpY5655XsoV+a++cmSHl+IrdK0asY+7r1kRbw0/qlcDgAWWelJh1ttWqNy ofsd0oWC0vp9RWp+vWis0JOVTb5PhJzkC7z/MoVbNyHrF2MS9J1YEHKo2UUwE2TZ/yxZ wDEyKlDqaFvC4zNS3Fw1gNh3ExcwVr2t+bf8pUWfjgFAi6TtAy6GGDohDqW1D9FdbP1p MJCQ== X-Gm-Message-State: APjAAAX3iLZmccO7K/lC+bH/8bfPt2mDmuA+2ejzYH0pTMec+VslF4x3 ASKotWrnlOi6o8rW/gkk2ttOg0RajAboZw== X-Received: by 2002:a02:2a46:: with SMTP id w67mr11216914jaw.17.1570129987782; Thu, 03 Oct 2019 12:13:07 -0700 (PDT) Received: from Serenity ([104.129.159.212]) by smtp.gmail.com with ESMTPSA id z10sm1203162iog.41.2019.10.03.12.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 12:13:07 -0700 (PDT) Date: Thu, 3 Oct 2019 15:13:54 -0400 From: Tyler Ramer To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme-pci: Shutdown when removing dead controller Message-ID: <20191003191354.GA4481@Serenity> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Always shutdown the controller when nvme_remove_dead_controller is reached. It's possible for nvme_remove_dead_controller to be called as part of a failed reset, when there is a bad NVME_CSTS. The controller won't be comming back online, so we should shut it down rather than just disabling. Signed-off-by: Tyler Ramer --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index c0808f9eb8ab..c3f5ba22c625 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2509,7 +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_dev_disable(dev, true); nvme_kill_queues(&dev->ctrl); if (!queue_work(nvme_wq, &dev->remove_work)) nvme_put_ctrl(&dev->ctrl); -- 2.23.0