Skip to contentSkip to conversation

platform/x86/intel/pmt: Add INTEL_PMT module namespace

PATCH In review David E. Box 3 participants 7 messages Mar 16, 2023 – Mar 20, 2023

Subsystems (2)
lore
Share & tools
lore

David E. Box

author maintainer
#0 lore raw

PATCH 1/2 platform/x86/intel/pmt: Add INTEL_PMT module namespace

Since the currently exported symbols in pmt_class are only used by other Intel PMT drivers, create an INTEL_PMT module namespace for them.

---
 drivers/platform/x86/intel/pmt/class.c     | 6 +++---
 drivers/platform/x86/intel/pmt/crashlog.c  | 1 +
 drivers/platform/x86/intel/pmt/telemetry.c | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmt/class.c +3 -3
index 46598dcb634a..0b96d75f5924 100644
@@ -33,7 +33,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev)
 	 */
 	return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_is_early_client_hw);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT);
 
 static inline int
 pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
@@ -327,7 +327,7 @@ int intel_pmt_dev_create(struct intel_pmt_entry *entry, struct intel_pmt_namespa
 	return intel_pmt_dev_register(entry, ns, dev);
 
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_create);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_create, INTEL_PMT);
 
 void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
 			   struct intel_pmt_namespace *ns)
@@ -343,7 +343,7 @@ void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
 	device_unregister(dev);
 	xa_erase(ns->xa, entry->devid);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_destroy);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_destroy, INTEL_PMT);
 
 static int __init pmt_class_init(void)
 {
drivers/platform/x86/intel/pmt/crashlog.c +1 -0
index ace1239bc0a0..bbb3d61d09f4 100644
@@ -328,3 +328,4 @@ module_exit(pmt_crashlog_exit);
 MODULE_AUTHOR("Alexander Duyck <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Crashlog driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);
drivers/platform/x86/intel/pmt/telemetry.c +1 -0
index 5e4009c05ecf..71cdef42084a 100644
@@ -160,3 +160,4 @@ module_exit(pmt_telem_exit);
 MODULE_AUTHOR("David E. Box <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Telemetry driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);

base-commit: 79df06733435e2773eb5e9ab9c0ce13c23e4cd88

Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 2/2 platform/x86/intel/pmt/telemetry: Add driver version

Add a driver version number to make it easier to track changes in backported kernels.

---
 drivers/platform/x86/intel/pmt/telemetry.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/intel/pmt/telemetry.c +2 -0
index 71cdef42084a..deb96b5777ce 100644
@@ -19,6 +19,7 @@
 #include "../vsec.h"
 #include "class.h"
 
+#define DRIVER_VERSION		"1.0"
 #define TELEM_SIZE_OFFSET	0x0
 #define TELEM_GUID_OFFSET	0x4
 #define TELEM_BASE_OFFSET	0x8
@@ -160,4 +161,5 @@ module_exit(pmt_telem_exit);
 MODULE_AUTHOR("David E. Box <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Telemetry driver");
 MODULE_LICENSE("GPL v2");
+MODULE_VERSION(DRIVER_VERSION);
 MODULE_IMPORT_NS(INTEL_PMT);
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 2/2] platform/x86/intel/pmt/telemetry: Add driver version

Quoted 3 lines · David E. Box

Add a driver version number to make it easier to track changes in backported kernels.

Sorry, but NAK. As Greg KH said, we do not use this anymore (in Git era) ­— the SHA from the Git _is_ the version of the driver.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Re: [PATCH 2/2] platform/x86/intel/pmt/telemetry: Add driver version

Hi,

Quoted 8 lines · Andy Shevchenko
Quoted 3 lines · David E. Box

Add a driver version number to make it easier to track changes in backported kernels.

Sorry, but NAK. As Greg KH said, we do not use this anymore (in Git era) ­— the SHA from the Git _is_ the version of the driver.

I agree with Andy per driver version numbers are really not useful.

Generally speaking the version number will get updated say once per upstream kernel-release in a separate commit, but there is no guarantee that commit will get cherry-picked together with other cherry-picked fixes.

So for downstream kernels these version numbers really don't have any meaning and as such are useless.

Regards,

Hans

author maintainer
#4 lore raw

Re: [PATCH 2/2] platform/x86/intel/pmt/telemetry: Add driver version

Quoted 12 lines · Hans de Goede

Hi,

Quoted 8 lines · Andy Shevchenko
Quoted 3 lines · David E. Box

Add a driver version number to make it easier to track changes in backported kernels.

Sorry, but NAK. As Greg KH said, we do not use this anymore (in Git era) ­— the SHA from the Git _is_ the version of the driver.

Quoted 8 lines

I agree with Andy per driver version numbers are really not useful.

Generally speaking the version number will get updated say once per upstream kernel-release in a separate commit,

but there is
no guarantee that commit will get cherry-picked together with other cherry-picked fixes.

Good point. Thanks.

David

Quoted 8 lines

So for downstream kernels these version numbers really don't have any meaning and as such are useless.

Regards,

Hans

Reviewed-by on v1 1/2
#5 lore raw
In reply to David E. Box
Quoted 3 lines · David E. Box

Since the currently exported symbols in pmt_class are only used by other Intel PMT drivers, create an INTEL_PMT module namespace for them.

Makes sense.

Quoted 61 lines
---
 drivers/platform/x86/intel/pmt/class.c     | 6 +++---
 drivers/platform/x86/intel/pmt/crashlog.c  | 1 +
 drivers/platform/x86/intel/pmt/telemetry.c | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmt/class.c +3 -3
index 46598dcb634a..0b96d75f5924 100644
@@ -33,7 +33,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev)
         */
        return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_is_early_client_hw);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT);
 
 static inline int
 pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
@@ -327,7 +327,7 @@ int intel_pmt_dev_create(struct intel_pmt_entry *entry, struct intel_pmt_namespa
        return intel_pmt_dev_register(entry, ns, dev);
 
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_create);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_create, INTEL_PMT);
 
 void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
                           struct intel_pmt_namespace *ns)
@@ -343,7 +343,7 @@ void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
        device_unregister(dev);
        xa_erase(ns->xa, entry->devid);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_destroy);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_destroy, INTEL_PMT);
 
 static int __init pmt_class_init(void)
 {
drivers/platform/x86/intel/pmt/crashlog.c +1 -0
index ace1239bc0a0..bbb3d61d09f4 100644
@@ -328,3 +328,4 @@ module_exit(pmt_crashlog_exit);
 MODULE_AUTHOR("Alexander Duyck <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Crashlog driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);
drivers/platform/x86/intel/pmt/telemetry.c +1 -0
index 5e4009c05ecf..71cdef42084a 100644
@@ -160,3 +160,4 @@ module_exit(pmt_telem_exit);
 MODULE_AUTHOR("David E. Box <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Telemetry driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);

base-commit: 79df06733435e2773eb5e9ab9c0ce13c23e4cd88 --
2.34.1

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Hi,

Quoted 8 lines · Andy Shevchenko
Quoted 3 lines · David E. Box

Since the currently exported symbols in pmt_class are only used by other Intel PMT drivers, create an INTEL_PMT module namespace for them.

Makes sense.

Thank you both for the patch and review, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 64 lines
Quoted 62 lines
---
 drivers/platform/x86/intel/pmt/class.c     | 6 +++---
 drivers/platform/x86/intel/pmt/crashlog.c  | 1 +
 drivers/platform/x86/intel/pmt/telemetry.c | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmt/class.c +3 -3
index 46598dcb634a..0b96d75f5924 100644
@@ -33,7 +33,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev)
         */
        return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_is_early_client_hw);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT);
 
 static inline int
 pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
@@ -327,7 +327,7 @@ int intel_pmt_dev_create(struct intel_pmt_entry *entry, struct intel_pmt_namespa
        return intel_pmt_dev_register(entry, ns, dev);
 
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_create);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_create, INTEL_PMT);
 
 void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
                           struct intel_pmt_namespace *ns)
@@ -343,7 +343,7 @@ void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
        device_unregister(dev);
        xa_erase(ns->xa, entry->devid);
 }
-EXPORT_SYMBOL_GPL(intel_pmt_dev_destroy);
+EXPORT_SYMBOL_NS_GPL(intel_pmt_dev_destroy, INTEL_PMT);
 
 static int __init pmt_class_init(void)
 {
drivers/platform/x86/intel/pmt/crashlog.c +1 -0
index ace1239bc0a0..bbb3d61d09f4 100644
@@ -328,3 +328,4 @@ module_exit(pmt_crashlog_exit);
 MODULE_AUTHOR("Alexander Duyck <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Crashlog driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);
drivers/platform/x86/intel/pmt/telemetry.c +1 -0
index 5e4009c05ecf..71cdef42084a 100644
@@ -160,3 +160,4 @@ module_exit(pmt_telem_exit);
 MODULE_AUTHOR("David E. Box <[email protected]>");
 MODULE_DESCRIPTION("Intel PMT Telemetry driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(INTEL_PMT);

base-commit: 79df06733435e2773eb5e9ab9c0ce13c23e4cd88 --
2.34.1