All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] hw/nvme: fix controller hotplugging
@ 2021-07-07 15:49 Klaus Jensen
  2021-07-07 15:49 ` [PATCH v2 1/4] hw/nvme: remove NvmeCtrl parameter from ns setup/check functions Klaus Jensen
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Klaus Jensen @ 2021-07-07 15:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Keith Busch, Klaus Jensen, Hannes Reinecke, qemu-block, Klaus Jensen

From: Klaus Jensen <k.jensen@samsung.com>

Back in May, Hannes posted a fix[1] to re-enable NVMe PCI hotplug. We
discussed a bit back and fourth and I mentioned that the core issue was
an artifact of the parent/child relationship stemming from the qdev
setup we have with namespaces attaching to controller through a qdev
bus.

The gist of this series is the fourth patch "hw/nvme: fix controller hot
unplugging" which basically causes namespaces to be reassigned to a bus
owned by the subsystem if the parent controller is linked to one. This
fixes `device_del/add nvme` in such settings.

Note, that in the case that there is no subsystem involved, nvme devices
can be removed from the system with `device_del`, but this *will* cause
the namespaces to be removed as well since there is no place (i.e. no
subsystem) for them to "linger". And since this series does not add
support for hotplugging nvme-ns devices, while an nvme device can be
readded, no namespaces can. Support for hotplugging nvme-ns devices is
present in [1], but I'd rather not add that since I think '-device
nvme-ns' is already a bad design choice.

Now, I do realize that it is not "pretty" to explicitly change the
parent bus, so I do have a an RFC patch in queue that replaces the
subsystem and namespace devices with objects, but keeps -device shims
available for backwards compatibility. This approach will solve the
problems properly and should be a better model. However, I don't believe
it will make it for 6.1 and I'd really like to at least fix the
unplugging for 6.1 and this gets the job done.

  [1]: 20210511073511.32511-1-hare@suse.de

v2:
- added R-b's by Hannes for patches 1 through 3
- simplified "hw/nvme: fix controller hot unplugging"

Klaus Jensen (4):
  hw/nvme: remove NvmeCtrl parameter from ns setup/check functions
  hw/nvme: mark nvme-subsys non-hotpluggable
  hw/nvme: unregister controller with subsystem at exit
  hw/nvme: fix controller hot unplugging

 hw/nvme/nvme.h   | 18 +++++++++-------
 hw/nvme/ctrl.c   | 14 ++++++------
 hw/nvme/ns.c     | 55 +++++++++++++++++++++++++++++++-----------------
 hw/nvme/subsys.c |  9 ++++++++
 4 files changed, 63 insertions(+), 33 deletions(-)

-- 
2.32.0



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

end of thread, other threads:[~2021-07-09 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 15:49 [PATCH v2 0/4] hw/nvme: fix controller hotplugging Klaus Jensen
2021-07-07 15:49 ` [PATCH v2 1/4] hw/nvme: remove NvmeCtrl parameter from ns setup/check functions Klaus Jensen
2021-07-07 15:49 ` [PATCH v2 2/4] hw/nvme: mark nvme-subsys non-hotpluggable Klaus Jensen
2021-07-07 15:49 ` [PATCH v2 3/4] hw/nvme: unregister controller with subsystem at exit Klaus Jensen
2021-07-07 15:49 ` [PATCH v2 4/4] hw/nvme: fix controller hot unplugging Klaus Jensen
2021-07-07 15:57   ` Hannes Reinecke
2021-07-07 16:56     ` Klaus Jensen
2021-07-08  5:16       ` Klaus Jensen
2021-07-09  6:05 ` [PATCH v2 0/4] hw/nvme: fix controller hotplugging Klaus Jensen
2021-07-09  6:16   ` Hannes Reinecke
2021-07-09  6:55     ` Klaus Jensen
2021-07-09  6:59       ` Klaus Jensen
2021-07-09  8:51       ` Hannes Reinecke
2021-07-09 10:08         ` Klaus Jensen

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.