From: Steffen Eiden <seiden@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Cc: nrb@linux.ibm.com
Subject: [PATCH v2 3/3] s390/uvdevice: autoload module based on CPU facility
Date: Wed, 13 Jul 2022 14:56:44 +0200 [thread overview]
Message-ID: <20220713125644.16121-4-seiden@linux.ibm.com> (raw)
In-Reply-To: <20220713125644.16121-1-seiden@linux.ibm.com>
Make sure the uvdevice driver will be automatically loaded when
facility 158 is available.
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
arch/s390/include/asm/cpufeature.h | 1 +
arch/s390/kernel/cpufeature.c | 1 +
drivers/s390/char/uvdevice.c | 5 ++---
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/s390/include/asm/cpufeature.h b/arch/s390/include/asm/cpufeature.h
index 771caf5281e5..931204613753 100644
--- a/arch/s390/include/asm/cpufeature.h
+++ b/arch/s390/include/asm/cpufeature.h
@@ -12,6 +12,7 @@
enum {
S390_CPU_FEATURE_MSA,
S390_CPU_FEATURE_VXRS,
+ S390_CPU_FEATURE_UV,
MAX_CPU_FEATURES
};
diff --git a/arch/s390/kernel/cpufeature.c b/arch/s390/kernel/cpufeature.c
index 170894730fcc..5c69be58a057 100644
--- a/arch/s390/kernel/cpufeature.c
+++ b/arch/s390/kernel/cpufeature.c
@@ -19,6 +19,7 @@ struct s390_cpu_feature {
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_VXRS] = {.type = TYPE_HWCAP, .num = HWCAP_NR_VXRS},
+ [S390_CPU_FEATURE_UV] = {.type = TYPE_FACILITY, .num = 158},
};
/*
diff --git a/drivers/s390/char/uvdevice.c b/drivers/s390/char/uvdevice.c
index 66505d7166a6..1d40457c7b10 100644
--- a/drivers/s390/char/uvdevice.c
+++ b/drivers/s390/char/uvdevice.c
@@ -27,6 +27,7 @@
#include <linux/stddef.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
+#include <linux/cpufeature.h>
#include <asm/uvdevice.h>
#include <asm/uv.h>
@@ -244,12 +245,10 @@ static void __exit uvio_dev_exit(void)
static int __init uvio_dev_init(void)
{
- if (!test_facility(158))
- return -ENXIO;
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_AUTHOR("IBM Corporation");
--
2.35.3
next prev parent reply other threads:[~2022-07-13 12:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 12:56 [PATCH v2 0/3] s390/cpufeature: rework to allow different types of cpufeatures Steffen Eiden
2022-07-13 12:56 ` [PATCH v2 1/3] s390/cpufeature: rework to allow more than only hwcap bits Steffen Eiden
2022-07-13 13:50 ` Claudio Imbrenda
2022-07-15 7:59 ` Hendrik Brueckner
2022-07-15 9:32 ` Heiko Carstens
2022-07-13 12:56 ` [PATCH v2 2/3] s390/cpufeature: allow for facility bits Steffen Eiden
2022-07-13 12:56 ` Steffen Eiden [this message]
2022-07-14 10:53 ` [PATCH v2 0/3] s390/cpufeature: rework to allow different types of cpufeatures Heiko Carstens
2022-07-15 7:49 ` Hendrik Brueckner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220713125644.16121-4-seiden@linux.ibm.com \
--to=seiden@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox