mbox series

[v2,0/4] cxl/mem: Fix shutdown order

Message ID 169602896768.904193.11292185494339980455.stgit@dwillia2-xfh.jf.intel.com
Headers show
Series cxl/mem: Fix shutdown order | expand

Message

Dan Williams Sept. 29, 2023, 11:09 p.m. UTC
While fixing a crash where the cxlmd->cxlds validity needed to be
maintained over the span of the memdev being unregistered, I made a note
to come back and cleanup sanitize notifier setup/shutdown
implementation. Jonathan went further and noticed that the fix needs
that rework first. So the changes since v1 [1] are reworking the
sanitize notifier setup to be more idiomatic with how other driver
mechanisms are managed.

The special wrinkle of the sanitize notifier is that it interacts with
interrupts, which are enabled early in the flow, and it interacts with
memdev sysfs which is not initialized until late in the flow.

After some other cleanups, a self contained
cxl_sanitize_setup_notifier() is introduced to centralize that
incremental setup work, and leave cxl_memdev_shutdown() alone to
coordinate closing down the ioctl path relative to the unregister event
of the memdev.

[1]: http://lore.kernel.org/r/169596542307.790108.11339208844199665348.stgit@dwillia2-xfh.jf.intel.com

---

Dan Williams (4):
      cxl/pci: Remove unnecessary device reference management in sanitize work
      cxl/pci: Cleanup 'sanitize' to always poll
      cxl/pci: Fix sanitize notifier setup
      cxl/mem: Fix shutdown order


 drivers/cxl/core/memdev.c |   45 ------------------
 drivers/cxl/cxlmem.h      |    2 -
 drivers/cxl/pci.c         |  112 +++++++++++++++++++++++++++++----------------
 3 files changed, 73 insertions(+), 86 deletions(-)

base-commit: 6465e260f48790807eef06b583b38ca9789b6072