nvme-pci: fix var. type for increasing cq_head
authorJK Kim <jongkang.kim2@gmail.com>
Thu, 17 Jun 2021 06:02:17 +0000 (15:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:00 +0000 (16:56 +0200)
commit66e8848482f2bfb742530e68852edada5114217f
treeff8f4338630e35294c266ba95405ebaaf34b67d2
parent9dc2c2b94194fbe55456ee6272df0eb53a72909a
nvme-pci: fix var. type for increasing cq_head

[ Upstream commit a0aac973a26d1ac814b9e131e209eb39472a67ce ]

nvmeq->cq_head is compared with nvmeq->q_depth and changed the value
and cq_phase for handling the next cq db.

but, nvmeq->q_depth's type is u32 and max. value is 0x10000 when
CQP.MSQE is 0xffff and io_queue_depth is 0x10000.

current temp. variable for comparing with nvmeq->q_depth is overflowed
when previous nvmeq->cq_head is 0xffff.

in this case, nvmeq->cq_phase is not updated.
so, fix data type for temp. variable to u32.

Signed-off-by: JK Kim <jongkang.kim2@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c