All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Daniel Wagner <wagi@kernel.org>, Keith Busch <kbusch@kernel.org>,
	 Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	 James Smart <james.smart@broadcom.com>,
	Hannes Reinecke <hare@suse.de>,
	 Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] nvme: only allow entering LIVE from CONNECTING state
Date: Mon, 28 Apr 2025 14:44:48 +0200	[thread overview]
Message-ID: <cb46aa83-8033-4d64-a3c7-420172c3f3f5@flourine.local> (raw)
In-Reply-To: <0134ea15-8d5f-41f7-9e9a-d7e6d82accaa@roeck-us.net>

On Sun, Apr 27, 2025 at 08:59:13AM -0700, Guenter Roeck wrote:
> Hi,
> 
> On Fri, Feb 14, 2025 at 09:02:03AM +0100, Daniel Wagner wrote:
> > The fabric transports and also the PCI transport are not entering the
> > LIVE state from NEW or RESETTING. This makes the state machine more
> > restrictive and allows to catch not supported state transitions, e.g.
> > directly switching from RESETTING to LIVE.
> > 
> > Signed-off-by: Daniel Wagner <wagi@kernel.org>
> 
> nvme_handle_aen_notice(), when handling NVME_AER_NOTICE_FW_ACT_STARTING,
> sets the state to RESETTING and and triggers a worker. This worker
> waits for firmware activation to complete and then tries to set the
> state back to LIVE. This step now fails.
> 
> Possibly the handling of NVME_AER_NOTICE_FW_ACT_STARTING needs to be
> improved. However, leaving the NVME in RESETTING state after an
> NVME_AER_NOTICE_FW_ACT_STARTING event is worse.
> 
> I think this patch should be reverted at least for the time being until
> the handling of NVME_AER_NOTICE_FW_ACT_STARTING no longer relies on a
> direct state change from RESETTING to LIVE.

ee59e3820ca9 ("nvme-fc: do not ignore connectivity loss during connecting")
f13409bb3f91 ("nvme-fc: rely on state transitions to handle connectivity loss")

are depending on the fact that is not possible to switch from
NEW/RESETTING directly into LIVE.

I think it would be better to fix the worker instead dropping this patch
and the above fix for the fc transport.

What about:


diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b502ac07483b..d3c4eacf607f 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4493,7 +4493,8 @@ static void nvme_fw_act_work(struct work_struct *work)
                msleep(100);
        }

-       if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
+       if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||
+           !nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
                return;

        nvme_unquiesce_io_queues(ctrl);

  reply	other threads:[~2025-04-28 12:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14  8:02 [PATCH 0/2] nvme-fc: fix schedule in atomic context Daniel Wagner
2025-02-14  8:02 ` [PATCH 1/2] nvme: only allow entering LIVE from CONNECTING state Daniel Wagner
2025-02-20 10:34   ` Sagi Grimberg
2025-04-27 15:59   ` Guenter Roeck
2025-04-28 12:44     ` Daniel Wagner [this message]
2025-04-28 13:21       ` Hannes Reinecke
2025-04-29 13:55         ` Daniel Wagner
2025-04-29 17:54           ` Hannes Reinecke
2025-04-29 18:13         ` Keith Busch
2025-04-29 18:23           ` Guenter Roeck
2025-04-29 18:42             ` Keith Busch
2025-04-30  6:43               ` Daniel Wagner
2025-04-30 16:01                 ` Keith Busch
2025-04-30 16:12                   ` Guenter Roeck
2025-05-02  9:02                     ` Daniel Wagner
2025-04-30 16:11                 ` Guenter Roeck
2025-04-30  6:08           ` Hannes Reinecke
2026-01-09 19:18   ` John Meneghini
2026-01-11  9:33     ` Nilay Shroff
2026-01-12  8:14       ` Daniel Wagner
2026-01-13  6:10         ` Nilay Shroff
2026-01-13 13:55           ` John Meneghini
2025-02-14  8:02 ` [PATCH 2/2] nvme-fc: rely on state transitions to handle connectivity loss Daniel Wagner
2025-02-20 10:36   ` Sagi Grimberg
2025-02-20  8:00 ` [PATCH 0/2] nvme-fc: fix schedule in atomic context Daniel Wagner
2025-02-20 12:50 ` Shinichiro Kawasaki
2025-02-20 17:23 ` Keith Busch

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=cb46aa83-8033-4d64-a3c7-420172c3f3f5@flourine.local \
    --to=dwagner@suse.de \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux@roeck-us.net \
    --cc=sagi@grimberg.me \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=wagi@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.