All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem()
       [not found] <CGME20221201125412eucas1p17da85d566e9786dba7d76230f396eb57@eucas1p1.samsung.com>
@ 2022-12-01 12:52 ` Pankaj Raghav
  2022-12-02  9:23   ` Christoph Hellwig
  2022-12-06  8:08   ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Pankaj Raghav @ 2022-12-01 12:52 UTC (permalink / raw)
  To: Keith Busch, Christoph Hellwig
  Cc: Sagi Grimberg, linux-nvme, gost.dev, Monish Kumar, Pankaj Raghav

A device might have a core quirk for NVME_QUIRK_IGNORE_DEV_SUBNQN(such as
Samsung X5) but it would still give a warning "missing or invalid
SUBNQN field" as core quirks are filled after calling nvme_init_subnqn().

Fill ctrl->quirks from struct core_quirks before calling
nvme_init_subsystem().

Tested it on a Samsung X5:

Before patch:
nvme nvme1: pci function 0000:3e:00.0
nvme 0000:3e:00.0: enabling device (0000 -> 0002)
nvme nvme1: missing or invalid SUBNQN field.
nvme nvme1: Shutdown timeout set to 8 seconds
nvme nvme1: 8/0/0 default/read/poll queues

After Patch:
nvme nvme1: pci function 0000:3e:00.0
nvme 0000:3e:00.0: enabling device (0000 -> 0002)
nvme nvme1: Shutdown timeout set to 8 seconds
nvme nvme1: 8/0/0 default/read/poll queues

Fixes: ab9e00cc72fa ("nvme: track subsystems")
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 drivers/nvme/host/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e68b98daf38a..0ac37a4afc20 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3123,10 +3123,6 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
 	if (!ctrl->identified) {
 		unsigned int i;
 
-		ret = nvme_init_subsystem(ctrl, id);
-		if (ret)
-			goto out_free;
-
 		/*
 		 * Check for quirks.  Quirk can depend on firmware version,
 		 * so, in principle, the set of quirks present can change
@@ -3139,6 +3135,10 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
 			if (quirk_matches(id, &core_quirks[i]))
 				ctrl->quirks |= core_quirks[i].quirks;
 		}
+
+		ret = nvme_init_subsystem(ctrl, id);
+		if (ret)
+			goto out_free;
 	}
 	memcpy(ctrl->subsys->firmware_rev, id->fr,
 	       sizeof(ctrl->subsys->firmware_rev));
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem()
  2022-12-01 12:52 ` [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem() Pankaj Raghav
@ 2022-12-02  9:23   ` Christoph Hellwig
  2022-12-02  9:54     ` Pankaj Raghav
  2022-12-06  8:08   ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2022-12-02  9:23 UTC (permalink / raw)
  To: Pankaj Raghav
  Cc: Keith Busch, Christoph Hellwig, Sagi Grimberg, linux-nvme,
	gost.dev, Monish Kumar

On Thu, Dec 01, 2022 at 01:52:34PM +0100, Pankaj Raghav wrote:
> A device might have a core quirk for NVME_QUIRK_IGNORE_DEV_SUBNQN(such as
> Samsung X5) but it would still give a warning "missing or invalid
> SUBNQN field" as core quirks are filled after calling nvme_init_subnqn().
> 
> Fill ctrl->quirks from struct core_quirks before calling
> nvme_init_subsystem().
> 
> Tested it on a Samsung X5:

Yes, this looks reasonable.  But it won't help with the CSTS
corruption reported by Monish, so it seems like the SSD doesn't actually
show that issue in all systems?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem()
  2022-12-02  9:23   ` Christoph Hellwig
@ 2022-12-02  9:54     ` Pankaj Raghav
  0 siblings, 0 replies; 4+ messages in thread
From: Pankaj Raghav @ 2022-12-02  9:54 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, linux-nvme, gost.dev, Monish Kumar

On 2022-12-02 10:23, Christoph Hellwig wrote:
> On Thu, Dec 01, 2022 at 01:52:34PM +0100, Pankaj Raghav wrote:
>> A device might have a core quirk for NVME_QUIRK_IGNORE_DEV_SUBNQN(such as
>> Samsung X5) but it would still give a warning "missing or invalid
>> SUBNQN field" as core quirks are filled after calling nvme_init_subnqn().
>>
>> Fill ctrl->quirks from struct core_quirks before calling
>> nvme_init_subsystem().
>>
>> Tested it on a Samsung X5:
> 
> Yes, this looks reasonable.  But it won't help with the CSTS

You are right. I don't think this will help with the CSTS issue, but I
discovered this error message popping up while investigating that issue,
even though I remember the patch you sent that added a quirk to suppress
this message.

> corruption reported by Monish, so it seems like the SSD doesn't actually
> show that issue in all systems?

Yeah, I am not able to reproduce that error in my setup. I am discussing it
with their team to find out the possible root cause.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem()
  2022-12-01 12:52 ` [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem() Pankaj Raghav
  2022-12-02  9:23   ` Christoph Hellwig
@ 2022-12-06  8:08   ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-12-06  8:08 UTC (permalink / raw)
  To: Pankaj Raghav
  Cc: Keith Busch, Christoph Hellwig, Sagi Grimberg, linux-nvme,
	gost.dev, Monish Kumar

Thanks,

applied to nvme-6.1.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-06  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20221201125412eucas1p17da85d566e9786dba7d76230f396eb57@eucas1p1.samsung.com>
2022-12-01 12:52 ` [PATCH] nvme:core: initialize core quirks before calling nvme_init_subsystem() Pankaj Raghav
2022-12-02  9:23   ` Christoph Hellwig
2022-12-02  9:54     ` Pankaj Raghav
2022-12-06  8:08   ` Christoph Hellwig

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.