public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Michael Kelley <mikelley@microsoft.com>
Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	caroline.subramoney@microsoft.com, riwurd@microsoft.com,
	nathan.obr@microsoft.com
Subject: Re: [PATCH v3 2/2] nvme: handle persistent internal error AER from NVMe controller
Date: Tue, 7 Jun 2022 12:35:38 +0200	[thread overview]
Message-ID: <20220607103538.GA25071@lst.de> (raw)
In-Reply-To: <1654560915-22449-2-git-send-email-mikelley@microsoft.com>

On Mon, Jun 06, 2022 at 05:15:15PM -0700, Michael Kelley wrote:
> +static void nvme_handle_aer_persistent_error(struct nvme_ctrl *ctrl)
> +{
> +	trace_nvme_async_event(ctrl, NVME_AER_ERROR);
> +
> +	/*
> +	 * We can't read the CSTS here because we're in an atomic context on
> +	 * some transports and the read may require submitting a request to the
> +	 * to the controller and getting a response. Such a sequence isn't
> +	 * likely to be successful anyway if the controller is reporting a
> +	 * persistent internal error. So assume CSTS.CFS is set.
> +	 */
> +	if (nvme_should_reset(ctrl, NVME_CSTS_CFS)) {
> +		dev_warn(ctrl->device, "resetting controller due to AER\n");
> +		nvme_reset_ctrl(ctrl);

I don't think we even need the nvme_should_reset check now.

nvme_reset_ctrl first calls nvme_change_ctrl_state, which only allows
the transition to the RESETTING state if it previously was NEW or LIVE,
so we are already covered.  The only downside would be an extra kernel
message if we already were in another state.

  reply	other threads:[~2022-06-07 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  0:15 [PATCH v3 1/2] nvme-pci: move nvme_should_reset() to core code Michael Kelley
2022-06-07  0:15 ` [PATCH v3 2/2] nvme: handle persistent internal error AER from NVMe controller Michael Kelley
2022-06-07 10:35   ` Christoph Hellwig [this message]
2022-06-08  3:59     ` Michael Kelley (LINUX)

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=20220607103538.GA25071@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=caroline.subramoney@microsoft.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mikelley@microsoft.com \
    --cc=nathan.obr@microsoft.com \
    --cc=riwurd@microsoft.com \
    --cc=sagi@grimberg.me \
    /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