]> git.proxmox.com Git - mirror_qemu.git/commit
hw/nvme: Implement the Function Level Reset
authorŁukasz Gieryk <lukasz.gieryk@linux.intel.com>
Mon, 9 May 2022 14:16:12 +0000 (16:16 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Thu, 23 Jun 2022 21:24:28 +0000 (23:24 +0200)
commit1e9c685ec76e3b10de29c4ac7ad02d86cb5aeff1
tree3a1a10217d21aacb1ded947c5c327b88a156c69e
parent99f48ae7aea70fb080f04bf1cc846cd6450bd11a
hw/nvme: Implement the Function Level Reset

This patch implements the Function Level Reset, a feature currently not
implemented for the Nvme device, while listed as a mandatory ("shall")
in the 1.4 spec.

The implementation reuses FLR-related building blocks defined for the
pci-bridge module, and follows the same logic:
    - FLR capability is advertised in the PCIE config,
    - custom pci_write_config callback detects a write to the trigger
      register and performs the PCI reset,
    - which, eventually, calls the custom dc->reset handler.

Depending on reset type, parts of the state should (or should not) be
cleared. To distinguish the type of reset, an additional parameter is
passed to the reset function.

This patch also enables advertisement of the Power Management PCI
capability. The main reason behind it is to announce the no_soft_reset=1
bit, to signal SR-IOV support where each VF can be reset individually.

The implementation purposedly ignores writes to the PMCS.PS register,
as even such naïve behavior is enough to correctly handle the D3->D0
transition.

It’s worth to note, that the power state transition back to to D3, with
all the corresponding side effects, wasn't and stil isn't handled
properly.

Signed-off-by: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/nvme/ctrl.c
hw/nvme/nvme.h
hw/nvme/trace-events