2022-05-18 06:39:59

by [email protected]

[permalink] [raw]
Subject: [PATCH v4 2/8] drivers: base: Add Kconfig/Makefile to build hardware prefetch control core driver

Adds Kconfig/Makefile to build hardware prefetch control core driver,
and also adds a MAINTAINERS entry.

Signed-off-by: Kohei Tarumizu <[email protected]>
---
MAINTAINERS | 6 ++++++
drivers/base/Kconfig | 9 +++++++++
drivers/base/Makefile | 1 +
3 files changed, 16 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index d6d879cb0afd..f188403bc2e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8620,6 +8620,12 @@ F: include/linux/hwmon*.h
F: include/trace/events/hwmon*.h
K: (devm_)?hwmon_device_(un)?register(|_with_groups|_with_info)

+HARDWARE PREFETCH CONTROL DRIVERS
+M: Kohei Tarumizu <[email protected]>
+S: Maintained
+F: drivers/base/pfctl.c
+F: include/linux/pfctl.h
+
HARDWARE RANDOM NUMBER GENERATOR CORE
M: Matt Mackall <[email protected]>
M: Herbert Xu <[email protected]>
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 6f04b831a5c0..8f8a69e7f645 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -230,4 +230,13 @@ config GENERIC_ARCH_NUMA
Enable support for generic NUMA implementation. Currently, RISC-V
and ARM64 use it.

+config HWPF_CONTROL
+ bool "Hardware Prefetch Control driver"
+ help
+ This driver allows user to control CPU's Hardware Prefetch behavior.
+ If the machine supports this behavior, it provides a sysfs interface.
+
+ See Documentation/ABI/testing/sysfs-devices-system-cpu for more
+ information.
+
endmenu
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 02f7f1358e86..13f3a0ddf3d1 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_DEV_COREDUMP) += devcoredump.o
obj-$(CONFIG_GENERIC_MSI_IRQ_DOMAIN) += platform-msi.o
obj-$(CONFIG_GENERIC_ARCH_TOPOLOGY) += arch_topology.o
obj-$(CONFIG_GENERIC_ARCH_NUMA) += arch_numa.o
+obj-$(CONFIG_HWPF_CONTROL) += pfctl.o

obj-y += test/

--
2.27.0



2022-05-18 07:15:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v4 2/8] drivers: base: Add Kconfig/Makefile to build hardware prefetch control core driver

On Wed, May 18, 2022 at 03:30:26PM +0900, Kohei Tarumizu wrote:
> Adds Kconfig/Makefile to build hardware prefetch control core driver,
> and also adds a MAINTAINERS entry.
>
> Signed-off-by: Kohei Tarumizu <[email protected]>
> ---
> MAINTAINERS | 6 ++++++
> drivers/base/Kconfig | 9 +++++++++
> drivers/base/Makefile | 1 +
> 3 files changed, 16 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d6d879cb0afd..f188403bc2e9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -8620,6 +8620,12 @@ F: include/linux/hwmon*.h
> F: include/trace/events/hwmon*.h
> K: (devm_)?hwmon_device_(un)?register(|_with_groups|_with_info)
>
> +HARDWARE PREFETCH CONTROL DRIVERS
> +M: Kohei Tarumizu <[email protected]>
> +S: Maintained
> +F: drivers/base/pfctl.c
> +F: include/linux/pfctl.h
> +
> HARDWARE RANDOM NUMBER GENERATOR CORE
> M: Matt Mackall <[email protected]>
> M: Herbert Xu <[email protected]>
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index 6f04b831a5c0..8f8a69e7f645 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -230,4 +230,13 @@ config GENERIC_ARCH_NUMA
> Enable support for generic NUMA implementation. Currently, RISC-V
> and ARM64 use it.
>
> +config HWPF_CONTROL

Shouldn't this have "GENERIC" in the name liks the other generic
implementations in this directory?


> + bool "Hardware Prefetch Control driver"
> + help
> + This driver allows user to control CPU's Hardware Prefetch behavior.
> + If the machine supports this behavior, it provides a sysfs interface.

But this is not a driver, it's a core function that a driver uses. On
its own, this code does nothing.

thanks,

greg k-h

2022-05-23 07:03:16

by [email protected]

[permalink] [raw]
Subject: RE: [PATCH v4 2/8] drivers: base: Add Kconfig/Makefile to build hardware prefetch control core driver

> Shouldn't this have "GENERIC" in the name liks the other generic implementations
> in this directory?

> But this is not a driver, it's a core function that a driver uses. On its own, this
> code does nothing.

I consider removing the core driver in the next version. If I keep the
core driver, fix the name and description.