Linux CXL
 help / color / mirror / Atom feed
* [PATCH v3 00/10] cxl/mem: Fix shutdown order
@ 2023-10-06  7:25 Dan Williams
  2023-10-06  7:26 ` [PATCH v3 01/10] cxl/pci: Remove unnecessary device reference management in sanitize work Dan Williams
                   ` (9 more replies)
  0 siblings, 10 replies; 40+ messages in thread
From: Dan Williams @ 2023-10-06  7:25 UTC (permalink / raw)
  To: linux-cxl
  Cc: Ira Weiny, Dave Jiang, Davidlohr Bueso, Jonathan Cameron,
	Jonathan Cameron

Changes since v2 [1]:
- Fix @dev vs @host confusion in cxl_sanitize_setup_notifier()
  (Davidlohr)
- Fix hardirq vs threadirq context for taking mbox lock in the handler
  (Davidlohr)
- Switch a test to boolean notation (Jonathan)
- Clarify why cxl_sanitize_setup_notifier() takes @cxlmd, instead of
  @mds (Jonathan)
- Drop export of cxl_mem_sanitize()
- Make it more obvious where some setup functions are taking an @host
  parameter vs an device object / context to operate on parameter.
- Fix synchronization between sanitize and decoder commit
- Add cxl_test infrastructure to regression test these ABI paths

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

---

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 [2].

[2]: http://lore.kernel.org/r/20230929100316.00004546@Huawei.com

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.

As I went to checkout the notifier in cxl_test I realized that it
insta-crashes since it tries to read registers from a sysfs attribute.
It turns out that could be fixed as a side effect of fixing the race
between issuing the sanitize command and committing decoders.

Given the new locking and the fallout from not having regression
coverage here I went ahead and extended cxl_test to exercise these ABI
paths. Watch for the related cxl-cli set next.

---

Dan Williams (10):
      cxl/pci: Remove unnecessary device reference management in sanitize work
      cxl/pci: Cleanup 'sanitize' to always poll
      cxl/pci: Remove hardirq handler for cxl_request_irq()
      cxl/pci: Remove inconsistent usage of dev_err_probe()
      cxl/pci: Clarify devm host for memdev relative setup
      cxl/pci: Fix sanitize notifier setup
      cxl/memdev: Fix sanitize vs decoder setup locking
      cxl/mem: Fix shutdown order
      tools/testing/cxl: Make cxl_memdev_state available to other command emulation
      tools/testing/cxl: Add 'sanitize notifier' support


 drivers/cxl/core/core.h      |    1 
 drivers/cxl/core/hdm.c       |   19 +++++
 drivers/cxl/core/mbox.c      |   55 +++++++++++----
 drivers/cxl/core/memdev.c    |  157 ++++++++++++++++++------------------------
 drivers/cxl/core/port.c      |    6 ++
 drivers/cxl/core/region.c    |    6 --
 drivers/cxl/cxlmem.h         |   13 ++-
 drivers/cxl/pci.c            |   88 +++++++++++-------------
 tools/testing/cxl/test/mem.c |   78 +++++++++++++++++++--
 9 files changed, 256 insertions(+), 167 deletions(-)

base-commit: 6465e260f48790807eef06b583b38ca9789b6072

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

end of thread, other threads:[~2023-10-13 17:25 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06  7:25 [PATCH v3 00/10] cxl/mem: Fix shutdown order Dan Williams
2023-10-06  7:26 ` [PATCH v3 01/10] cxl/pci: Remove unnecessary device reference management in sanitize work Dan Williams
2023-10-06  7:26 ` [PATCH v3 02/10] cxl/pci: Cleanup 'sanitize' to always poll Dan Williams
2023-10-09 17:19   ` Davidlohr Bueso
2023-10-09 18:39     ` Dan Williams
2023-10-09 20:48       ` Davidlohr Bueso
2023-10-06  7:26 ` [PATCH v3 03/10] cxl/pci: Remove hardirq handler for cxl_request_irq() Dan Williams
2023-10-06 22:06   ` Davidlohr Bueso
2023-10-09  3:29   ` Ira Weiny
2023-10-09 16:36   ` Jonathan Cameron
2023-10-13 16:59   ` Dave Jiang
2023-10-06  7:26 ` [PATCH v3 04/10] cxl/pci: Remove inconsistent usage of dev_err_probe() Dan Williams
2023-10-06 22:10   ` Davidlohr Bueso
2023-10-09  3:42   ` Ira Weiny
2023-10-09 16:38   ` Jonathan Cameron
2023-10-13 17:09   ` Dave Jiang
2023-10-06  7:26 ` [PATCH v3 05/10] cxl/pci: Clarify devm host for memdev relative setup Dan Williams
2023-10-09  3:50   ` Ira Weiny
2023-10-09 16:41   ` Jonathan Cameron
2023-10-13 17:12   ` Dave Jiang
2023-10-06  7:26 ` [PATCH v3 06/10] cxl/pci: Fix sanitize notifier setup Dan Williams
2023-10-09 16:42   ` Jonathan Cameron
2023-10-09 18:08   ` Davidlohr Bueso
2023-10-06  7:26 ` [PATCH v3 07/10] cxl/memdev: Fix sanitize vs decoder setup locking Dan Williams
2023-10-06 10:10   ` kernel test robot
2023-10-09  4:17   ` Ira Weiny
2023-10-09 18:18     ` Dan Williams
2023-10-09 22:32       ` Dan Williams
2023-10-09 16:46   ` Jonathan Cameron
2023-10-09 18:36     ` Dan Williams
2023-10-11 20:44       ` Jonathan Cameron
2023-10-10 20:21   ` Davidlohr Bueso
2023-10-13 17:20   ` Dave Jiang
2023-10-06  7:26 ` [PATCH v3 08/10] cxl/mem: Fix shutdown order Dan Williams
2023-10-06  7:26 ` [PATCH v3 09/10] tools/testing/cxl: Make cxl_memdev_state available to other command emulation Dan Williams
2023-10-09  3:24   ` Ira Weiny
2023-10-13 17:21   ` Dave Jiang
2023-10-06  7:26 ` [PATCH v3 10/10] tools/testing/cxl: Add 'sanitize notifier' support Dan Williams
2023-10-09  4:25   ` Ira Weiny
2023-10-13 17:25   ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox