Commit 5fcd0d8a authored by Steffen Eiden's avatar Steffen Eiden Committed by Alexander Gordeev

s390/uvdevice: autoload module based on CPU facility

Make sure the uvdevice driver will be automatically loaded when
facility 158 is available.
Signed-off-by: default avatarSteffen Eiden <seiden@linux.ibm.com>
Reviewed-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220713125644.16121-4-seiden@linux.ibm.comSigned-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent e2f39c9f
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
enum { enum {
S390_CPU_FEATURE_MSA, S390_CPU_FEATURE_MSA,
S390_CPU_FEATURE_VXRS, S390_CPU_FEATURE_VXRS,
S390_CPU_FEATURE_UV,
MAX_CPU_FEATURES MAX_CPU_FEATURES
}; };
......
...@@ -20,6 +20,7 @@ struct s390_cpu_feature { ...@@ -20,6 +20,7 @@ struct s390_cpu_feature {
static struct s390_cpu_feature s390_cpu_features[MAX_CPU_FEATURES] = { static struct s390_cpu_feature s390_cpu_features[MAX_CPU_FEATURES] = {
[S390_CPU_FEATURE_MSA] = {.type = TYPE_HWCAP, .num = HWCAP_NR_MSA}, [S390_CPU_FEATURE_MSA] = {.type = TYPE_HWCAP, .num = HWCAP_NR_MSA},
[S390_CPU_FEATURE_VXRS] = {.type = TYPE_HWCAP, .num = HWCAP_NR_VXRS}, [S390_CPU_FEATURE_VXRS] = {.type = TYPE_HWCAP, .num = HWCAP_NR_VXRS},
[S390_CPU_FEATURE_UV] = {.type = TYPE_FACILITY, .num = 158},
}; };
/* /*
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/cpufeature.h>
#include <asm/uvdevice.h> #include <asm/uvdevice.h>
#include <asm/uv.h> #include <asm/uv.h>
...@@ -244,12 +245,10 @@ static void __exit uvio_dev_exit(void) ...@@ -244,12 +245,10 @@ static void __exit uvio_dev_exit(void)
static int __init uvio_dev_init(void) static int __init uvio_dev_init(void)
{ {
if (!test_facility(158))
return -ENXIO;
return misc_register(&uvio_dev_miscdev); return misc_register(&uvio_dev_miscdev);
} }
module_init(uvio_dev_init); module_cpu_feature_match(S390_CPU_FEATURE_UV, uvio_dev_init);
module_exit(uvio_dev_exit); module_exit(uvio_dev_exit);
MODULE_AUTHOR("IBM Corporation"); MODULE_AUTHOR("IBM Corporation");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment