All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Few NVME fixes
@ 2019-05-02 11:31 Maxim Levitsky
  2019-05-02 11:31 ` [PATCH 1/2] nvme/pci: init shadow doorbell after each reset Maxim Levitsky
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Maxim Levitsky @ 2019-05-02 11:31 UTC (permalink / raw)


Hi,

I am sending here two fixes for bugs I found during develpment of nvme-mdev
driver.
Patches are based on http://git.infradead.org/nvme.git nvme-5.2


Best regards,
	Maxim Levitsky


Maxim Levitsky (2):
  nvme/pci: init shadow doorbell after each reset
  nvme/pci: add known admin effects to augument admin effects log page

 drivers/nvme/host/core.c | 4 ++--
 drivers/nvme/host/pci.c  | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.17.2

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

* [PATCH 1/2] nvme/pci: init shadow doorbell after each reset
  2019-05-02 11:31 [PATCH 0/2] Few NVME fixes Maxim Levitsky
@ 2019-05-02 11:31 ` Maxim Levitsky
  2019-05-02 13:08   ` Keith Busch
  2019-05-02 11:31 ` [PATCH 2/2] nvme/pci: add known admin effects to augument admin effects log page Maxim Levitsky
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Maxim Levitsky @ 2019-05-02 11:31 UTC (permalink / raw)


The spec states
"The settings are not retained across a Controller Level Reset"
Therefore the driver must enable the shadow doorbell,
after each reset.

This was caught while testing the nvme driver over
upcoming nvme-mdev device

Signed-off-by: Maxim Levitsky <mlevitsk at redhat.com>
---
 drivers/nvme/host/pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 1f468a16efad..1c844c66ecaa 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2303,8 +2303,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
 			return ret;
 		}
 		dev->ctrl.tagset = &dev->tagset;
-
-		nvme_dbbuf_set(dev);
 	} else {
 		blk_mq_update_nr_hw_queues(&dev->tagset, dev->online_queues - 1);
 
@@ -2312,6 +2310,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
 		nvme_free_queues(dev, dev->online_queues);
 	}
 
+	nvme_dbbuf_set(dev);
 	return 0;
 }
 
-- 
2.17.2

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

* [PATCH 2/2] nvme/pci: add known admin effects to augument admin effects log page
  2019-05-02 11:31 [PATCH 0/2] Few NVME fixes Maxim Levitsky
  2019-05-02 11:31 ` [PATCH 1/2] nvme/pci: init shadow doorbell after each reset Maxim Levitsky
@ 2019-05-02 11:31 ` Maxim Levitsky
       [not found] ` <CGME20190502113150epcas4p2a4a2a783b46411ed0895978811545c73@epcms2p3>
  2019-05-08  7:10 ` [PATCH 0/2] Few NVME fixes Christoph Hellwig
  3 siblings, 0 replies; 6+ messages in thread
From: Maxim Levitsky @ 2019-05-02 11:31 UTC (permalink / raw)


Add known admin effects even if hardware has known admin effects page,
since hardware can't be ever trusted to report sane values.
(on my Intel DC P3700, it reports no side effects for namespace format)

Signed-off-by: Maxim Levitsky <mlevitsk at redhat.com>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3dd043aa6d1f..2e11d014d514 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1259,8 +1259,8 @@ static u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
 
 	if (ctrl->effects)
 		effects = le32_to_cpu(ctrl->effects->acs[opcode]);
-	else
-		effects = nvme_known_admin_effects(opcode);
+
+	effects |= nvme_known_admin_effects(opcode);
 
 	/*
 	 * For simplicity, IO to all namespaces is quiesced even if the command
-- 
2.17.2

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

* [PATCH 1/2] nvme/pci: init shadow doorbell after each reset
  2019-05-02 11:31 ` [PATCH 1/2] nvme/pci: init shadow doorbell after each reset Maxim Levitsky
@ 2019-05-02 13:08   ` Keith Busch
  0 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2019-05-02 13:08 UTC (permalink / raw)


On Thu, May 02, 2019@02:31:33PM +0300, Maxim Levitsky wrote:
> @@ -2303,8 +2303,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
>  			return ret;
>  		}
>  		dev->ctrl.tagset = &dev->tagset;
> -
> -		nvme_dbbuf_set(dev);
>  	} else {
>  		blk_mq_update_nr_hw_queues(&dev->tagset, dev->online_queues - 1);
>  
> @@ -2312,6 +2310,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
>  		nvme_free_queues(dev, dev->online_queues);
>  	}
>  
> +	nvme_dbbuf_set(dev);
>  	return 0;
>  }

Looks good.

Reviewed-by: Keith Busch <keith.busch at intel.com>

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

* [PATCH 1/2] nvme/pci: init shadow doorbell after each reset
       [not found] ` <CGME20190502113150epcas4p2a4a2a783b46411ed0895978811545c73@epcms2p3>
@ 2019-05-05  4:18   ` Minwoo Im
  0 siblings, 0 replies; 6+ messages in thread
From: Minwoo Im @ 2019-05-05  4:18 UTC (permalink / raw)


> -----Original Message-----
> From: Linux-nvme [mailto:linux-nvme-bounces at lists.infradead.org] On
> Behalf Of Maxim Levitsky
> Sent: Thursday, May 02, 2019 8:32 PM
> To: linux-nvme at lists.infradead.org
> Subject: [PATCH 1/2] nvme/pci: init shadow doorbell after each reset
> 
> The spec states
> "The settings are not retained across a Controller Level Reset"
> Therefore the driver must enable the shadow doorbell,
> after each reset.
> 
> This was caught while testing the nvme driver over
> upcoming nvme-mdev device
> 
> Signed-off-by: Maxim Levitsky <mlevitsk at redhat.com>

It looks good to me.

Reviewed-by: Minwoo Im <minwoo.im at samsung.com>

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

* [PATCH 0/2] Few NVME fixes
  2019-05-02 11:31 [PATCH 0/2] Few NVME fixes Maxim Levitsky
                   ` (2 preceding siblings ...)
       [not found] ` <CGME20190502113150epcas4p2a4a2a783b46411ed0895978811545c73@epcms2p3>
@ 2019-05-08  7:10 ` Christoph Hellwig
  3 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2019-05-08  7:10 UTC (permalink / raw)


Thanks,

applied both patches to nvme-5.2.

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

end of thread, other threads:[~2019-05-08  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02 11:31 [PATCH 0/2] Few NVME fixes Maxim Levitsky
2019-05-02 11:31 ` [PATCH 1/2] nvme/pci: init shadow doorbell after each reset Maxim Levitsky
2019-05-02 13:08   ` Keith Busch
2019-05-02 11:31 ` [PATCH 2/2] nvme/pci: add known admin effects to augument admin effects log page Maxim Levitsky
     [not found] ` <CGME20190502113150epcas4p2a4a2a783b46411ed0895978811545c73@epcms2p3>
2019-05-05  4:18   ` [PATCH 1/2] nvme/pci: init shadow doorbell after each reset Minwoo Im
2019-05-08  7:10 ` [PATCH 0/2] Few NVME fixes 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.