Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1164510rdd; Wed, 10 Jan 2024 10:29:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IELjXRj+cY4QPn0h5Ty++4n7HOVxZpV3k1rAEwUn3xyLWieXD+1kJrta9L6qMpfRstGHp45 X-Received: by 2002:a2e:8447:0:b0:2cd:3141:5d52 with SMTP id u7-20020a2e8447000000b002cd31415d52mr785659ljh.83.1704911350542; Wed, 10 Jan 2024 10:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704911350; cv=none; d=google.com; s=arc-20160816; b=Xa3O6tDCKdWZnMdZQnn12QTCHfhU+Bi4/MK1mOmuYdh7DmMn638sbwpevrIy4D35// T8eNedsJOgTTZaIw8gmtduLnl+D1gZj7b67XE9epIzZZytDU2zXgscf8aKZQOAeMWMYP ziLVa3eCdgSLA/CxdpArkxGYEygWRc6UQiGcqht6HTxp03QtZ+maVtbgQv/x+8gUq6Ka IDBaLrJfnXBI+xaYSahyI0w8zqd9PlijFOBPqOMEEz6nOyNn8/abKY+QUooNTOlAusRh yGqxuz3MkbFSDH9Uvs/aNQpYzfaOqHeOikg/RmsROQvxMt5aZ1f5RDLT+fAtmHFi1u0M aXGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=YkL9+IaZL1qRobXKY78NwRR56bxY1pr5+2dRgzIbPA4=; fh=yQzTN+zLNZ95RTv+WDufqKuINl8l838p3VrdvxVwGis=; b=fgsc1rIT7mgFo5fQYxZJwEnpzp7m0DE+SpWpuOhjgcCCfu0febkbfMc0AyZu9TiO1j 4jqWtlRW4mGCvsgMUeOz8VzvoWgfsPhxWZqPC6FCn7sHrixyr8pYLqOMqERZQ7u4fs6C Y9NurhQkELnZQ9+aa+OzaG8ofLtGXaKnudvNdFwgs+f26cohTjCXdszYDRVe0zgQqXLc 4LtFLgXz4SGYmifH0JHSmqRm1n8wdLLSN+NNvpaNsr7p9VEl7QtEqWW5AWiAL9JIfO02 j8GjIfDt5eTOrsqviA0VTe8TJMRinwxuBJn/M4zumwPizQG4NmSC2ioTSEbDjzpV+eSS jR6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jNDUzxFh; spf=pass (google.com: domain of linux-kernel+bounces-22600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a19-20020a509b53000000b00558645245a6si553538edj.636.2024.01.10.10.29.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 10:29:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jNDUzxFh; spf=pass (google.com: domain of linux-kernel+bounces-22600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 464621F24217 for ; Wed, 10 Jan 2024 18:29:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99DFA4D589; Wed, 10 Jan 2024 18:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jNDUzxFh" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71FC54D581 for ; Wed, 10 Jan 2024 18:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--wab.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-5ecfd153ccfso78582107b3.2 for ; Wed, 10 Jan 2024 10:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704911339; x=1705516139; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=YkL9+IaZL1qRobXKY78NwRR56bxY1pr5+2dRgzIbPA4=; b=jNDUzxFhZWTk/jcp6T+IAmwoMV+1SO2xjdp49QMgmlMZSBtwvJMDqPargS2a1EhLIa NX1QvVZC7C+BQg9XNjfgc7nB4Rv7y6vBrHeTeyTtapf+bxzFIMu5FYkRrPBQkrFcDujT 178Q3wlxy81ZKkSv/MQBC75aTu0nNoy8QlTRlwbp35KwvK5CSfXptJLndaMYNomINnJV sv4RsEyTDW8vSFeahat6rd7c00JOzF9yW5t8zHd5dD79uH8XD/xtNiymkekpL19dlVg0 UHOVyyFzm3/8XwBM4pHXCml3tPT+pZJrRFPUVQ9Spk3JPq/yiPIRUr7jYJXf8y5vYEmz wbaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704911339; x=1705516139; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YkL9+IaZL1qRobXKY78NwRR56bxY1pr5+2dRgzIbPA4=; b=mh0UQAQkUDO4bNhBJhC+tJ9TnFEN/WivJdTQ0jJO5sKs04x8wTRQJKymScQj9ZyCpQ yBK5cAvKfU+dxUAYR9ivhfc1SNeQ3C5idw+PGoMwoZwDW6bYIsbhCl/NFwIy22zUdoUs JAxfK+/2BOmzr6uzPhm87tKWq7TuICQu5ouwnB5xiTVg+//CHlcVYll/ko5uKd583ZYu 7pE8jhagAV2SHW34yzeT1eimt7sKyHbdAq5SO6o3JxH7lQ7HuXJEFdffBNImSlEfRA2O ZPHpFynA+jY8vq3RwrjXEnP853X3MCemavsB4WdDKUBmZZq4I+7OkEbcu7s/9qHBtD0/ ig6g== X-Gm-Message-State: AOJu0YzFPB70biDVB8TMCJoo1hxv360Ge2THfRJR5mVlVU+lC9DzaS/s dxaNvCXasIjMMe26h3JzFRBlDGLvhEK3Cg== X-Received: from willb.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:491]) (user=wab job=sendgmr) by 2002:a0d:e4c5:0:b0:5f8:b9b8:aa0a with SMTP id n188-20020a0de4c5000000b005f8b9b8aa0amr23354ywe.2.1704911339353; Wed, 10 Jan 2024 10:28:59 -0800 (PST) Date: Wed, 10 Jan 2024 18:28:55 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.275.g3460e3d667-goog Message-ID: <20240110182855.1833512-1-wab@google.com> Subject: [PATCH] nvme: Inform controller of doorbell config before unquiescing IO queues From: William Butler To: Keith Busch , Pavel Emelyanov , Christoph Hellwig , Sagi Grimberg Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, William Butler Content-Type: text/plain; charset="UTF-8" During resets, if queues are unquiesced first, then the host can submit IOs to the controller using shadow doorbell logic but the controller won't be aware. This can lead to necessary MMIO doorbells from being not issued, causing requests to be delayed and timed-out. Signed-off-by: William Butler --- 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 61af7ff1a9d6..f87c51a946b3 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2743,10 +2743,10 @@ static void nvme_reset_work(struct work_struct *work) * controller around but remove all namespaces. */ if (dev->online_queues > 1) { + nvme_dbbuf_set(dev); nvme_unquiesce_io_queues(&dev->ctrl); nvme_wait_freeze(&dev->ctrl); nvme_pci_update_nr_queues(dev); - nvme_dbbuf_set(dev); nvme_unfreeze(&dev->ctrl); } else { dev_warn(dev->ctrl.device, "IO queues lost\n"); -- 2.43.0.275.g3460e3d667-goog