Unverified Commit 6b10ee06 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!451 add drivers to support hbm memory and hbm cache

Merge Pull Request from: @zhang-zekun-zk 
 
add drivers to support hbm memory and hbm cache 
 
Link:https://gitee.com/openeuler/kernel/pulls/451

 

Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents be3a5f25 24856a36
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ struct acpi_memory_device {
	struct list_head res_list;
};

struct acpi_device *hotplug_mdev[MAX_NUMNODES];
EXPORT_SYMBOL_GPL(hotplug_mdev);

static acpi_status
acpi_memory_get_resource(struct acpi_resource *resource, void *context)
{
@@ -217,6 +220,8 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
		 * Add num_enable even if add_memory() returns -EEXIST, so the
		 * device is bound to this driver.
		 */

		hotplug_mdev[node] = mem_device->device;
		num_enabled++;
	}
	if (!num_enabled) {
@@ -240,6 +245,7 @@ static void acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
	struct acpi_memory_info *info, *n;
	int nid = acpi_get_node(handle);

	hotplug_mdev[nid] = NULL;
	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
		if (!info->enabled)
			continue;
+27 −0
Original line number Diff line number Diff line
@@ -966,6 +966,33 @@ struct bus_type acpi_bus_type = {
	.uevent		= acpi_device_uevent,
};

struct acpi_dev_walk_context {
	int (*fn)(struct acpi_device *, void *);
	void *data;
};

static int acpi_dev_for_one_check(struct device *dev, void *context)
{
	struct acpi_dev_walk_context *adwc = context;

	if (dev->bus != &acpi_bus_type)
		return 0;

	return adwc->fn(to_acpi_device(dev), adwc->data);
}

int acpi_dev_for_each_child(struct acpi_device *adev,
			    int (*fn)(struct acpi_device *, void *), void *data)
{
	struct acpi_dev_walk_context adwc = {
		.fn = fn,
		.data = data,
	};

	return device_for_each_child(&adev->dev, &adwc, acpi_dev_for_one_check);
}
EXPORT_SYMBOL_GPL(acpi_dev_for_each_child);

/* --------------------------------------------------------------------------
                             Initialization/Cleanup
   -------------------------------------------------------------------------- */
+0 −1
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ static inline void acpi_lpss_init(void) {}

void acpi_apd_init(void);

acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
bool acpi_queue_hotplug_work(struct work_struct *work);
void acpi_device_hotplug(struct acpi_device *adev, u32 src);
bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent);
+1 −0
Original line number Diff line number Diff line
@@ -1188,6 +1188,7 @@ acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src)
	}
	return AE_OK;
}
EXPORT_SYMBOL_GPL(acpi_hotplug_schedule);

bool acpi_queue_hotplug_work(struct work_struct *work)
{
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ struct bus_type container_subsys = {
	.online = trivial_online,
	.offline = container_offline,
};
EXPORT_SYMBOL_GPL(container_subsys);

void __init container_dev_init(void)
{
Loading