From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: <linux-arm-kernel@lists.infradead.org>, <soc@kernel.org>
Cc: olof@lixom.net, catalin.marinas@arm.com, will@kernel.org,
misono.tomohiro@jp.fujitsu.com, arnd@arndb.de
Subject: [PATCH 07/10] soc: fujitsu: hwb: Add IOC_GET_PE_INFO ioctl
Date: Fri, 8 Jan 2021 19:52:38 +0900 [thread overview]
Message-ID: <20210108105241.1757799-8-misono.tomohiro@jp.fujitsu.com> (raw)
In-Reply-To: <20210108105241.1757799-1-misono.tomohiro@jp.fujitsu.com>
This is an infomative ioctl to tell users CMG/PE number of currently
running PE.
Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
---
drivers/soc/fujitsu/fujitsu_hwb.c | 18 ++++++++++++++++++
include/uapi/linux/fujitsu_hpc_ioctl.h | 7 +++++++
2 files changed, 25 insertions(+)
diff --git a/drivers/soc/fujitsu/fujitsu_hwb.c b/drivers/soc/fujitsu/fujitsu_hwb.c
index 2535942cc0d7..1132cb74b13b 100644
--- a/drivers/soc/fujitsu/fujitsu_hwb.c
+++ b/drivers/soc/fujitsu/fujitsu_hwb.c
@@ -733,6 +733,21 @@ static int ioc_bb_free(struct file *filp, void __user *argp)
return 0;
}
+static int ioc_get_pe_info(struct file *filp, void __user *argp)
+{
+ struct fujitsu_hwb_ioc_pe_info pe_info = {0};
+ int cpu = smp_processor_id();
+
+ pe_info.cmg = _hwinfo.core_map[cpu].cmg;
+ pe_info.ppe = _hwinfo.core_map[cpu].ppe;
+
+ if (copy_to_user((struct fujitsu_hwb_ioc_pe_info __user *)argp, &pe_info,
+ sizeof(struct fujitsu_hwb_ioc_pe_info)))
+ return -EFAULT;
+
+ return 0;
+}
+
static long fujitsu_hwb_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
@@ -751,6 +766,9 @@ static long fujitsu_hwb_dev_ioctl(struct file *filp, unsigned int cmd, unsigned
case FUJITSU_HWB_IOC_BB_FREE:
ret = ioc_bb_free(filp, argp);
break;
+ case FUJITSU_HWB_IOC_GET_PE_INFO:
+ ret = ioc_get_pe_info(filp, argp);
+ break;
default:
ret = -ENOTTY;
break;
diff --git a/include/uapi/linux/fujitsu_hpc_ioctl.h b/include/uapi/linux/fujitsu_hpc_ioctl.h
index 7a285d8db0a9..1226014d97c4 100644
--- a/include/uapi/linux/fujitsu_hpc_ioctl.h
+++ b/include/uapi/linux/fujitsu_hpc_ioctl.h
@@ -22,6 +22,11 @@ struct fujitsu_hwb_ioc_bw_ctl {
__s8 window;
};
+struct fujitsu_hwb_ioc_pe_info {
+ __u8 cmg;
+ __u8 ppe;
+};
+
#define FUJITSU_HWB_IOC_BB_ALLOC _IOWR(__FUJITSU_IOCTL_MAGIC, \
0x00, struct fujitsu_hwb_ioc_bb_ctl)
#define FUJITSU_HWB_IOC_BW_ASSIGN _IOWR(__FUJITSU_IOCTL_MAGIC, \
@@ -30,5 +35,7 @@ struct fujitsu_hwb_ioc_bw_ctl {
0x02, struct fujitsu_hwb_ioc_bw_ctl)
#define FUJITSU_HWB_IOC_BB_FREE _IOW(__FUJITSU_IOCTL_MAGIC, \
0x03, struct fujitsu_hwb_ioc_bb_ctl)
+#define FUJITSU_HWB_IOC_GET_PE_INFO _IOR(__FUJITSU_IOCTL_MAGIC, \
+ 0x04, struct fujitsu_hwb_ioc_pe_info)
#endif /* _UAPI_LINUX_FUJITSU_HPC_IOC_H */
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-01-08 10:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 10:52 [RFC PATCH 00/10] Add Fujitsu A64FX soc entry/hardware barrier driver Misono Tomohiro
2021-01-08 10:52 ` [PATCH 01/10] soc: fujitsu: hwb: Add hardware barrier driver init/exit code Misono Tomohiro
2021-01-08 10:52 ` [PATCH 02/10] soc: fujtisu: hwb: Add open operation Misono Tomohiro
2021-01-08 10:52 ` [PATCH 03/10] soc: fujitsu: hwb: Add IOC_BB_ALLOC ioctl Misono Tomohiro
2021-01-08 13:22 ` Arnd Bergmann
2021-01-12 11:02 ` misono.tomohiro
2021-01-12 12:34 ` Arnd Bergmann
2021-01-08 10:52 ` [PATCH 04/10] soc: fujitsu: hwb: Add IOC_BW_ASSIGN ioctl Misono Tomohiro
2021-01-08 10:52 ` [PATCH 05/10] soc: fujitsu: hwb: Add IOC_BW_UNASSIGN ioctl Misono Tomohiro
2021-01-08 10:52 ` [PATCH 06/10] soc: fujitsu: hwb: Add IOC_BB_FREE ioctl Misono Tomohiro
2021-01-08 10:52 ` Misono Tomohiro [this message]
2021-01-08 10:52 ` [PATCH 08/10] soc: fujitsu: hwb: Add release operation Misono Tomohiro
2021-01-08 13:25 ` Arnd Bergmann
2021-01-12 10:38 ` misono.tomohiro
2021-01-08 10:52 ` [PATCH 09/10] soc: fujitsu: hwb: Add sysfs entry Misono Tomohiro
2021-01-08 13:27 ` Arnd Bergmann
2021-01-12 10:40 ` misono.tomohiro
2021-01-08 10:52 ` [PATCH 10/10] soc: fujitsu: hwb: Add Kconfig/Makefile to build fujitsu_hwb driver Misono Tomohiro
2021-01-08 12:54 ` [RFC PATCH 00/10] Add Fujitsu A64FX soc entry/hardware barrier driver Mark Rutland
2021-01-08 14:23 ` Arnd Bergmann
2021-01-08 15:51 ` Mark Rutland
2021-01-12 10:24 ` misono.tomohiro
2021-01-12 14:22 ` Arnd Bergmann
2021-01-15 11:10 ` misono.tomohiro
2021-01-15 12:24 ` Arnd Bergmann
2021-01-19 5:30 ` misono.tomohiro
2021-02-18 9:49 ` misono.tomohiro
2021-03-01 7:53 ` misono.tomohiro
2021-03-02 11:06 ` Arnd Bergmann
2021-03-03 11:20 ` misono.tomohiro
2021-03-03 13:33 ` Arnd Bergmann
2021-03-04 7:03 ` misono.tomohiro
2021-01-12 10:32 ` misono.tomohiro
-- strict thread matches above, loose matches on Subject: below --
2021-01-08 10:32 Misono Tomohiro
2021-01-08 10:32 ` [PATCH 07/10] soc: fujitsu: hwb: Add IOC_GET_PE_INFO ioctl Misono Tomohiro
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=20210108105241.1757799-8-misono.tomohiro@jp.fujitsu.com \
--to=misono.tomohiro@jp.fujitsu.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=olof@lixom.net \
--cc=soc@kernel.org \
--cc=will@kernel.org \
/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