linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tyler Ramer <tyaramer@gmail.com>
To: "Singh, Balbir" <sblbir@amazon.com>
Cc: "sagi@grimberg.me" <sagi@grimberg.me>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"axboe@fb.com" <axboe@fb.com>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH] nvme-pci: Shutdown when removing dead controller
Date: Sat, 5 Oct 2019 17:58:52 -0400	[thread overview]
Message-ID: <CAKcoMVBjzM6dq33DaTYBK6U32U3NQaR5mf6ppGr6iTKRuZ2KNg@mail.gmail.com> (raw)
In-Reply-To: <e0edf48eb84fe038c2912328b28e931900684de2.camel@amazon.com>

> What is the bad CSTS bit? CSTS.RDY?

The reset will be triggered by the result of nvme_should_reset():

1196 static bool nvme_should_reset(struct nvme_dev *dev, u32 csts)
1197 {
1198
1199 ⇥       /* If true, indicates loss of adapter communication, possibly by a
1200 ⇥        * NVMe Subsystem reset.
1201 ⇥        */
1202 ⇥       bool nssro = dev->subsystem && (csts & NVME_CSTS_NSSRO);

This csts value is set in nvme_timeout:

1240 static enum blk_eh_timer_return nvme_timeout(struct request *req,
bool reserved)
1241 {
...
1247 ⇥       u32 csts = readl(dev->bar + NVME_REG_CSTS);
...
1256 ⇥       /*
1257 ⇥        * Reset immediately if the controller is failed
1258 ⇥        */
1259 ⇥       if (nvme_should_reset(dev, csts)) {
1260 ⇥       ⇥       nvme_warn_reset(dev, csts);
1261 ⇥       ⇥       nvme_dev_disable(dev, false);
1262 ⇥       ⇥       nvme_reset_ctrl(&dev->ctrl);


Again, here's the message printed by nvme_warn_reset:

Aug 26 15:01:27 testhost kernel: nvme nvme4: controller is down; will
reset: CSTS=0x3, PCI_STATUS=0x10

From  include/linux/nvme.h:
 105 ⇥       NVME_REG_CSTS⇥  = 0x001c,⇥      /* Controller Status */

- Tyler

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-10-05 21:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 19:13 [PATCH] nvme-pci: Shutdown when removing dead controller Tyler Ramer
2019-10-04 15:36 ` Tyler Ramer
2019-10-05  2:07   ` Singh, Balbir
2019-10-05 21:58     ` Tyler Ramer [this message]
2019-10-06 19:21   ` Keith Busch
2019-10-07 15:13     ` Tyler Ramer
2019-10-07 15:44       ` Keith Busch
2019-10-07 17:50         ` [PATCH v2] " Tyler Ramer
2019-10-07 18:28           ` Keith Busch
2019-10-07 19:32             ` Tyler Ramer
2019-10-07 22:11 ` [PATCH] " Singh, Balbir
2019-10-11 14:28   ` [PATCH v3] Always shutdown the controller when nvme_remove_dead_ctrl is reached Tyler Ramer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKcoMVBjzM6dq33DaTYBK6U32U3NQaR5mf6ppGr6iTKRuZ2KNg@mail.gmail.com \
    --to=tyaramer@gmail.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=sblbir@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).