linux-stable/drivers/cxl
Ira Weiny d9a476c837 cxl/region: Remove lock from memory notifier callback
In testing Dynamic Capacity Device (DCD) support, a lockdep splat
revealed an ABBA issue between the memory notifiers and the DCD extent
processing code.[0]  Changing the lock ordering within DCD proved
difficult because regions must be stable while searching for the proper
region and then the device lock must be held to properly notify the DAX
region driver of memory changes.

Dan points out in the thread that notifiers should be able to trust that
it is safe to access static data.  Region data is static once the device
is realized and until it's destruction.  Thus it is better to manage the
notifiers within the region driver.

Remove the need for a lock by ensuring the notifiers are active only
during the region's lifetime.

Furthermore, remove cxl_region_nid() because resource can't be NULL
while the region is stable.

Link: https://lore.kernel.org/all/66b4cf539a79b_a36e829416@iweiny-mobl.notmuch/ [0]
Cc: Ying Huang <ying.huang@intel.com>
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Ying Huang <ying.huang@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://patch.msgid.link/20240904-fix-notifiers-v3-1-576b4e950266@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
2024-09-09 11:33:44 -07:00
..
core cxl/region: Remove lock from memory notifier callback 2024-09-09 11:33:44 -07:00
acpi.c Merge branch 'for-6.11/xor_fixes' into cxl-for-next 2024-07-11 16:47:47 -07:00
cxl.h cxl/pci: Remove duplicated implementation of waiting for memory_info_valid 2024-09-09 11:33:44 -07:00
cxlmem.h CXL for v6.11 merge window 2024-07-28 09:33:28 -07:00
cxlpci.h PCI/CXL: Move CXL Vendor ID to pci_ids.h 2024-05-08 13:18:33 -05:00
Kconfig cxl: Fix use of phys_to_target_node() for x86 2024-04-30 10:43:48 -07:00
Makefile cxl/pmem: Introduce nvdimm_security_ops with ->get_flags() operation 2022-11-30 16:30:47 -08:00
mem.c cxl/pci: Rename cxl_setup_parent_dport() and cxl_dport_map_regs() 2024-09-03 15:29:33 -07:00
pci.c cxl/port: Use __free() to drop put_device() for cxl_port 2024-09-03 14:49:48 -07:00
pmem.c cxl/port: Use scoped_guard()/guard() to drop device_lock() for cxl_port 2024-09-03 14:49:49 -07:00
pmu.h cxl/pci: Find and register CXL PMU devices 2023-05-30 11:20:35 -07:00
port.c cxl/pci: Remove duplicated implementation of waiting for memory_info_valid 2024-09-09 11:33:44 -07:00
security.c Merge branch 'for-6.5/cxl-type-2' into for-6.5/cxl 2023-06-25 17:16:51 -07:00