qemu/hw/nvme
Klaus Jensen 83d7ed5c57 hw/nvme: fix pin-based interrupt behavior (again)
Jakub noticed[1] that, when using pin-based interrupts, the device will
unconditionally deasssert when any CQEs are acknowledged. However, the
pin should not be deasserted if other completion queues still holds
unacknowledged CQEs.

The bug is an artifact of commit ca247d3509 ("hw/block/nvme: fix
pin-based interrupt behavior") which fixed one bug but introduced
another. This is the third time someone tries to fix pin-based
interrupts (see commit 5e9aa92eb1 ("hw/block: Fix pin-based interrupt
behaviour of NVMe"))...

Third time's the charm, so fix it, again, by keeping track of how many
CQs have unacknowledged CQEs and only deassert when all are cleared.

  [1]: <20210610114624.304681-1-jakub.jermar@kernkonzept.com>

Cc: qemu-stable@nongnu.org
Fixes: ca247d3509 ("hw/block/nvme: fix pin-based interrupt behavior")
Reported-by: Jakub Jermář <jakub.jermar@kernkonzept.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
2021-06-29 07:18:10 +02:00
..
ctrl.c hw/nvme: fix pin-based interrupt behavior (again) 2021-06-29 07:18:10 +02:00
dif.c hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check 2021-06-29 07:16:25 +02:00
Kconfig hw/nvme: move nvme emulation out of hw/block 2021-05-17 09:19:00 +02:00
meson.build hw/nvme: move nvme emulation out of hw/block 2021-05-17 09:19:00 +02:00
ns.c hw/nvme: default for namespace EUI-64 2021-06-29 07:16:25 +02:00
nvme.h hw/nvme: fix pin-based interrupt behavior (again) 2021-06-29 07:18:10 +02:00
subsys.c hw/nvme: move nvme emulation out of hw/block 2021-05-17 09:19:00 +02:00
trace-events hw/nvme: fix endianess conversion and add controller list 2021-06-29 07:16:25 +02:00
trace.h hw/nvme: move nvme emulation out of hw/block 2021-05-17 09:19:00 +02:00