All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, "Khandelwal,
	Rajat" <rajat.khandelwal@intel.com>
Subject: Re: [BUG] nvme-pci: NVMe probe fails with ENODEV
Date: Thu, 9 Mar 2023 16:12:18 +0100	[thread overview]
Message-ID: <20230309151218.GA17235@lst.de> (raw)
In-Reply-To: <f1ad4c1a-2871-57be-48cb-2b0e5cec1bfa@linux.intel.com>

On Thu, Mar 09, 2023 at 07:31:07PM +0530, Rajat Khandelwal wrote:
> Hi,
> I am seeking some help regarding an issue I encounter sporadically
> with Samsung Portable TBT SSD X5.
>
> Right from the thunderbolt discovery to the PCIe enumeration, everything
> is fine, until 'NVME_REG_CSTS' is tried to be read in 'nvme_reset_work'.
> Precisely, 'readl(dev->bar + NVME_REG_CSTS)' fails.
>
> I handle type-C, thunderbolt and USB4 on Chrome platforms, and currently
> we are working on Intel Raptorlake systems.
> This issue has been witnessed from ADL time-frame and now is seen
> on RPL as well. I would really like to get to the bottom of the problem
> and close the issue.
>
> I have tried 5.10 and 6.1.15 kernels.

So we have a quirk for a device called Samsung X5 in core.c, which is a
bit of an unusual match.  Can you check that it gets applied for the
device that you are testing?

Also if it gets applied, can you test this patch?

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index c2730b116dc680..7eb980105ce6c1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2264,6 +2264,9 @@ static int nvme_wait_ready(struct nvme_ctrl *ctrl, u32 mask, u32 val,
 	u32 csts;
 	int ret;
 
+	if (ctrl->quirks & NVME_QUIRK_DELAY_BEFORE_CHK_RDY)
+		msleep(NVME_QUIRK_DELAY_AMOUNT);
+
 	while ((ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CSTS, &csts)) == 0) {
 		if (csts == ~0)
 			return -ENODEV;
@@ -2303,8 +2306,6 @@ int nvme_disable_ctrl(struct nvme_ctrl *ctrl, bool shutdown)
 				       NVME_CSTS_SHST_CMPLT,
 				       ctrl->shutdown_timeout, "shutdown");
 	}
-	if (ctrl->quirks & NVME_QUIRK_DELAY_BEFORE_CHK_RDY)
-		msleep(NVME_QUIRK_DELAY_AMOUNT);
 	return nvme_wait_ready(ctrl, NVME_CSTS_RDY, 0,
 			       (NVME_CAP_TIMEOUT(ctrl->cap) + 1) / 2, "reset");
 }


  parent reply	other threads:[~2023-03-09 15:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f1ad4c1a-2871-57be-48cb-2b0e5cec1bfa@linux.intel.com>
2023-03-09 14:04 ` [BUG] nvme-pci: NVMe probe fails with ENODEV Rajat Khandelwal
2023-03-27 22:37   ` Bjorn Helgaas
2023-03-09 15:12 ` Christoph Hellwig [this message]
2023-03-09 15:24   ` Keith Busch
2023-03-09 17:06     ` Rajat Khandelwal
2023-03-09 17:24       ` Keith Busch
2023-03-09 18:13         ` Rajat Khandelwal
     [not found]           ` <CGME20230313095802eucas1p2ed9a708d3fb0fb1fac05015a6fb06b7f@eucas1p2.samsung.com>
2023-03-13  9:49             ` Pankaj Raghav
2023-03-13 17:16               ` Rajat Khandelwal

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=20230309151218.GA17235@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=rajat.khandelwal@intel.com \
    --cc=rajat.khandelwal@linux.intel.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 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.