Commit 6014e75e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'cxl-fixes-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl

Pull cxl fixes from Dave Jiang:

 - Fix incorrect device handle check for Generic Initiator

 - Fix offset calculation for extended linear cache poison injection

 - Fix lockdep warning for hmem_register_resource()

* tag 'cxl-fixes-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
  acpi/hmat: Fix lockdep warning for hmem_register_resource()
  cxl: Adjust offset calculation for poison injection
  acpi,srat: Fix incorrect device handle check for Generic Initiator
parents de90cc61 214291cb
Loading
Loading
Loading
Loading
+25 −21
Original line number Diff line number Diff line
@@ -874,10 +874,32 @@ static void hmat_register_target_devices(struct memory_target *target)
	}
}

static void hmat_register_target(struct memory_target *target)
static void hmat_hotplug_target(struct memory_target *target)
{
	int nid = pxm_to_node(target->memory_pxm);

	/*
	 * Skip offline nodes. This can happen when memory marked EFI_MEMORY_SP,
	 * "specific purpose", is applied to all the memory in a proximity
	 * domain leading to * the node being marked offline / unplugged, or if
	 * memory-only "hotplug" node is offline.
	 */
	if (nid == NUMA_NO_NODE || !node_online(nid))
		return;

	guard(mutex)(&target_lock);
	if (target->registered)
		return;

	hmat_register_target_initiators(target);
	hmat_register_target_cache(target);
	hmat_register_target_perf(target, ACCESS_COORDINATE_LOCAL);
	hmat_register_target_perf(target, ACCESS_COORDINATE_CPU);
	target->registered = true;
}

static void hmat_register_target(struct memory_target *target)
{
	/*
	 * Devices may belong to either an offline or online
	 * node, so unconditionally add them.
@@ -895,25 +917,7 @@ static void hmat_register_target(struct memory_target *target)
	}
	mutex_unlock(&target_lock);

	/*
	 * Skip offline nodes. This can happen when memory
	 * marked EFI_MEMORY_SP, "specific purpose", is applied
	 * to all the memory in a proximity domain leading to
	 * the node being marked offline / unplugged, or if
	 * memory-only "hotplug" node is offline.
	 */
	if (nid == NUMA_NO_NODE || !node_online(nid))
		return;

	mutex_lock(&target_lock);
	if (!target->registered) {
		hmat_register_target_initiators(target);
		hmat_register_target_cache(target);
		hmat_register_target_perf(target, ACCESS_COORDINATE_LOCAL);
		hmat_register_target_perf(target, ACCESS_COORDINATE_CPU);
		target->registered = true;
	}
	mutex_unlock(&target_lock);
	hmat_hotplug_target(target);
}

static void hmat_register_targets(void)
@@ -939,7 +943,7 @@ static int hmat_callback(struct notifier_block *self,
	if (!target)
		return NOTIFY_OK;

	hmat_register_target(target);
	hmat_hotplug_target(target);
	return NOTIFY_OK;
}

+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
		struct acpi_srat_generic_affinity *p =
			(struct acpi_srat_generic_affinity *)header;

		if (p->device_handle_type == 0) {
		if (p->device_handle_type == 1) {
			/*
			 * For pci devices this may be the only place they
			 * are assigned a proximity domain
+2 −0
Original line number Diff line number Diff line
@@ -3702,6 +3702,7 @@ static int cxl_region_debugfs_poison_inject(void *data, u64 offset)
	if (validate_region_offset(cxlr, offset))
		return -EINVAL;

	offset -= cxlr->params.cache_size;
	rc = region_offset_to_dpa_result(cxlr, offset, &result);
	if (rc || !result.cxlmd || result.dpa == ULLONG_MAX) {
		dev_dbg(&cxlr->dev,
@@ -3734,6 +3735,7 @@ static int cxl_region_debugfs_poison_clear(void *data, u64 offset)
	if (validate_region_offset(cxlr, offset))
		return -EINVAL;

	offset -= cxlr->params.cache_size;
	rc = region_offset_to_dpa_result(cxlr, offset, &result);
	if (rc || !result.cxlmd || result.dpa == ULLONG_MAX) {
		dev_dbg(&cxlr->dev,