Commit 039ec3f7 authored by Zhang Zekun's avatar Zhang Zekun Committed by Zhong Jinghua
Browse files

soc: hisilicon: hisi_hbmdev: Add power domain control methods

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I67QNJ


CVE: NA

------------------------------------------------------------------

Platform devices which supports power control are often required to be
power off/on together with the devices in the same power domain. However,
there isn't a generic driver that support the power control logic of
these devices.

ACPI container seems to be a good place to hold these control logic. Add
platform devices in the same power domain in a ACPI container, we can
easily get the locality information about these devices and can moniter
the power of these devices in the same power domain together.

This patch provide three userspace control interface to control the power
of devices together in the container:
- state: Echo online to state to power up the devices in the container and
  then online these devices which will be triggered by BIOS. Echo offline
  to the state to offline and eject the child devices in the container
  which are ejectable.
- pxms: show the pxms of devices which are present in the container.

In our scenario, we need to control the power of HBM memory devices which
can be power consuming and will only be used in some specialized scenarios,
such as HPC. HBM memory devices in a socket are in the same power domain,
and should be power off/on together. We have come up with an idea that put
these power control logic in a specialized driver, but ACPI container seems
to be a more generic place to hold these control logic.

Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
parent 8a61b544
Loading
Loading
Loading
Loading
+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)
{
+1 −0
Original line number Diff line number Diff line
@@ -23,5 +23,6 @@ source "drivers/soc/versatile/Kconfig"
source "drivers/soc/xilinx/Kconfig"
source "drivers/soc/zte/Kconfig"
source "drivers/soc/kendryte/Kconfig"
source "drivers/soc/hisilicon/Kconfig"

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -29,3 +29,4 @@ obj-$(CONFIG_PLAT_VERSATILE) += versatile/
obj-y				+= xilinx/
obj-$(CONFIG_ARCH_ZX)		+= zte/
obj-$(CONFIG_SOC_KENDRYTE)	+= kendryte/
obj-y				+= hisilicon/
+19 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
#
# Hisilicon SoC drivers
#
menu "Hisilicon SoC driver support"

config HISI_HBMDEV
	tristate "add extra support for hbm memory device"
	depends on ACPI_HOTPLUG_MEMORY
	select ACPI_CONTAINER
	help
	  This driver add extra supports for memory devices. The driver
	  provides methods for userpace to control the power of memory
	  devices in a container.

	  To compile this driver as a module, choose M here:
	  the module will be called hisi_hbmdev.

endmenu
+3 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_HISI_HBMDEV)	+= hisi_hbmdev.o
Loading