linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add debugfs pm_status for qat driver
@ 2023-08-17 14:33 Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header Lucas Segarra Fernandez
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Lucas Segarra Fernandez @ 2023-08-17 14:33 UTC (permalink / raw)
  To: herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, alx.manpages,
	Lucas Segarra Fernandez

Add debugfs pm_status.

Expose power management info by providing the "pm_status" file under
debugfs.

Patch #1 has been added to this pathcset in order to add
ARRAY_SIZE_OF_FIELD() (Patch #2) without expanding kernel.h

---

Alejandro Colomar (1):
  linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header

Lucas Segarra Fernandez (3):
  linux/array_size.h: Add ARRAY_SIZE_OF_FIELD()
  crypto: qat - refactor included headers
  crypto: qat - add pm_status debugfs file

 Documentation/ABI/testing/debugfs-driver-qat  |   9 +
 drivers/crypto/intel/qat/qat_common/Makefile  |   1 +
 .../intel/qat/qat_common/adf_accel_devices.h  |  13 +
 .../crypto/intel/qat/qat_common/adf_admin.c   |  25 ++
 .../intel/qat/qat_common/adf_common_drv.h     |   1 +
 .../crypto/intel/qat/qat_common/adf_dbgfs.c   |   3 +
 .../crypto/intel/qat/qat_common/adf_gen4_pm.c | 265 ++++++++++++++++++
 .../crypto/intel/qat/qat_common/adf_gen4_pm.h |  38 ++-
 .../intel/qat/qat_common/adf_pm_dbgfs.c       |  47 ++++
 .../intel/qat/qat_common/adf_pm_dbgfs.h       |  12 +
 .../qat/qat_common/icp_qat_fw_init_admin.h    |  33 +++
 include/linux/array_size.h                    |  21 ++
 include/linux/clk-provider.h                  |   1 +
 include/linux/counter.h                       |   1 +
 include/linux/genl_magic_func.h               |   1 +
 include/linux/hashtable.h                     |   1 +
 include/linux/kernel.h                        |   7 +-
 include/linux/kfifo.h                         |   1 +
 include/linux/kvm_host.h                      |   1 +
 include/linux/moduleparam.h                   |   2 +
 include/linux/mtd/rawnand.h                   |   1 +
 include/linux/netfilter.h                     |   1 +
 include/linux/pagemap.h                       |   1 +
 include/linux/phy.h                           |   1 +
 include/linux/pinctrl/machine.h               |   2 +-
 include/linux/property.h                      |   1 +
 include/linux/rcupdate_wait.h                 |   1 +
 include/linux/regmap.h                        |   1 +
 include/linux/skmsg.h                         |   1 +
 include/linux/string.h                        |   1 +
 include/linux/surface_aggregator/controller.h |   1 +
 31 files changed, 487 insertions(+), 8 deletions(-)
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.c
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.h
 create mode 100644 include/linux/array_size.h

-- 
2.41.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header
  2023-08-17 14:33 [PATCH 0/4] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
@ 2023-08-17 14:33 ` Lucas Segarra Fernandez
  2023-08-17 20:24   ` Alejandro Colomar
  2023-08-17 14:33 ` [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD() Lucas Segarra Fernandez
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Lucas Segarra Fernandez @ 2023-08-17 14:33 UTC (permalink / raw)
  To: herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, alx.manpages,
	Giovanni Cabiddu, Andy Shevchenko

From: Alejandro Colomar <alx.manpages@gmail.com>

Touching files so used for the kernel,
forces 'make' to recompile most of the kernel.

Having those definitions in more granular files
helps avoid recompiling so much of the kernel.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 include/linux/array_size.h                    | 13 +++++++++++++
 include/linux/clk-provider.h                  |  1 +
 include/linux/counter.h                       |  1 +
 include/linux/genl_magic_func.h               |  1 +
 include/linux/hashtable.h                     |  1 +
 include/linux/kernel.h                        |  7 +------
 include/linux/kfifo.h                         |  1 +
 include/linux/kvm_host.h                      |  1 +
 include/linux/moduleparam.h                   |  2 ++
 include/linux/mtd/rawnand.h                   |  1 +
 include/linux/netfilter.h                     |  1 +
 include/linux/pagemap.h                       |  1 +
 include/linux/phy.h                           |  1 +
 include/linux/pinctrl/machine.h               |  2 +-
 include/linux/property.h                      |  1 +
 include/linux/rcupdate_wait.h                 |  1 +
 include/linux/regmap.h                        |  1 +
 include/linux/skmsg.h                         |  1 +
 include/linux/string.h                        |  1 +
 include/linux/surface_aggregator/controller.h |  1 +
 20 files changed, 33 insertions(+), 7 deletions(-)
 create mode 100644 include/linux/array_size.h

diff --git a/include/linux/array_size.h b/include/linux/array_size.h
new file mode 100644
index 000000000000..06d7d83196ca
--- /dev/null
+++ b/include/linux/array_size.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_ARRAY_SIZE_H
+#define _LINUX_ARRAY_SIZE_H
+
+#include <linux/compiler.h>
+
+/**
+ * ARRAY_SIZE - get the number of elements in array @arr
+ * @arr: array to be sized
+ */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+
+#endif  /* _LINUX_ARRAY_SIZE_H */
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 0f0cd01906b4..4f4d4f4af0a6 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -6,6 +6,7 @@
 #ifndef __LINUX_CLK_PROVIDER_H
 #define __LINUX_CLK_PROVIDER_H
 
+#include <linux/array_size.h>
 #include <linux/of.h>
 #include <linux/of_clk.h>
 
diff --git a/include/linux/counter.h b/include/linux/counter.h
index b63746637de2..baf4ffcd8d18 100644
--- a/include/linux/counter.h
+++ b/include/linux/counter.h
@@ -6,6 +6,7 @@
 #ifndef _COUNTER_H_
 #define _COUNTER_H_
 
+#include <linux/array_size.h>
 #include <linux/cdev.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
index 2984b0cb24b1..cec9cae51f0b 100644
--- a/include/linux/genl_magic_func.h
+++ b/include/linux/genl_magic_func.h
@@ -2,6 +2,7 @@
 #ifndef GENL_MAGIC_FUNC_H
 #define GENL_MAGIC_FUNC_H
 
+#include <linux/array_size.h>
 #include <linux/build_bug.h>
 #include <linux/genl_magic_struct.h>
 
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h
index f6c666730b8c..09c5f1522b06 100644
--- a/include/linux/hashtable.h
+++ b/include/linux/hashtable.h
@@ -7,6 +7,7 @@
 #ifndef _LINUX_HASHTABLE_H
 #define _LINUX_HASHTABLE_H
 
+#include <linux/array_size.h>
 #include <linux/list.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0d91e0af0125..7195c6f27a22 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -11,6 +11,7 @@
 #ifndef _LINUX_KERNEL_H
 #define _LINUX_KERNEL_H
 
+#include <linux/array_size.h>
 #include <linux/stdarg.h>
 #include <linux/align.h>
 #include <linux/limits.h>
@@ -49,12 +50,6 @@
 #define READ			0
 #define WRITE			1
 
-/**
- * ARRAY_SIZE - get the number of elements in array @arr
- * @arr: array to be sized
- */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
-
 #define PTR_IF(cond, ptr)	((cond) ? (ptr) : NULL)
 
 #define u64_to_user_ptr(x) (		\
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 0b35a41440ff..b6fdd92ccb56 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -36,6 +36,7 @@
  * to lock the reader.
  */
 
+#include <linux/array_size.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/stddef.h>
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 9d3ac7720da9..a629b398a592 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -3,6 +3,7 @@
 #define __KVM_HOST_H
 
 
+#include <linux/array_size.h>
 #include <linux/types.h>
 #include <linux/hardirq.h>
 #include <linux/list.h>
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 962cd41a2cb5..3cecef5fa1cf 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -2,6 +2,8 @@
 #ifndef _LINUX_MODULE_PARAMS_H
 #define _LINUX_MODULE_PARAMS_H
 /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */
+
+#include <linux/array_size.h>
 #include <linux/init.h>
 #include <linux/stringify.h>
 #include <linux/kernel.h>
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 5159d692f9ce..cd27ef633a4f 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -13,6 +13,7 @@
 #ifndef __LINUX_MTD_RAWNAND_H
 #define __LINUX_MTD_RAWNAND_H
 
+#include <linux/array_size.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/flashchip.h>
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index d4fed4c508ca..f9ca506c4261 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -2,6 +2,7 @@
 #ifndef __LINUX_NETFILTER_H
 #define __LINUX_NETFILTER_H
 
+#include <linux/array_size.h>
 #include <linux/init.h>
 #include <linux/skbuff.h>
 #include <linux/net.h>
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 716953ee1ebd..7a3de980ed9d 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -5,6 +5,7 @@
 /*
  * Copyright 1995 Linus Torvalds
  */
+#include <linux/array_size.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/list.h>
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 11c1e91563d4..39e88b570ead 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -11,6 +11,7 @@
 #ifndef __PHY_H
 #define __PHY_H
 
+#include <linux/array_size.h>
 #include <linux/compiler.h>
 #include <linux/spinlock.h>
 #include <linux/ethtool.h>
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
index 0639b36f43c5..ee8803f6ad07 100644
--- a/include/linux/pinctrl/machine.h
+++ b/include/linux/pinctrl/machine.h
@@ -11,7 +11,7 @@
 #ifndef __LINUX_PINCTRL_MACHINE_H
 #define __LINUX_PINCTRL_MACHINE_H
 
-#include <linux/kernel.h>	/* ARRAY_SIZE() */
+#include <linux/array_size.h>
 
 #include <linux/pinctrl/pinctrl-state.h>
 
diff --git a/include/linux/property.h b/include/linux/property.h
index 8c3c6685a2ae..f7889c7c3a66 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -10,6 +10,7 @@
 #ifndef _LINUX_PROPERTY_H_
 #define _LINUX_PROPERTY_H_
 
+#include <linux/array_size.h>
 #include <linux/bits.h>
 #include <linux/fwnode.h>
 #include <linux/stddef.h>
diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h
index 699b938358bf..a321404eeec0 100644
--- a/include/linux/rcupdate_wait.h
+++ b/include/linux/rcupdate_wait.h
@@ -6,6 +6,7 @@
  * RCU synchronization types and methods:
  */
 
+#include <linux/array_size.h>
 #include <linux/rcupdate.h>
 #include <linux/completion.h>
 
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 8fc0b3ebce44..af0430dc0945 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -10,6 +10,7 @@
  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  */
 
+#include <linux/array_size.h>
 #include <linux/list.h>
 #include <linux/rbtree.h>
 #include <linux/ktime.h>
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index 054d7911bfc9..d7e3b9f46d58 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -4,6 +4,7 @@
 #ifndef _LINUX_SKMSG_H
 #define _LINUX_SKMSG_H
 
+#include <linux/array_size.h>
 #include <linux/bpf.h>
 #include <linux/filter.h>
 #include <linux/scatterlist.h>
diff --git a/include/linux/string.h b/include/linux/string.h
index dbfc66400050..3c920b6d609b 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -2,6 +2,7 @@
 #ifndef _LINUX_STRING_H_
 #define _LINUX_STRING_H_
 
+#include <linux/array_size.h>
 #include <linux/compiler.h>	/* for inline */
 #include <linux/types.h>	/* for size_t */
 #include <linux/stddef.h>	/* for NULL */
diff --git a/include/linux/surface_aggregator/controller.h b/include/linux/surface_aggregator/controller.h
index cb7980805920..dcce0b663a3a 100644
--- a/include/linux/surface_aggregator/controller.h
+++ b/include/linux/surface_aggregator/controller.h
@@ -12,6 +12,7 @@
 #ifndef _LINUX_SURFACE_AGGREGATOR_CONTROLLER_H
 #define _LINUX_SURFACE_AGGREGATOR_CONTROLLER_H
 
+#include <linux/array_size.h>
 #include <linux/completion.h>
 #include <linux/device.h>
 #include <linux/types.h>
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD()
  2023-08-17 14:33 [PATCH 0/4] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header Lucas Segarra Fernandez
@ 2023-08-17 14:33 ` Lucas Segarra Fernandez
  2023-08-17 20:34   ` Alejandro Colomar
  2023-08-17 14:33 ` [PATCH 3/4] crypto: qat - refactor included headers Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 4/4] crypto: qat - add pm_status debugfs file Lucas Segarra Fernandez
  3 siblings, 1 reply; 15+ messages in thread
From: Lucas Segarra Fernandez @ 2023-08-17 14:33 UTC (permalink / raw)
  To: herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, alx.manpages,
	Lucas Segarra Fernandez, Giovanni Cabiddu, Andy Shevchenko

Introduce ARRAY_SIZE_OF_FIELD() in order to get the number of elements
of an array struct field.

Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 include/linux/array_size.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/array_size.h b/include/linux/array_size.h
index 06d7d83196ca..37dac0473b5c 100644
--- a/include/linux/array_size.h
+++ b/include/linux/array_size.h
@@ -10,4 +10,12 @@
  */
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
 
+/*
+ * ARRAY_SIZE_OF_FIELD - get the number of elements of an array struct field
+ *
+ * @TYPE: The structure containing the field of interest
+ * @MEMBER: The array field to be sized
+ */
+#define ARRAY_SIZE_OF_FIELD(TYPE, MEMBER) ARRAY_SIZE((((TYPE *)0)->MEMBER))
+
 #endif  /* _LINUX_ARRAY_SIZE_H */
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4] crypto: qat - refactor included headers
  2023-08-17 14:33 [PATCH 0/4] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD() Lucas Segarra Fernandez
@ 2023-08-17 14:33 ` Lucas Segarra Fernandez
  2023-08-17 14:33 ` [PATCH 4/4] crypto: qat - add pm_status debugfs file Lucas Segarra Fernandez
  3 siblings, 0 replies; 15+ messages in thread
From: Lucas Segarra Fernandez @ 2023-08-17 14:33 UTC (permalink / raw)
  To: herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, alx.manpages,
	Lucas Segarra Fernandez, Giovanni Cabiddu, Andy Shevchenko

Include missing headeers for GENMASK(), kstrtobool and types.

Add forward declaration for struct adf_accel_dev. Remove unneeded
include.

This change doesn't introduce any function change.

Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c | 3 +++
 drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
index 34c6cd8e27c0..3bde8759c2a2 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
@@ -2,6 +2,9 @@
 /* Copyright(c) 2022 Intel Corporation */
 #include <linux/bitfield.h>
 #include <linux/iopoll.h>
+#include <linux/kstrtox.h>
+#include <linux/types.h>
+
 #include "adf_accel_devices.h"
 #include "adf_common_drv.h"
 #include "adf_gen4_pm.h"
diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
index c2768762cca3..39d37b352b45 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
+++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
@@ -3,7 +3,9 @@
 #ifndef ADF_GEN4_PM_H
 #define ADF_GEN4_PM_H
 
-#include "adf_accel_devices.h"
+#include <linux/bits.h>
+
+struct adf_accel_dev;
 
 /* Power management registers */
 #define ADF_GEN4_PM_HOST_MSG (0x50A01C)
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4] crypto: qat - add pm_status debugfs file
  2023-08-17 14:33 [PATCH 0/4] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
                   ` (2 preceding siblings ...)
  2023-08-17 14:33 ` [PATCH 3/4] crypto: qat - refactor included headers Lucas Segarra Fernandez
@ 2023-08-17 14:33 ` Lucas Segarra Fernandez
  2023-08-18  5:28   ` Herbert Xu
  3 siblings, 1 reply; 15+ messages in thread
From: Lucas Segarra Fernandez @ 2023-08-17 14:33 UTC (permalink / raw)
  To: herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, alx.manpages,
	Lucas Segarra Fernandez, Giovanni Cabiddu, Andy Shevchenko

QAT devices implement a mechanism that allows them to go autonomously
to a low power state depending on the load.

Expose power management info by providing the "pm_status" file under
debugfs. This includes PM state, PM event log, PM event counters, PM HW
CSRs, per-resource type constrain counters and per-domain power gating
status specific to the QAT device.

This information is retrieved from (1) the FW by means of
ICP_QAT_FW_PM_INFO command, (2) CSRs and (3) counters collected by the
device driver.

In addition, add logic to keep track and report power management event
interrupts and acks/nacks sent to FW to allow/prevent state transitions.

Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 Documentation/ABI/testing/debugfs-driver-qat  |   9 +
 drivers/crypto/intel/qat/qat_common/Makefile  |   1 +
 .../intel/qat/qat_common/adf_accel_devices.h  |  13 +
 .../crypto/intel/qat/qat_common/adf_admin.c   |  25 ++
 .../intel/qat/qat_common/adf_common_drv.h     |   1 +
 .../crypto/intel/qat/qat_common/adf_dbgfs.c   |   3 +
 .../crypto/intel/qat/qat_common/adf_gen4_pm.c | 262 ++++++++++++++++++
 .../crypto/intel/qat/qat_common/adf_gen4_pm.h |  34 +++
 .../intel/qat/qat_common/adf_pm_dbgfs.c       |  47 ++++
 .../intel/qat/qat_common/adf_pm_dbgfs.h       |  12 +
 .../qat/qat_common/icp_qat_fw_init_admin.h    |  33 +++
 11 files changed, 440 insertions(+)
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.c
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.h

diff --git a/Documentation/ABI/testing/debugfs-driver-qat b/Documentation/ABI/testing/debugfs-driver-qat
index 6731ffacc5f0..1a21eea414b5 100644
--- a/Documentation/ABI/testing/debugfs-driver-qat
+++ b/Documentation/ABI/testing/debugfs-driver-qat
@@ -59,3 +59,12 @@ Description:	(RO) Read returns the device health status.
 
 		The driver does not monitor for Heartbeat. It is left for a user
 		to poll the status periodically.
+
+What:		/sys/kernel/debug/qat_<device>_<BDF>/pm_status
+Date:		November 2023
+KernelVersion:	6.6
+Contact:	qat-linux@intel.com
+Description:	(RO) Read returns power management information specific to the
+		QAT device.
+
+		This attribute is only available for qat_4xxx devices.
diff --git a/drivers/crypto/intel/qat/qat_common/Makefile b/drivers/crypto/intel/qat/qat_common/Makefile
index 43622c7fca71..3b3a41d2b2a4 100644
--- a/drivers/crypto/intel/qat/qat_common/Makefile
+++ b/drivers/crypto/intel/qat/qat_common/Makefile
@@ -33,6 +33,7 @@ intel_qat-$(CONFIG_DEBUG_FS) += adf_transport_debug.o \
 				adf_fw_counters.o \
 				adf_heartbeat.o \
 				adf_heartbeat_dbgfs.o \
+				adf_pm_dbgfs.o \
 				adf_dbgfs.o
 
 intel_qat-$(CONFIG_PCI_IOV) += adf_sriov.o adf_vf_isr.o adf_pfvf_utils.o \
diff --git a/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h b/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h
index e57abde66f4f..fd5107e92853 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h
+++ b/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h
@@ -291,6 +291,18 @@ struct adf_dc_data {
 	dma_addr_t ovf_buff_p;
 };
 
+struct adf_pm {
+	struct dentry *debugfs_pm_status;
+	bool present;
+	int idle_irq_counters;
+	int throttle_irq_counters;
+	int fw_irq_counters;
+	int host_ack_counter;
+	int host_nack_counter;
+	ssize_t (*print_pm_status)(struct adf_accel_dev *accel_dev, char __user *buf, size_t count,
+				   loff_t *pos);
+};
+
 struct adf_accel_dev {
 	struct adf_etr_data *transport;
 	struct adf_hw_device_data *hw_device;
@@ -298,6 +310,7 @@ struct adf_accel_dev {
 	struct adf_fw_loader_data *fw_loader;
 	struct adf_admin_comms *admin;
 	struct adf_dc_data *dc_data;
+	struct adf_pm power_management;
 	struct list_head crypto_list;
 	struct list_head compression_list;
 	unsigned long status;
diff --git a/drivers/crypto/intel/qat/qat_common/adf_admin.c b/drivers/crypto/intel/qat/qat_common/adf_admin.c
index ff790823b868..a718713d4f1e 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_admin.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_admin.c
@@ -348,6 +348,31 @@ int adf_init_admin_pm(struct adf_accel_dev *accel_dev, u32 idle_delay)
 	return adf_send_admin(accel_dev, &req, &resp, ae_mask);
 }
 
+int adf_get_pm_info(struct adf_accel_dev *accel_dev, dma_addr_t p_state_addr, size_t buff_size)
+{
+	struct adf_hw_device_data *hw_data = accel_dev->hw_device;
+	struct icp_qat_fw_init_admin_req req = { };
+	struct icp_qat_fw_init_admin_resp resp;
+	u32 ae_mask = hw_data->admin_ae_mask;
+	int ret;
+
+	/* Query pm info via init/admin cmd */
+	if (!accel_dev->admin) {
+		dev_err(&GET_DEV(accel_dev), "adf_admin is not available\n");
+		return -EFAULT;
+	}
+
+	req.cmd_id = ICP_QAT_FW_PM_INFO;
+	req.init_cfg_sz = buff_size;
+	req.init_cfg_ptr = p_state_addr;
+
+	ret = adf_send_admin(accel_dev, &req, &resp, ae_mask);
+	if (ret)
+		dev_err(&GET_DEV(accel_dev), "Failed to query power-management info\n");
+
+	return ret;
+}
+
 int adf_init_admin_comms(struct adf_accel_dev *accel_dev)
 {
 	struct adf_admin_comms *admin;
diff --git a/drivers/crypto/intel/qat/qat_common/adf_common_drv.h b/drivers/crypto/intel/qat/qat_common/adf_common_drv.h
index 673b5044c62a..4f991c7a7b26 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_common_drv.h
+++ b/drivers/crypto/intel/qat/qat_common/adf_common_drv.h
@@ -93,6 +93,7 @@ int adf_init_admin_pm(struct adf_accel_dev *accel_dev, u32 idle_delay);
 int adf_send_admin_tim_sync(struct adf_accel_dev *accel_dev, u32 cnt);
 int adf_send_admin_hb_timer(struct adf_accel_dev *accel_dev, uint32_t ticks);
 int adf_get_fw_timestamp(struct adf_accel_dev *accel_dev, u64 *timestamp);
+int adf_get_pm_info(struct adf_accel_dev *accel_dev, dma_addr_t p_state_addr, size_t buff_size);
 int adf_init_arb(struct adf_accel_dev *accel_dev);
 void adf_exit_arb(struct adf_accel_dev *accel_dev);
 void adf_update_ring_arb(struct adf_etr_ring_data *ring);
diff --git a/drivers/crypto/intel/qat/qat_common/adf_dbgfs.c b/drivers/crypto/intel/qat/qat_common/adf_dbgfs.c
index 04845f8d72be..395bb493f20c 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_dbgfs.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_dbgfs.c
@@ -8,6 +8,7 @@
 #include "adf_dbgfs.h"
 #include "adf_fw_counters.h"
 #include "adf_heartbeat_dbgfs.h"
+#include "adf_pm_dbgfs.h"
 
 /**
  * adf_dbgfs_init() - add persistent debugfs entries
@@ -62,6 +63,7 @@ void adf_dbgfs_add(struct adf_accel_dev *accel_dev)
 	if (!accel_dev->is_vf) {
 		adf_fw_counters_dbgfs_add(accel_dev);
 		adf_heartbeat_dbgfs_add(accel_dev);
+		adf_pm_dbgfs_add(accel_dev);
 	}
 }
 
@@ -75,6 +77,7 @@ void adf_dbgfs_rm(struct adf_accel_dev *accel_dev)
 		return;
 
 	if (!accel_dev->is_vf) {
+		adf_pm_dbgfs_rm(accel_dev);
 		adf_heartbeat_dbgfs_rm(accel_dev);
 		adf_fw_counters_dbgfs_rm(accel_dev);
 	}
diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
index 3bde8759c2a2..82d64be1ec57 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c
@@ -1,8 +1,16 @@
 // SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
 /* Copyright(c) 2022 Intel Corporation */
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/dma-mapping.h>
+#include <linux/fs.h>
 #include <linux/iopoll.h>
 #include <linux/kstrtox.h>
+#include <linux/slab.h>
+#include <linux/stddef.h>
+#include <linux/string_helpers.h>
+#include <linux/stringify.h>
 #include <linux/types.h>
 
 #include "adf_accel_devices.h"
@@ -28,6 +36,7 @@ static int send_host_msg(struct adf_accel_dev *accel_dev)
 {
 	char pm_idle_support_cfg[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {};
 	void __iomem *pmisc = adf_get_pmisc_base(accel_dev);
+	struct adf_pm *pm = &accel_dev->power_management;
 	bool pm_idle_support;
 	u32 msg;
 	int ret;
@@ -42,6 +51,11 @@ static int send_host_msg(struct adf_accel_dev *accel_dev)
 	if (ret)
 		pm_idle_support = true;
 
+	if (pm_idle_support)
+		pm->host_ack_counter++;
+	else
+		pm->host_nack_counter++;
+
 	/* Send HOST_MSG */
 	msg = FIELD_PREP(ADF_GEN4_PM_MSG_PAYLOAD_BIT_MASK,
 			 pm_idle_support ? PM_SET_MIN : PM_NO_CHANGE);
@@ -62,17 +76,27 @@ static void pm_bh_handler(struct work_struct *work)
 		container_of(work, struct adf_gen4_pm_data, pm_irq_work);
 	struct adf_accel_dev *accel_dev = pm_data->accel_dev;
 	void __iomem *pmisc = adf_get_pmisc_base(accel_dev);
+	struct adf_pm *pm = &accel_dev->power_management;
 	u32 pm_int_sts = pm_data->pm_int_sts;
 	u32 val;
 
 	/* PM Idle interrupt */
 	if (pm_int_sts & ADF_GEN4_PM_IDLE_STS) {
+		pm->idle_irq_counters++;
 		/* Issue host message to FW */
 		if (send_host_msg(accel_dev))
 			dev_warn_ratelimited(&GET_DEV(accel_dev),
 					     "Failed to send host msg to FW\n");
 	}
 
+	/* PM throttle interrupt */
+	if (pm_int_sts & ADF_GEN4_PM_THR_STS)
+		pm->throttle_irq_counters++;
+
+	/* PM fw interrupt */
+	if (pm_int_sts & ADF_GEN4_PM_FW_INT_STS)
+		pm->fw_irq_counters++;
+
 	/* Clear interrupt status */
 	ADF_CSR_WR(pmisc, ADF_GEN4_PM_INTERRUPT, pm_int_sts);
 
@@ -132,6 +156,9 @@ int adf_gen4_enable_pm(struct adf_accel_dev *accel_dev)
 	if (ret)
 		return ret;
 
+	/* Initialize PM internal data */
+	adf_gen4_init_dev_pm_data(accel_dev);
+
 	/* Enable default PM interrupts: IDLE, THROTTLE */
 	val = ADF_CSR_RD(pmisc, ADF_GEN4_PM_INTERRUPT);
 	val |= ADF_GEN4_PM_INT_EN_DEFAULT;
@@ -148,3 +175,238 @@ int adf_gen4_enable_pm(struct adf_accel_dev *accel_dev)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(adf_gen4_enable_pm);
+
+#ifdef CONFIG_DEBUG_FS
+/*
+ * This is needed because a variable is used to index the mask at pm_scnprint_table(), making it not
+ * compile time constant, so the compile asserts from FIELD_GET() or u32_get_bits() won't be
+ * fulfilled.
+ */
+#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
+
+#define PM_INFO_MEMBER_OFF(member)	\
+	(offsetof(struct icp_qat_fw_init_admin_pm_info, member) / sizeof(u32))
+
+#define PM_INFO_REGSET_ENTRY_MASK(_reg_, _field_, _mask_)	\
+{								\
+	.reg_offset = PM_INFO_MEMBER_OFF(_reg_),		\
+	.key = __stringify(_field_),				\
+	.field_mask = _mask_,					\
+}
+
+#define PM_INFO_REGSET_ENTRY32(_reg_, _field_)	\
+	PM_INFO_REGSET_ENTRY_MASK(_reg_, _field_, GENMASK(31, 0))
+
+#define PM_INFO_REGSET_ENTRY(_reg_, _field_)	\
+	PM_INFO_REGSET_ENTRY_MASK(_reg_, _field_, ADF_GEN4_PM_##_field_##_MASK)
+
+#define PM_INFO_MAX_KEY_LEN	21
+
+struct pm_status_row {
+	int reg_offset;
+	u32 field_mask;
+	const char *key;
+};
+
+static struct pm_status_row pm_fuse_rows[] = {
+	PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_PM),
+	PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_PM_IDLE),
+	PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_DEEP_PM_IDLE),
+};
+
+static struct pm_status_row pm_info_rows[] = {
+	PM_INFO_REGSET_ENTRY(pm.status, CPM_PM_STATE),
+	PM_INFO_REGSET_ENTRY(pm.status, PENDING_WP),
+	PM_INFO_REGSET_ENTRY(pm.status, CURRENT_WP),
+	PM_INFO_REGSET_ENTRY(pm.fw_init, IDLE_ENABLE),
+	PM_INFO_REGSET_ENTRY(pm.fw_init, IDLE_FILTER),
+	PM_INFO_REGSET_ENTRY(pm.main, MIN_PWR_ACK),
+	PM_INFO_REGSET_ENTRY(pm.thread, MIN_PWR_ACK_PENDING),
+	PM_INFO_REGSET_ENTRY(pm.main, THR_VALUE),
+};
+
+static struct pm_status_row pm_ssm_rows[] = {
+	PM_INFO_REGSET_ENTRY(ssm.pm_enable, SSM_PM_ENABLE),
+	PM_INFO_REGSET_ENTRY32(ssm.active_constraint, ACTIVE_CONSTRAINT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_domain_status, DOMAIN_POWER_GATED),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, ATH_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, CPH_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, PKE_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, CPR_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, DCPR_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, UCS_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, XLT_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, WAT_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_active_status, WCP_ACTIVE_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, ATH_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, CPH_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, PKE_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, CPR_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, DCPR_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, UCS_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, XLT_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, WAT_MANAGED_COUNT),
+	PM_INFO_REGSET_ENTRY(ssm.pm_managed_status, WCP_MANAGED_COUNT),
+};
+
+static struct pm_status_row pm_log_rows[] = {
+	PM_INFO_REGSET_ENTRY32(event_counters.host_msg, HOST_MSG_EVENT_COUNT),
+	PM_INFO_REGSET_ENTRY32(event_counters.sys_pm, SYS_PM_EVENT_COUNT),
+	PM_INFO_REGSET_ENTRY32(event_counters.local_ssm, SSM_EVENT_COUNT),
+	PM_INFO_REGSET_ENTRY32(event_counters.timer, TIMER_EVENT_COUNT),
+	PM_INFO_REGSET_ENTRY32(event_counters.unknown, UNKNOWN_EVENT_COUNT),
+};
+
+static struct pm_status_row pm_event_rows[] = {
+	PM_INFO_REGSET_ENTRY32(event_log[0], EVENT0),
+	PM_INFO_REGSET_ENTRY32(event_log[1], EVENT1),
+	PM_INFO_REGSET_ENTRY32(event_log[2], EVENT2),
+	PM_INFO_REGSET_ENTRY32(event_log[3], EVENT3),
+	PM_INFO_REGSET_ENTRY32(event_log[4], EVENT4),
+	PM_INFO_REGSET_ENTRY32(event_log[5], EVENT5),
+	PM_INFO_REGSET_ENTRY32(event_log[6], EVENT6),
+	PM_INFO_REGSET_ENTRY32(event_log[7], EVENT7),
+};
+
+static_assert(ARRAY_SIZE_OF_FIELD(struct icp_qat_fw_init_admin_pm_info, event_log) ==
+	      ARRAY_SIZE(pm_event_rows));
+
+static struct pm_status_row pm_csrs_rows[] = {
+	PM_INFO_REGSET_ENTRY32(pm.fw_init, CPM_PM_FW_INIT),
+	PM_INFO_REGSET_ENTRY32(pm.status, CPM_PM_STATUS),
+	PM_INFO_REGSET_ENTRY32(pm.main, CPM_PM_MASTER_FW),
+	PM_INFO_REGSET_ENTRY32(pm.pwrreq, CPM_PM_PWRREQ),
+};
+
+static int pm_scnprint_table(char *buff, struct pm_status_row *table, u32 *pm_info_regs,
+			     size_t buff_size, int table_len, bool lowercase)
+{
+	char key[PM_INFO_MAX_KEY_LEN];
+	int wr = 0;
+	int i;
+
+	for (i = 0; i < table_len; i++) {
+		if (lowercase)
+			string_lower(key, table[i].key);
+		else
+			string_upper(key, table[i].key);
+
+		wr += scnprintf(&buff[wr], buff_size - wr, "%s: %#x\n", key,
+				field_get(table[i].field_mask, pm_info_regs[table[i].reg_offset]));
+	}
+
+	return wr;
+}
+
+static int pm_scnprint_table_upper_keys(char *buff, struct pm_status_row *table, u32 *pm_info_regs,
+					size_t buff_size, int table_len)
+{
+	return pm_scnprint_table(buff, table, pm_info_regs, buff_size, table_len, false);
+}
+
+static int pm_scnprint_table_lower_keys(char *buff, struct pm_status_row *table, u32 *pm_info_regs,
+					size_t buff_size, int table_len)
+{
+	return pm_scnprint_table(buff, table, pm_info_regs, buff_size, table_len, true);
+}
+
+static_assert(sizeof(struct icp_qat_fw_init_admin_pm_info) < PAGE_SIZE);
+
+static ssize_t adf_gen4_print_pm_status(struct adf_accel_dev *accel_dev, char __user *buf,
+					size_t count, loff_t *pos)
+{
+	void __iomem *pmisc = adf_get_pmisc_base(accel_dev);
+	struct adf_pm *pm = &accel_dev->power_management;
+	struct icp_qat_fw_init_admin_pm_info *pm_info;
+	dma_addr_t p_state_addr;
+	u32 *pm_info_regs;
+	char *pm_kv;
+	int len;
+	u32 val;
+	int ret;
+
+	pm_info = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	if (!pm_info)
+		return -ENOMEM;
+
+	pm_kv = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	if (!pm_kv) {
+		ret = -ENOMEM;
+		goto out_free;
+	}
+
+	p_state_addr = dma_map_single(&GET_DEV(accel_dev), pm_info, PAGE_SIZE, DMA_FROM_DEVICE);
+	ret = dma_mapping_error(&GET_DEV(accel_dev), p_state_addr);
+	if (ret)
+		goto out_free;
+
+	/* Query PM info from QAT FW */
+	ret = adf_get_pm_info(accel_dev, p_state_addr, PAGE_SIZE);
+	dma_unmap_single(&GET_DEV(accel_dev), p_state_addr, PAGE_SIZE, DMA_FROM_DEVICE);
+	if (ret)
+		goto out_free;
+
+	pm_info_regs = (u32 *)pm_info;
+
+	/* Fusectl related */
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "----------- PM Fuse info ---------\n");
+	len += pm_scnprint_table_lower_keys(&pm_kv[len], pm_fuse_rows, pm_info_regs,
+					    PAGE_SIZE - len, ARRAY_SIZE(pm_fuse_rows));
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "max_pwrreq: %#x\n", pm_info->max_pwrreq);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "min_pwrreq: %#x\n", pm_info->min_pwrreq);
+
+	/* PM related */
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "------------  PM Info ------------\n");
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "power_level: %s\n",
+			 pm_info->pwr_state == PM_SET_MIN ? "min" : "max");
+	len += pm_scnprint_table_lower_keys(&pm_kv[len], pm_info_rows, pm_info_regs,
+					    PAGE_SIZE - len, ARRAY_SIZE(pm_info_rows));
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "pm_mode: STATIC\n");
+
+	/* SSM related */
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "----------- SSM_PM Info ----------\n");
+	len += pm_scnprint_table_lower_keys(&pm_kv[len], pm_ssm_rows, pm_info_regs, PAGE_SIZE - len,
+					    ARRAY_SIZE(pm_ssm_rows));
+
+	/* Log related */
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "------------- PM Log -------------\n");
+	len += pm_scnprint_table_lower_keys(&pm_kv[len], pm_log_rows, pm_info_regs, PAGE_SIZE - len,
+					    ARRAY_SIZE(pm_log_rows));
+
+	len += pm_scnprint_table_lower_keys(&pm_kv[len], pm_event_rows, pm_info_regs,
+					    PAGE_SIZE - len, ARRAY_SIZE(pm_event_rows));
+
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "idle_irq_count: %#x\n",
+			 pm->idle_irq_counters);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "fw_irq_count: %#x\n",
+			 pm->fw_irq_counters);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "throttle_irq_count: %#x\n",
+			 pm->throttle_irq_counters);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "host_ack_count: %#x\n",
+			 pm->host_ack_counter);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "host_nack_count: %#x\n",
+			 pm->host_nack_counter);
+
+	/* CSRs content */
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "----------- HW PM CSRs -----------\n");
+	len += pm_scnprint_table_upper_keys(&pm_kv[len], pm_csrs_rows, pm_info_regs,
+					    PAGE_SIZE - len, ARRAY_SIZE(pm_csrs_rows));
+
+	val = ADF_CSR_RD(pmisc, ADF_GEN4_PM_HOST_MSG);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "CPM_PM_HOST_MSG: %#x\n", val);
+	val = ADF_CSR_RD(pmisc, ADF_GEN4_PM_INTERRUPT);
+	len += scnprintf(&pm_kv[len], PAGE_SIZE - len, "CPM_PM_INTERRUPT: %#x\n", val);
+	ret = simple_read_from_buffer(buf, count, pos, pm_kv, len);
+
+out_free:
+	kfree(pm_info);
+	kfree(pm_kv);
+	return ret;
+}
+#endif
+
+void adf_gen4_init_dev_pm_data(struct adf_accel_dev *accel_dev)
+{
+	accel_dev->power_management.print_pm_status = adf_gen4_print_pm_status;
+	accel_dev->power_management.present = true;
+}
diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
index 39d37b352b45..0d57b52cc9e6 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
+++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.h
@@ -41,7 +41,41 @@ struct adf_accel_dev;
 #define ADF_GEN4_PM_MAX_IDLE_FILTER		(0x7)
 #define ADF_GEN4_PM_DEFAULT_IDLE_SUPPORT	(0x1)
 
+/* PM CSRs fields masks */
+#define ADF_GEN4_PM_DOMAIN_POWER_GATED_MASK	GENMASK(15, 0)
+#define ADF_GEN4_PM_SSM_PM_ENABLE_MASK		GENMASK(15, 0)
+#define ADF_GEN4_PM_IDLE_FILTER_MASK		GENMASK(5, 3)
+#define ADF_GEN4_PM_IDLE_ENABLE_MASK		BIT(2)
+#define ADF_GEN4_PM_ENABLE_PM_MASK		BIT(21)
+#define ADF_GEN4_PM_ENABLE_PM_IDLE_MASK		BIT(22)
+#define ADF_GEN4_PM_ENABLE_DEEP_PM_IDLE_MASK	BIT(23)
+#define ADF_GEN4_PM_CURRENT_WP_MASK		GENMASK(19, 11)
+#define ADF_GEN4_PM_CPM_PM_STATE_MASK		GENMASK(22, 20)
+#define ADF_GEN4_PM_PENDING_WP_MASK		GENMASK(31, 23)
+#define ADF_GEN4_PM_THR_VALUE_MASK		GENMASK(6, 4)
+#define ADF_GEN4_PM_MIN_PWR_ACK_MASK		BIT(7)
+#define ADF_GEN4_PM_MIN_PWR_ACK_PENDING_MASK	BIT(17)
+#define ADF_GEN4_PM_CPR_ACTIVE_COUNT_MASK	BIT(0)
+#define ADF_GEN4_PM_CPR_MANAGED_COUNT_MASK	BIT(0)
+#define ADF_GEN4_PM_XLT_ACTIVE_COUNT_MASK	BIT(1)
+#define ADF_GEN4_PM_XLT_MANAGED_COUNT_MASK	BIT(1)
+#define ADF_GEN4_PM_DCPR_ACTIVE_COUNT_MASK	GENMASK(3, 2)
+#define ADF_GEN4_PM_DCPR_MANAGED_COUNT_MASK	GENMASK(3, 2)
+#define ADF_GEN4_PM_PKE_ACTIVE_COUNT_MASK	GENMASK(8, 4)
+#define ADF_GEN4_PM_PKE_MANAGED_COUNT_MASK	GENMASK(8, 4)
+#define ADF_GEN4_PM_WAT_ACTIVE_COUNT_MASK	GENMASK(13, 9)
+#define ADF_GEN4_PM_WAT_MANAGED_COUNT_MASK	GENMASK(13, 9)
+#define ADF_GEN4_PM_WCP_ACTIVE_COUNT_MASK	GENMASK(18, 14)
+#define ADF_GEN4_PM_WCP_MANAGED_COUNT_MASK	GENMASK(18, 14)
+#define ADF_GEN4_PM_UCS_ACTIVE_COUNT_MASK	GENMASK(20, 19)
+#define ADF_GEN4_PM_UCS_MANAGED_COUNT_MASK	GENMASK(20, 19)
+#define ADF_GEN4_PM_CPH_ACTIVE_COUNT_MASK	GENMASK(24, 21)
+#define ADF_GEN4_PM_CPH_MANAGED_COUNT_MASK	GENMASK(24, 21)
+#define ADF_GEN4_PM_ATH_ACTIVE_COUNT_MASK	GENMASK(28, 25)
+#define ADF_GEN4_PM_ATH_MANAGED_COUNT_MASK	GENMASK(28, 25)
+
 int adf_gen4_enable_pm(struct adf_accel_dev *accel_dev);
 bool adf_gen4_handle_pm_interrupt(struct adf_accel_dev *accel_dev);
+void adf_gen4_init_dev_pm_data(struct adf_accel_dev *accel_dev);
 
 #endif
diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.c b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.c
new file mode 100644
index 000000000000..7c1049481fd5
--- /dev/null
+++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.c
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright(c) 2023 Intel Corporation */
+#include <linux/debugfs.h>
+#include <linux/fs.h>
+#include <linux/types.h>
+
+#include "adf_accel_devices.h"
+#include "adf_common_drv.h"
+#include "adf_pm_dbgfs.h"
+
+static ssize_t pm_status_read(struct file *f, char __user *buf, size_t count, loff_t *pos)
+{
+	struct adf_accel_dev *accel_dev = file_inode(f)->i_private;
+	struct adf_pm pm = accel_dev->power_management;
+
+	if (pm.print_pm_status)
+		return pm.print_pm_status(accel_dev, buf, count, pos);
+
+	return count;
+}
+
+static const struct file_operations pm_status_fops = {
+	.owner = THIS_MODULE,
+	.read = pm_status_read,
+};
+
+void adf_pm_dbgfs_add(struct adf_accel_dev *accel_dev)
+{
+	struct adf_pm *pm = &accel_dev->power_management;
+
+	if (!pm->present)
+		return;
+
+	pm->debugfs_pm_status = debugfs_create_file("pm_status", 0400, accel_dev->debugfs_dir,
+						    accel_dev, &pm_status_fops);
+}
+
+void adf_pm_dbgfs_rm(struct adf_accel_dev *accel_dev)
+{
+	struct adf_pm *pm = &accel_dev->power_management;
+
+	if (!pm->present)
+		return;
+
+	debugfs_remove(pm->debugfs_pm_status);
+	pm->debugfs_pm_status = NULL;
+}
diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.h b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.h
new file mode 100644
index 000000000000..83632e5aa097
--- /dev/null
+++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* Copyright(c) 2023 Intel Corporation */
+
+#ifndef ADF_PM_DBGFS_H_
+#define ADF_PM_DBGFS_H_
+
+struct adf_accel_dev;
+
+void adf_pm_dbgfs_rm(struct adf_accel_dev *accel_dev);
+void adf_pm_dbgfs_add(struct adf_accel_dev *accel_dev);
+
+#endif /* ADF_PM_DBGFS_H_ */
diff --git a/drivers/crypto/intel/qat/qat_common/icp_qat_fw_init_admin.h b/drivers/crypto/intel/qat/qat_common/icp_qat_fw_init_admin.h
index 3e968a4bcc9c..e2e0c2a77930 100644
--- a/drivers/crypto/intel/qat/qat_common/icp_qat_fw_init_admin.h
+++ b/drivers/crypto/intel/qat/qat_common/icp_qat_fw_init_admin.h
@@ -19,6 +19,7 @@ enum icp_qat_fw_init_admin_cmd_id {
 	ICP_QAT_FW_HEARTBEAT_TIMER_SET = 13,
 	ICP_QAT_FW_TIMER_GET = 19,
 	ICP_QAT_FW_PM_STATE_CONFIG = 128,
+	ICP_QAT_FW_PM_INFO = 129,
 };
 
 enum icp_qat_fw_init_admin_resp_status {
@@ -107,4 +108,36 @@ struct icp_qat_fw_init_admin_resp {
 
 #define ICP_QAT_FW_SYNC ICP_QAT_FW_HEARTBEAT_SYNC
 
+struct icp_qat_fw_init_admin_pm_info {
+	__u16 max_pwrreq;
+	__u16 min_pwrreq;
+	__u16 resvrd1;
+	__u8 pwr_state;
+	__u8 resvrd2;
+	__u32 fusectl0;
+	struct_group(event_counters,
+		__u32 sys_pm;
+		__u32 host_msg;
+		__u32 unknown;
+		__u32 local_ssm;
+		__u32 timer;
+	);
+	__u32 event_log[8];
+	struct_group(pm,
+		__u32 fw_init;
+		__u32 pwrreq;
+		__u32 status;
+		__u32 main;
+		__u32 thread;
+	);
+	struct_group(ssm,
+		__u32 pm_enable;
+		__u32 pm_active_status;
+		__u32 pm_managed_status;
+		__u32 pm_domain_status;
+		__u32 active_constraint;
+	);
+	__u32 resvrd3[6];
+};
+
 #endif
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header
  2023-08-17 14:33 ` [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header Lucas Segarra Fernandez
@ 2023-08-17 20:24   ` Alejandro Colomar
  0 siblings, 0 replies; 15+ messages in thread
From: Alejandro Colomar @ 2023-08-17 20:24 UTC (permalink / raw)
  To: Lucas Segarra Fernandez, herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, Giovanni Cabiddu,
	Andy Shevchenko


[-- Attachment #1.1: Type: text/plain, Size: 10665 bytes --]

Hi Lucas,

On 2023-08-17 16:33, Lucas Segarra Fernandez wrote:
> From: Alejandro Colomar <alx.manpages@gmail.com>
> 
> Touching files so used for the kernel,
> forces 'make' to recompile most of the kernel.
> 
> Having those definitions in more granular files
> helps avoid recompiling so much of the kernel.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Heh!  This is really really old, isn't it?  :p

Would you mind updating my email to use the kernel.org address?

From: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>

Thanks for taking care of this patch!

Cheers,
Alex

> ---
>  include/linux/array_size.h                    | 13 +++++++++++++
>  include/linux/clk-provider.h                  |  1 +
>  include/linux/counter.h                       |  1 +
>  include/linux/genl_magic_func.h               |  1 +
>  include/linux/hashtable.h                     |  1 +
>  include/linux/kernel.h                        |  7 +------
>  include/linux/kfifo.h                         |  1 +
>  include/linux/kvm_host.h                      |  1 +
>  include/linux/moduleparam.h                   |  2 ++
>  include/linux/mtd/rawnand.h                   |  1 +
>  include/linux/netfilter.h                     |  1 +
>  include/linux/pagemap.h                       |  1 +
>  include/linux/phy.h                           |  1 +
>  include/linux/pinctrl/machine.h               |  2 +-
>  include/linux/property.h                      |  1 +
>  include/linux/rcupdate_wait.h                 |  1 +
>  include/linux/regmap.h                        |  1 +
>  include/linux/skmsg.h                         |  1 +
>  include/linux/string.h                        |  1 +
>  include/linux/surface_aggregator/controller.h |  1 +
>  20 files changed, 33 insertions(+), 7 deletions(-)
>  create mode 100644 include/linux/array_size.h
> 
> diff --git a/include/linux/array_size.h b/include/linux/array_size.h
> new file mode 100644
> index 000000000000..06d7d83196ca
> --- /dev/null
> +++ b/include/linux/array_size.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_ARRAY_SIZE_H
> +#define _LINUX_ARRAY_SIZE_H
> +
> +#include <linux/compiler.h>
> +
> +/**
> + * ARRAY_SIZE - get the number of elements in array @arr
> + * @arr: array to be sized
> + */
> +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> +
> +#endif  /* _LINUX_ARRAY_SIZE_H */
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 0f0cd01906b4..4f4d4f4af0a6 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -6,6 +6,7 @@
>  #ifndef __LINUX_CLK_PROVIDER_H
>  #define __LINUX_CLK_PROVIDER_H
>  
> +#include <linux/array_size.h>
>  #include <linux/of.h>
>  #include <linux/of_clk.h>
>  
> diff --git a/include/linux/counter.h b/include/linux/counter.h
> index b63746637de2..baf4ffcd8d18 100644
> --- a/include/linux/counter.h
> +++ b/include/linux/counter.h
> @@ -6,6 +6,7 @@
>  #ifndef _COUNTER_H_
>  #define _COUNTER_H_
>  
> +#include <linux/array_size.h>
>  #include <linux/cdev.h>
>  #include <linux/device.h>
>  #include <linux/kernel.h>
> diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
> index 2984b0cb24b1..cec9cae51f0b 100644
> --- a/include/linux/genl_magic_func.h
> +++ b/include/linux/genl_magic_func.h
> @@ -2,6 +2,7 @@
>  #ifndef GENL_MAGIC_FUNC_H
>  #define GENL_MAGIC_FUNC_H
>  
> +#include <linux/array_size.h>
>  #include <linux/build_bug.h>
>  #include <linux/genl_magic_struct.h>
>  
> diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h
> index f6c666730b8c..09c5f1522b06 100644
> --- a/include/linux/hashtable.h
> +++ b/include/linux/hashtable.h
> @@ -7,6 +7,7 @@
>  #ifndef _LINUX_HASHTABLE_H
>  #define _LINUX_HASHTABLE_H
>  
> +#include <linux/array_size.h>
>  #include <linux/list.h>
>  #include <linux/types.h>
>  #include <linux/kernel.h>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 0d91e0af0125..7195c6f27a22 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -11,6 +11,7 @@
>  #ifndef _LINUX_KERNEL_H
>  #define _LINUX_KERNEL_H
>  
> +#include <linux/array_size.h>
>  #include <linux/stdarg.h>
>  #include <linux/align.h>
>  #include <linux/limits.h>
> @@ -49,12 +50,6 @@
>  #define READ			0
>  #define WRITE			1
>  
> -/**
> - * ARRAY_SIZE - get the number of elements in array @arr
> - * @arr: array to be sized
> - */
> -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> -
>  #define PTR_IF(cond, ptr)	((cond) ? (ptr) : NULL)
>  
>  #define u64_to_user_ptr(x) (		\
> diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
> index 0b35a41440ff..b6fdd92ccb56 100644
> --- a/include/linux/kfifo.h
> +++ b/include/linux/kfifo.h
> @@ -36,6 +36,7 @@
>   * to lock the reader.
>   */
>  
> +#include <linux/array_size.h>
>  #include <linux/kernel.h>
>  #include <linux/spinlock.h>
>  #include <linux/stddef.h>
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 9d3ac7720da9..a629b398a592 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -3,6 +3,7 @@
>  #define __KVM_HOST_H
>  
>  
> +#include <linux/array_size.h>
>  #include <linux/types.h>
>  #include <linux/hardirq.h>
>  #include <linux/list.h>
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 962cd41a2cb5..3cecef5fa1cf 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -2,6 +2,8 @@
>  #ifndef _LINUX_MODULE_PARAMS_H
>  #define _LINUX_MODULE_PARAMS_H
>  /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */
> +
> +#include <linux/array_size.h>
>  #include <linux/init.h>
>  #include <linux/stringify.h>
>  #include <linux/kernel.h>
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index 5159d692f9ce..cd27ef633a4f 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -13,6 +13,7 @@
>  #ifndef __LINUX_MTD_RAWNAND_H
>  #define __LINUX_MTD_RAWNAND_H
>  
> +#include <linux/array_size.h>
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/mtd/flashchip.h>
> diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> index d4fed4c508ca..f9ca506c4261 100644
> --- a/include/linux/netfilter.h
> +++ b/include/linux/netfilter.h
> @@ -2,6 +2,7 @@
>  #ifndef __LINUX_NETFILTER_H
>  #define __LINUX_NETFILTER_H
>  
> +#include <linux/array_size.h>
>  #include <linux/init.h>
>  #include <linux/skbuff.h>
>  #include <linux/net.h>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 716953ee1ebd..7a3de980ed9d 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -5,6 +5,7 @@
>  /*
>   * Copyright 1995 Linus Torvalds
>   */
> +#include <linux/array_size.h>
>  #include <linux/mm.h>
>  #include <linux/fs.h>
>  #include <linux/list.h>
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 11c1e91563d4..39e88b570ead 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -11,6 +11,7 @@
>  #ifndef __PHY_H
>  #define __PHY_H
>  
> +#include <linux/array_size.h>
>  #include <linux/compiler.h>
>  #include <linux/spinlock.h>
>  #include <linux/ethtool.h>
> diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
> index 0639b36f43c5..ee8803f6ad07 100644
> --- a/include/linux/pinctrl/machine.h
> +++ b/include/linux/pinctrl/machine.h
> @@ -11,7 +11,7 @@
>  #ifndef __LINUX_PINCTRL_MACHINE_H
>  #define __LINUX_PINCTRL_MACHINE_H
>  
> -#include <linux/kernel.h>	/* ARRAY_SIZE() */
> +#include <linux/array_size.h>
>  
>  #include <linux/pinctrl/pinctrl-state.h>
>  
> diff --git a/include/linux/property.h b/include/linux/property.h
> index 8c3c6685a2ae..f7889c7c3a66 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -10,6 +10,7 @@
>  #ifndef _LINUX_PROPERTY_H_
>  #define _LINUX_PROPERTY_H_
>  
> +#include <linux/array_size.h>
>  #include <linux/bits.h>
>  #include <linux/fwnode.h>
>  #include <linux/stddef.h>
> diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h
> index 699b938358bf..a321404eeec0 100644
> --- a/include/linux/rcupdate_wait.h
> +++ b/include/linux/rcupdate_wait.h
> @@ -6,6 +6,7 @@
>   * RCU synchronization types and methods:
>   */
>  
> +#include <linux/array_size.h>
>  #include <linux/rcupdate.h>
>  #include <linux/completion.h>
>  
> diff --git a/include/linux/regmap.h b/include/linux/regmap.h
> index 8fc0b3ebce44..af0430dc0945 100644
> --- a/include/linux/regmap.h
> +++ b/include/linux/regmap.h
> @@ -10,6 +10,7 @@
>   * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
>   */
>  
> +#include <linux/array_size.h>
>  #include <linux/list.h>
>  #include <linux/rbtree.h>
>  #include <linux/ktime.h>
> diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
> index 054d7911bfc9..d7e3b9f46d58 100644
> --- a/include/linux/skmsg.h
> +++ b/include/linux/skmsg.h
> @@ -4,6 +4,7 @@
>  #ifndef _LINUX_SKMSG_H
>  #define _LINUX_SKMSG_H
>  
> +#include <linux/array_size.h>
>  #include <linux/bpf.h>
>  #include <linux/filter.h>
>  #include <linux/scatterlist.h>
> diff --git a/include/linux/string.h b/include/linux/string.h
> index dbfc66400050..3c920b6d609b 100644
> --- a/include/linux/string.h
> +++ b/include/linux/string.h
> @@ -2,6 +2,7 @@
>  #ifndef _LINUX_STRING_H_
>  #define _LINUX_STRING_H_
>  
> +#include <linux/array_size.h>
>  #include <linux/compiler.h>	/* for inline */
>  #include <linux/types.h>	/* for size_t */
>  #include <linux/stddef.h>	/* for NULL */
> diff --git a/include/linux/surface_aggregator/controller.h b/include/linux/surface_aggregator/controller.h
> index cb7980805920..dcce0b663a3a 100644
> --- a/include/linux/surface_aggregator/controller.h
> +++ b/include/linux/surface_aggregator/controller.h
> @@ -12,6 +12,7 @@
>  #ifndef _LINUX_SURFACE_AGGREGATOR_CONTROLLER_H
>  #define _LINUX_SURFACE_AGGREGATOR_CONTROLLER_H
>  
> +#include <linux/array_size.h>
>  #include <linux/completion.h>
>  #include <linux/device.h>
>  #include <linux/types.h>

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD()
  2023-08-17 14:33 ` [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD() Lucas Segarra Fernandez
@ 2023-08-17 20:34   ` Alejandro Colomar
  2023-08-17 21:30     ` Andy Shevchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2023-08-17 20:34 UTC (permalink / raw)
  To: Lucas Segarra Fernandez, herbert, linux-kernel
  Cc: linux-crypto, qat-linux, andriy.shevchenko, Giovanni Cabiddu,
	Andy Shevchenko


[-- Attachment #1.1: Type: text/plain, Size: 2170 bytes --]

Hi Lucas,

On 2023-08-17 16:33, Lucas Segarra Fernandez wrote:
> Introduce ARRAY_SIZE_OF_FIELD() in order to get the number of elements
> of an array struct field.
> 
> Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
>  include/linux/array_size.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/array_size.h b/include/linux/array_size.h
> index 06d7d83196ca..37dac0473b5c 100644
> --- a/include/linux/array_size.h
> +++ b/include/linux/array_size.h
> @@ -10,4 +10,12 @@
>   */
>  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
>  
> +/*
> + * ARRAY_SIZE_OF_FIELD - get the number of elements of an array struct field
> + *
> + * @TYPE: The structure containing the field of interest
> + * @MEMBER: The array field to be sized
> + */
> +#define ARRAY_SIZE_OF_FIELD(TYPE, MEMBER) ARRAY_SIZE((((TYPE *)0)->MEMBER))

Some comment about the name:

ARRAY_SIZE() is rather ambiguous, as there's array_size()[1], which means the
number of bytes needed to represent the array.  I suggest a name based on

-  _Lengthof()  It has been proposed to ISO C to get the number of elements
                of an array:
                <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2529.pdf>.

-  sizeof_field()  The kernel macro for the size of a struct member

So, how about lengthof_field()?


Cheers,
Alex


[1]:  The definition of array_size() is here:

$ grep -rnB10 define.array_size include/linux/overflow.h 
238-/**
239- * array_size() - Calculate size of 2-dimensional array.
240- * @a: dimension one
241- * @b: dimension two
242- *
243- * Calculates size of 2-dimensional array: @a * @b.
244- *
245- * Returns: number of bytes needed to represent the array or SIZE_MAX on
246- * overflow.
247- */
248:#define array_size(a, b)	size_mul(a, b)


> +
>  #endif  /* _LINUX_ARRAY_SIZE_H */

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD()
  2023-08-17 20:34   ` Alejandro Colomar
@ 2023-08-17 21:30     ` Andy Shevchenko
  2023-08-17 22:03       ` Alejandro Colomar
  0 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2023-08-17 21:30 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: Lucas Segarra Fernandez, herbert, linux-kernel, linux-crypto,
	qat-linux, andriy.shevchenko, Giovanni Cabiddu

On Thu, Aug 17, 2023 at 11:34 PM Alejandro Colomar <alx@kernel.org> wrote:
> On 2023-08-17 16:33, Lucas Segarra Fernandez wrote:

...

> Some comment about the name:
>
> ARRAY_SIZE() is rather ambiguous, as there's array_size()[1], which means the
> number of bytes needed to represent the array.  I suggest a name based on
>
> -  _Lengthof()  It has been proposed to ISO C to get the number of elements
>                 of an array:
>                 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2529.pdf>.
>
> -  sizeof_field()  The kernel macro for the size of a struct member
>
> So, how about lengthof_field()?

TBH I do not understand the motivation of making this kind of
confusion and inconsistency. Are you suggesting renaming ARRAY_SIZE()
to begin with? If so, it's definitely out of the scope of this series.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD()
  2023-08-17 21:30     ` Andy Shevchenko
@ 2023-08-17 22:03       ` Alejandro Colomar
  0 siblings, 0 replies; 15+ messages in thread
From: Alejandro Colomar @ 2023-08-17 22:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lucas Segarra Fernandez, herbert, linux-kernel, linux-crypto,
	qat-linux, andriy.shevchenko, Giovanni Cabiddu, Kees Cook,
	Gustavo A. R. Silva


[-- Attachment #1.1: Type: text/plain, Size: 2107 bytes --]

Hello Andy,

On 2023-08-17 23:30, Andy Shevchenko wrote:
> On Thu, Aug 17, 2023 at 11:34 PM Alejandro Colomar <alx@kernel.org> wrote:
>> On 2023-08-17 16:33, Lucas Segarra Fernandez wrote:
> 
> ...
> 
>> Some comment about the name:
>>
>> ARRAY_SIZE() is rather ambiguous, as there's array_size()[1], which means the
>> number of bytes needed to represent the array.  I suggest a name based on
>>
>> -  _Lengthof()  It has been proposed to ISO C to get the number of elements
>>                 of an array:
>>                 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2529.pdf>.
>>
>> -  sizeof_field()  The kernel macro for the size of a struct member
>>
>> So, how about lengthof_field()?
> 
> TBH I do not understand the motivation of making this kind of
> confusion and inconsistency.


> Are you suggesting renaming ARRAY_SIZE()
> to begin with?

No.  ARRAY_SIZE is a very old and known API.  It is array_size() that is
to be blamed, due to having a confusing name.

What I suggest is not reusing the root of the name of ARRAY_SIZE(), which
since the addition of array_size() may be less unambiguous (IMHO).

So, instead of ARRAY_SIZE_*(), which is derived from ARRAY_SIZE(), maybe
it would be more unambiguous to use the _Lengthof() name as a root, since
nobody has messed with it so far.

My suggestion is to keep ARRAY_SIZE() with its old name, but use
lengthof_field() for this struct variant of it.  It's also a shorter name,
which will make for shorter lines.

b19d57d0f3cc ("overflow.h: Add flex_array_size() helper")
	- (Mon Jun 8 20:22:33 2020 -0500)
610b15c50e86 ("overflow.h: Add allocation size calculation helpers")
	- (Mon May 7 16:47:02 2018 -0700)

Nevertheless, it was just a minor suggestion, and if array_size() was
seen as a good enough name, it wouldn't be as confusing as it seems to
me.  If you find them to be fine, go ahead.

Cheers,
Alex

> If so, it's definitely out of the scope of this series.
> 

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] crypto: qat - add pm_status debugfs file
  2023-08-17 14:33 ` [PATCH 4/4] crypto: qat - add pm_status debugfs file Lucas Segarra Fernandez
@ 2023-08-18  5:28   ` Herbert Xu
  2023-08-18  8:46     ` Andy Shevchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Herbert Xu @ 2023-08-18  5:28 UTC (permalink / raw)
  To: Lucas Segarra Fernandez
  Cc: linux-kernel, linux-crypto, qat-linux, andriy.shevchenko,
	alx.manpages, Giovanni Cabiddu, Andy Shevchenko

On Thu, Aug 17, 2023 at 04:33:17PM +0200, Lucas Segarra Fernandez wrote:
>
> +static struct pm_status_row pm_event_rows[] = {
> +	PM_INFO_REGSET_ENTRY32(event_log[0], EVENT0),
> +	PM_INFO_REGSET_ENTRY32(event_log[1], EVENT1),
> +	PM_INFO_REGSET_ENTRY32(event_log[2], EVENT2),
> +	PM_INFO_REGSET_ENTRY32(event_log[3], EVENT3),
> +	PM_INFO_REGSET_ENTRY32(event_log[4], EVENT4),
> +	PM_INFO_REGSET_ENTRY32(event_log[5], EVENT5),
> +	PM_INFO_REGSET_ENTRY32(event_log[6], EVENT6),
> +	PM_INFO_REGSET_ENTRY32(event_log[7], EVENT7),
> +};
> +
> +static_assert(ARRAY_SIZE_OF_FIELD(struct icp_qat_fw_init_admin_pm_info, event_log) ==
> +	      ARRAY_SIZE(pm_event_rows));

Was all of that churn just for this one line?

How about simply declaring a macro

	#define QAT_NUMBER_OF_PM_EVENTS 8

and then use it for the two arrays:

	static struct pm_status_row pm_event_rows[QAT_NUMBER_OF_PM_EVENTS] = {

	__u32 event_log[QAT_NUMBER_OF_PM_EVENTS];

What am I missing?

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] crypto: qat - add pm_status debugfs file
  2023-08-18  5:28   ` Herbert Xu
@ 2023-08-18  8:46     ` Andy Shevchenko
  2023-08-18  8:51       ` Herbert Xu
  2023-08-20 19:52       ` [PATCH] linux/container_of.h: Add memberof() Alejandro Colomar
  0 siblings, 2 replies; 15+ messages in thread
From: Andy Shevchenko @ 2023-08-18  8:46 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Lucas Segarra Fernandez, linux-kernel, linux-crypto, qat-linux,
	alx.manpages, Giovanni Cabiddu

On Fri, Aug 18, 2023 at 01:28:42PM +0800, Herbert Xu wrote:
> On Thu, Aug 17, 2023 at 04:33:17PM +0200, Lucas Segarra Fernandez wrote:
> >
> > +static struct pm_status_row pm_event_rows[] = {
> > +	PM_INFO_REGSET_ENTRY32(event_log[0], EVENT0),
> > +	PM_INFO_REGSET_ENTRY32(event_log[1], EVENT1),
> > +	PM_INFO_REGSET_ENTRY32(event_log[2], EVENT2),
> > +	PM_INFO_REGSET_ENTRY32(event_log[3], EVENT3),
> > +	PM_INFO_REGSET_ENTRY32(event_log[4], EVENT4),
> > +	PM_INFO_REGSET_ENTRY32(event_log[5], EVENT5),
> > +	PM_INFO_REGSET_ENTRY32(event_log[6], EVENT6),
> > +	PM_INFO_REGSET_ENTRY32(event_log[7], EVENT7),
> > +};
> > +
> > +static_assert(ARRAY_SIZE_OF_FIELD(struct icp_qat_fw_init_admin_pm_info, event_log) ==
> > +	      ARRAY_SIZE(pm_event_rows));
> 
> Was all of that churn just for this one line?
> 
> How about simply declaring a macro
> 
> 	#define QAT_NUMBER_OF_PM_EVENTS 8
> 
> and then use it for the two arrays:
> 
> 	static struct pm_status_row pm_event_rows[QAT_NUMBER_OF_PM_EVENTS] = {
> 
> 	__u32 event_log[QAT_NUMBER_OF_PM_EVENTS];
> 
> What am I missing?

Splitting ARRAY_SIZE() is very beneficial on its own.
The static assert is slightly more robust for the big code then defining
something that at some point can be missed or miscalculated. Yet we can
survive with a macro if you thinks it's better.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] crypto: qat - add pm_status debugfs file
  2023-08-18  8:46     ` Andy Shevchenko
@ 2023-08-18  8:51       ` Herbert Xu
  2023-08-20 19:52       ` [PATCH] linux/container_of.h: Add memberof() Alejandro Colomar
  1 sibling, 0 replies; 15+ messages in thread
From: Herbert Xu @ 2023-08-18  8:51 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lucas Segarra Fernandez, linux-kernel, linux-crypto, qat-linux,
	alx.manpages, Giovanni Cabiddu

On Fri, Aug 18, 2023 at 11:46:55AM +0300, Andy Shevchenko wrote:
>
> Splitting ARRAY_SIZE() is very beneficial on its own.
> The static assert is slightly more robust for the big code then defining
> something that at some point can be missed or miscalculated. Yet we can
> survive with a macro if you thinks it's better.

Yes please go ahead with just a macro.

If the ARRYA_SIZE thing turns out to be useful for other people I'm
sure it'll be added.  But I don't see much value in this particular
use.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] linux/container_of.h: Add memberof()
  2023-08-18  8:46     ` Andy Shevchenko
  2023-08-18  8:51       ` Herbert Xu
@ 2023-08-20 19:52       ` Alejandro Colomar
  2023-08-21 11:18         ` Andy Shevchenko
  1 sibling, 1 reply; 15+ messages in thread
From: Alejandro Colomar @ 2023-08-20 19:52 UTC (permalink / raw)
  To: qat-linux
  Cc: Alejandro Colomar, Alejandro Colomar, linux-kernel, linux-crypto,
	Andy Shevchenko, Herbert Xu, Lucas Segarra Fernandez,
	Giovanni Cabiddu

From: Alejandro Colomar <alx.manpages@gmail.com>

Hi!

On 2023-08-18 10:46, Andy Shevchenko wrote:
> On Fri, Aug 18, 2023 at 01:28:42PM +0800, Herbert Xu wrote:
>> On Thu, Aug 17, 2023 at 04:33:17PM +0200, Lucas Segarra Fernandez wrote:
>>>
>>> +static struct pm_status_row pm_event_rows[] = {
>>> +	PM_INFO_REGSET_ENTRY32(event_log[0], EVENT0),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[1], EVENT1),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[2], EVENT2),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[3], EVENT3),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[4], EVENT4),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[5], EVENT5),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[6], EVENT6),
>>> +	PM_INFO_REGSET_ENTRY32(event_log[7], EVENT7),
>>> +};
>>> +
>>> +static_assert(ARRAY_SIZE_OF_FIELD(struct icp_qat_fw_init_admin_pm_info, event_log) ==
>>> +	      ARRAY_SIZE(pm_event_rows));

How about the following?

static_assert(ARRAY_SIZE(pm_event_rows) ==
    ARRAY_SIZE(memberof(struct icp_qat_fw_init_admin_pm_info, event_log)));

It would only need one macro addition, without significant churn.  It's
even less typing.  Below is a scissor patch with the addition of
memberof().

I tried building the kernel, and didn't see any warnings form the patch
below.

Cheers,
Alex

>>
>> Was all of that churn just for this one line?
>>
>> How about simply declaring a macro
>>
>> 	#define QAT_NUMBER_OF_PM_EVENTS 8
>>
>> and then use it for the two arrays:
>>
>> 	static struct pm_status_row pm_event_rows[QAT_NUMBER_OF_PM_EVENTS] = {
>>
>> 	__u32 event_log[QAT_NUMBER_OF_PM_EVENTS];
>>
>> What am I missing?
> 
> Splitting ARRAY_SIZE() is very beneficial on its own.
> The static assert is slightly more robust for the big code then defining
> something that at some point can be missed or miscalculated. Yet we can
> survive with a macro if you thinks it's better.
> 

-----8<------------

Many xxxof_{member,field}() macros make use of the same construction to
refer to a member of a struct without needing a variable of the
structure type.

memberof(T, m) simplifies all of those, avoids possible mistakes in
repetition, adds a meaningful name to the construction, and improves
readability by avoiding too many parentheses together.

It uses a compound literal, which should optimized out by the compiler.
It's a bit simpler to read than the dereference of a casted null
pointer, due to having less parentheses in the implementation.

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 include/linux/container_of.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/container_of.h b/include/linux/container_of.h
index 713890c867be..5e762025c780 100644
--- a/include/linux/container_of.h
+++ b/include/linux/container_of.h
@@ -5,7 +5,9 @@
 #include <linux/build_bug.h>
 #include <linux/stddef.h>
 
-#define typeof_member(T, m)	typeof(((T*)0)->m)
+
+#define memberof(T, member)  ((T){}.member)
+#define typeof_member(T, m)  typeof(memberof(T, m))
 
 /**
  * container_of - cast a member of a structure out to the containing structure
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] linux/container_of.h: Add memberof()
  2023-08-20 19:52       ` [PATCH] linux/container_of.h: Add memberof() Alejandro Colomar
@ 2023-08-21 11:18         ` Andy Shevchenko
  2023-08-21 11:23           ` Alejandro Colomar
  0 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2023-08-21 11:18 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: qat-linux, Alejandro Colomar, linux-kernel, linux-crypto,
	Herbert Xu, Lucas Segarra Fernandez, Giovanni Cabiddu

On Sun, Aug 20, 2023 at 09:52:22PM +0200, Alejandro Colomar wrote:
> On 2023-08-18 10:46, Andy Shevchenko wrote:
> > On Fri, Aug 18, 2023 at 01:28:42PM +0800, Herbert Xu wrote:
> >> On Thu, Aug 17, 2023 at 04:33:17PM +0200, Lucas Segarra Fernandez wrote:

...

> Many xxxof_{member,field}() macros make use of the same construction to
> refer to a member of a struct without needing a variable of the
> structure type.
> 
> memberof(T, m) simplifies all of those, avoids possible mistakes in
> repetition, adds a meaningful name to the construction, and improves
> readability by avoiding too many parentheses together.
> 
> It uses a compound literal, which should optimized out by the compiler.
> It's a bit simpler to read than the dereference of a casted null
> pointer, due to having less parentheses in the implementation.
> 
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
> Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  include/linux/container_of.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/container_of.h b/include/linux/container_of.h
> index 713890c867be..5e762025c780 100644
> --- a/include/linux/container_of.h
> +++ b/include/linux/container_of.h
> @@ -5,7 +5,9 @@
>  #include <linux/build_bug.h>
>  #include <linux/stddef.h>
>  
> -#define typeof_member(T, m)	typeof(((T*)0)->m)
> +
> +#define memberof(T, member)  ((T){}.member)

I'm not sure. This seems to me utilization of compound literal, while above
uses direct struct member pointer calculations.

> +#define typeof_member(T, m)  typeof(memberof(T, m))

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] linux/container_of.h: Add memberof()
  2023-08-21 11:18         ` Andy Shevchenko
@ 2023-08-21 11:23           ` Alejandro Colomar
  0 siblings, 0 replies; 15+ messages in thread
From: Alejandro Colomar @ 2023-08-21 11:23 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: qat-linux, Alejandro Colomar, linux-kernel, linux-crypto,
	Herbert Xu, Lucas Segarra Fernandez, Giovanni Cabiddu

Hi Andy,

On 2023-08-21 13:18, Andy Shevchenko wrote:
> On Sun, Aug 20, 2023 at 09:52:22PM +0200, Alejandro Colomar wrote:
>>  
>> -#define typeof_member(T, m)	typeof(((T*)0)->m)
>> +
>> +#define memberof(T, member)  ((T){}.member)
> 
> I'm not sure. This seems to me utilization of compound literal, while above
> uses direct struct member pointer calculations.

Both can be used in most cases.  The only exception is offsetof(3), where
you need the pointer calculation.  The good thing about the compound
literal is that it's farther away from causing UB, but if that's not a
concern --using sizeof() or typeof() will usually make things safe from
UB, as there's really no dereference, but just to be a little paranoic--,
I could change the definition of memberof() to use the pointer thing.

Should I send a v2 with the pointer thing?

[I'll take some time, as I need to restore my USB with keys, which just
died yesterday.  I didn't sign this email due to that.]

Cheers,
Alex

> 
>> +#define typeof_member(T, m)  typeof(memberof(T, m))
> 

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-21 11:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17 14:33 [PATCH 0/4] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
2023-08-17 14:33 ` [PATCH 1/4] linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header Lucas Segarra Fernandez
2023-08-17 20:24   ` Alejandro Colomar
2023-08-17 14:33 ` [PATCH 2/4] linux/array_size.h: Add ARRAY_SIZE_OF_FIELD() Lucas Segarra Fernandez
2023-08-17 20:34   ` Alejandro Colomar
2023-08-17 21:30     ` Andy Shevchenko
2023-08-17 22:03       ` Alejandro Colomar
2023-08-17 14:33 ` [PATCH 3/4] crypto: qat - refactor included headers Lucas Segarra Fernandez
2023-08-17 14:33 ` [PATCH 4/4] crypto: qat - add pm_status debugfs file Lucas Segarra Fernandez
2023-08-18  5:28   ` Herbert Xu
2023-08-18  8:46     ` Andy Shevchenko
2023-08-18  8:51       ` Herbert Xu
2023-08-20 19:52       ` [PATCH] linux/container_of.h: Add memberof() Alejandro Colomar
2023-08-21 11:18         ` Andy Shevchenko
2023-08-21 11:23           ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).