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

!14228 Implementation of the uncore frequency modulation feature

Merge Pull Request from: @li-wei2110 
 
Devfreq is a general DVFS framework for non-CPU devices in the kernel.
It is generally used for bus devices. Implementation of uncore dynamic
frequency modulation based on this framework. 
 
Link:https://gitee.com/openeuler/kernel/pulls/14228 
parents 429a1987 ac3dc0c5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -73,6 +73,12 @@ config DEVFREQ_GOV_PASSIVE
	  through sysfs entries. The passive governor recommends that
	  devfreq device uses the OPP table to get the frequency/voltage.

config DEVFREQ_GOV_UTIL
	tristate "Util"
	help
	  This governor Adjust the frequency based on the load utilization
	  rate.

comment "DEVFREQ Drivers"

config ARM_EXYNOS_BUS_DEVFREQ
@@ -150,6 +156,12 @@ config ARM_SUN8I_A33_MBUS_DEVFREQ
	  This adds the DEVFREQ driver for the MBUS controller in some
	  Allwinner sun8i (A33 through H3) and sun50i (A64 and H5) SoCs.

config ARM_HISI_UNCORE_DEVFREQ
	tristate "HiSilicon uncore DEVFREQ Driver"
	depends on (PCC && ACPI && ACPI_PPTT) || COMPILE_TEST
	help
	  HiSilicon uncore DEVFREQ Driver

source "drivers/devfreq/event/Kconfig"

endif # PM_DEVFREQ
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE) += governor_performance.o
obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE)	+= governor_powersave.o
obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)	+= governor_userspace.o
obj-$(CONFIG_DEVFREQ_GOV_PASSIVE)	+= governor_passive.o
obj-$(CONFIG_DEVFREQ_GOV_UTIL)		+= governor_util.o

# DEVFREQ Drivers
obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ)	+= exynos-bus.o
@@ -15,6 +16,7 @@ obj-$(CONFIG_ARM_MEDIATEK_CCI_DEVFREQ) += mtk-cci-devfreq.o
obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ)	+= rk3399_dmc.o
obj-$(CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ)	+= sun8i-a33-mbus.o
obj-$(CONFIG_ARM_TEGRA_DEVFREQ)		+= tegra30-devfreq.o
obj-$(CONFIG_ARM_HISI_UNCORE_DEVFREQ)	+= hisi_uncore_freq.o

# DEVFREQ Event Drivers
obj-$(CONFIG_PM_DEVFREQ_EVENT)		+= event/
+33 −1
Original line number Diff line number Diff line
@@ -256,6 +256,37 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
}
EXPORT_SYMBOL_GPL(devfreq_event_get_edev_by_phandle);

/**
 * devfreq_event_get_edev_by_dev() - Get the devfreq-event dev from
 *					 specified device.
 * @dev		: the pointer to the given device
 *
 * Note that this function return the pointer of devfreq-event device.
 */
struct devfreq_event_dev *devfreq_event_get_edev_by_dev(struct device *dev)
{
	struct devfreq_event_dev *edev;

	if (!dev)
		return ERR_PTR(-EINVAL);

	mutex_lock(&devfreq_event_list_lock);
	list_for_each_entry(edev, &devfreq_event_list, node) {
		if (edev->dev.parent == dev)
			goto out;
	}

	edev = NULL;
out:
	mutex_unlock(&devfreq_event_list_lock);

	if (!edev)
		return ERR_PTR(-ENODEV);

	return edev;
}
EXPORT_SYMBOL_GPL(devfreq_event_get_edev_by_dev);

/**
 * devfreq_event_get_edev_count() - Get the count of devfreq-event dev
 * @dev		: the pointer to the given device
@@ -328,7 +359,8 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
	edev->dev.class = devfreq_event_class;
	edev->dev.release = devfreq_event_release_edev;

	dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no));
	dev_set_name(&edev->dev, "event-%s-%d",
			 desc->name, atomic_inc_return(&event_no));
	ret = device_register(&edev->dev);
	if (ret < 0) {
		put_device(&edev->dev);
+7 −0
Original line number Diff line number Diff line
@@ -39,4 +39,11 @@ config DEVFREQ_EVENT_ROCKCHIP_DFI
	  This add the devfreq-event driver for Rockchip SoC. It provides DFI
	  (DDR Monitor Module) driver to count ddr load.

config DEVFREQ_EVENT_HISI_UNCORE
	tristate "HISI UNCORE DEVFREQ event Driver"
	depends on HISI_PMU
	help
	  This add the devfreq-event driver for HISI uncore. It provides UMM
	  (UNCORE Monitor Module) driver to count uncore load.

endif # PM_DEVFREQ_EVENT
+2 −0
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@
obj-$(CONFIG_DEVFREQ_EVENT_EXYNOS_NOCP) += exynos-nocp.o
obj-$(CONFIG_DEVFREQ_EVENT_EXYNOS_PPMU) += exynos-ppmu.o
obj-$(CONFIG_DEVFREQ_EVENT_ROCKCHIP_DFI) += rockchip-dfi.o
obj-$(CONFIG_DEVFREQ_EVENT_HISI_UNCORE) += hisi-uncore.o \
					hisi-uncore-l3c.o hisi-uncore-ddrc.o
Loading