diff mbox series

[v3,2/4] hw/block/nvme: fix overwritten bar.cap

Message ID 20210114072251.334304-3-pizhenwei@bytedance.com (mailing list archive)
State New, archived
Headers show
Series support NVMe smart critial warning injection | expand

Commit Message

zhenwei pi Jan. 14, 2021, 7:22 a.m. UTC
After PMR initialization, bar.cap should not be clear in function
nvme_init_ctrl. Otherwise the PMR cap would be always disabled.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 hw/block/nvme.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Klaus Jensen Jan. 14, 2021, 8:24 a.m. UTC | #1
On Jan 14 15:22, zhenwei pi wrote:
> After PMR initialization, bar.cap should not be clear in function
> nvme_init_ctrl. Otherwise the PMR cap would be always disabled.
> 
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
>  hw/block/nvme.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 27d2c72716..f361103bb4 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -2745,7 +2745,6 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
>      id->psd[0].enlat = cpu_to_le32(0x10);
>      id->psd[0].exlat = cpu_to_le32(0x4);
>  
> -    n->bar.cap = 0;
>      NVME_CAP_SET_MQES(n->bar.cap, 0x7ff);
>      NVME_CAP_SET_CQR(n->bar.cap, 1);
>      NVME_CAP_SET_TO(n->bar.cap, 0xf);
> -- 
> 2.25.1
> 
> 

Good fix, but looks like you are on master and not on nvme-next[1]? The
same fix is already staged.

  [1]: http://git.infradead.org/qemu-nvme.git/shortlog/refs/heads/nvme-next
diff mbox series

Patch

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 27d2c72716..f361103bb4 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -2745,7 +2745,6 @@  static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
     id->psd[0].enlat = cpu_to_le32(0x10);
     id->psd[0].exlat = cpu_to_le32(0x4);
 
-    n->bar.cap = 0;
     NVME_CAP_SET_MQES(n->bar.cap, 0x7ff);
     NVME_CAP_SET_CQR(n->bar.cap, 1);
     NVME_CAP_SET_TO(n->bar.cap, 0xf);