From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/6] arm: exynos: Add /dev/bL_status user interface on Exynos5420
Date: Mon, 28 Apr 2014 13:25:00 +0200 [thread overview]
Message-ID: <535E3A8C.6070304@linaro.org> (raw)
In-Reply-To: <1398528348-21214-7-git-send-email-a.kesavan@samsung.com>
On 04/26/2014 06:05 PM, Abhilash Kesavan wrote:
> Add a user interface to check the core and cluster status on
> Exynos5420. This can be utilized while debugging mcpm issues.
> cat /dev/bL_status will show the current power status of all
> the 8 cores along with the cluster.
>
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> ---
Hi Abhilash,
I don't think you should add this file.
1. big Little is not exynos specific
2. /dev is not for the purpose of your patch
So I would recommend:
1. create a generic infra-structure for all the big.Little
2. and/or use debugfs
Furthermore, how is it usable ? Will you read the file every 2ms to
check the cluster status, knowing it will be woken up by the read
operation ?
Frankly speaking, it would make sense to add traces in mcpm.c (if they
aren't already there - did not check).
> arch/arm/mach-exynos/mcpm-exynos.c | 64 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
> index f9977bf..83428b0 100644
> --- a/arch/arm/mach-exynos/mcpm-exynos.c
> +++ b/arch/arm/mach-exynos/mcpm-exynos.c
> @@ -269,6 +269,53 @@ static void __init exynos_mcpm_usage_count_init(void)
> cpu_use_count[cpu][cluster] = 1;
> }
>
> +static size_t bL_check_status(char *info)
> +{
> + size_t len = 0;
> + int i;
> +
> + len += sprintf(&info[len], "\t0 1 2 3 L2\n");
> + len += sprintf(&info[len], "[A15] ");
> + for (i = 0; i < 4; i++) {
> + len += sprintf(&info[len], "%d ",
> + (readl(EXYNOS_ARM_CORE_STATUS(i)) & 0x3) == 3 ? 1 : 0);
> + }
> + len += sprintf(&info[len], "%d\n",
> + (readl(EXYNOS_COMMON_STATUS(0)) & 0x3) == 3 ? 1 : 0);
> +
> + len += sprintf(&info[len], "[A7] ");
> + for (i = 4; i < 8; i++)
> + len += sprintf(&info[len], "%d ",
> + (readl(EXYNOS_ARM_CORE_STATUS(i)) & 0x3) == 3 ? 1 : 0);
> + len += sprintf(&info[len], "%d\n\n",
> + (readl(EXYNOS_COMMON_STATUS(1)) & 0x3) == 3 ? 1 : 0);
> +
> + return len;
> +}
> +
> +static ssize_t bL_status_read(struct file *file, char __user *buf,
> + size_t len, loff_t *pos)
> +{
> + size_t count = 0;
> + char info[100];
> +
> + count = bL_check_status(info);
> + if (count < 0)
> + return -EINVAL;
> +
> + return simple_read_from_buffer(buf, len, pos, info, count);
> +}
> +
> +static const struct file_operations bL_status_fops = {
> + .read = bL_status_read,
> +};
> +
> +static struct miscdevice bL_status_device = {
> + MISC_DYNAMIC_MINOR,
> + "bL_status",
> + &bL_status_fops
> +};
> +
> /*
> * Enable cluster-level coherency, in preparation for turning on the MMU.
> */
> @@ -319,3 +366,20 @@ static int __init exynos_mcpm_init(void)
> }
>
> early_initcall(exynos_mcpm_init);
> +
> +static int __init exynos_bl_status_init(void)
> +{
> + int ret;
> +
> + if (!soc_is_exynos5420())
> + return -ENODEV;
> +
> + ret = misc_register(&bL_status_device);
> + if (ret) {
> + pr_info("bl_status not available\n");
> + return ret;
> + }
> + return 0;
> +}
> +
> +late_initcall(exynos_bl_status_init);
>
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Abhilash Kesavan
<a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
Dave.Martin-5wv7dgnIgG8@public.gmane.org,
lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
inderpal.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
kesavan.abhilash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v3 6/6] arm: exynos: Add /dev/bL_status user interface on Exynos5420
Date: Mon, 28 Apr 2014 13:25:00 +0200 [thread overview]
Message-ID: <535E3A8C.6070304@linaro.org> (raw)
In-Reply-To: <1398528348-21214-7-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
On 04/26/2014 06:05 PM, Abhilash Kesavan wrote:
> Add a user interface to check the core and cluster status on
> Exynos5420. This can be utilized while debugging mcpm issues.
> cat /dev/bL_status will show the current power status of all
> the 8 cores along with the cluster.
>
> Signed-off-by: Thomas Abraham <thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Inderpal Singh <inderpal.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Abhilash Kesavan <a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
Hi Abhilash,
I don't think you should add this file.
1. big Little is not exynos specific
2. /dev is not for the purpose of your patch
So I would recommend:
1. create a generic infra-structure for all the big.Little
2. and/or use debugfs
Furthermore, how is it usable ? Will you read the file every 2ms to
check the cluster status, knowing it will be woken up by the read
operation ?
Frankly speaking, it would make sense to add traces in mcpm.c (if they
aren't already there - did not check).
> arch/arm/mach-exynos/mcpm-exynos.c | 64 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
> index f9977bf..83428b0 100644
> --- a/arch/arm/mach-exynos/mcpm-exynos.c
> +++ b/arch/arm/mach-exynos/mcpm-exynos.c
> @@ -269,6 +269,53 @@ static void __init exynos_mcpm_usage_count_init(void)
> cpu_use_count[cpu][cluster] = 1;
> }
>
> +static size_t bL_check_status(char *info)
> +{
> + size_t len = 0;
> + int i;
> +
> + len += sprintf(&info[len], "\t0 1 2 3 L2\n");
> + len += sprintf(&info[len], "[A15] ");
> + for (i = 0; i < 4; i++) {
> + len += sprintf(&info[len], "%d ",
> + (readl(EXYNOS_ARM_CORE_STATUS(i)) & 0x3) == 3 ? 1 : 0);
> + }
> + len += sprintf(&info[len], "%d\n",
> + (readl(EXYNOS_COMMON_STATUS(0)) & 0x3) == 3 ? 1 : 0);
> +
> + len += sprintf(&info[len], "[A7] ");
> + for (i = 4; i < 8; i++)
> + len += sprintf(&info[len], "%d ",
> + (readl(EXYNOS_ARM_CORE_STATUS(i)) & 0x3) == 3 ? 1 : 0);
> + len += sprintf(&info[len], "%d\n\n",
> + (readl(EXYNOS_COMMON_STATUS(1)) & 0x3) == 3 ? 1 : 0);
> +
> + return len;
> +}
> +
> +static ssize_t bL_status_read(struct file *file, char __user *buf,
> + size_t len, loff_t *pos)
> +{
> + size_t count = 0;
> + char info[100];
> +
> + count = bL_check_status(info);
> + if (count < 0)
> + return -EINVAL;
> +
> + return simple_read_from_buffer(buf, len, pos, info, count);
> +}
> +
> +static const struct file_operations bL_status_fops = {
> + .read = bL_status_read,
> +};
> +
> +static struct miscdevice bL_status_device = {
> + MISC_DYNAMIC_MINOR,
> + "bL_status",
> + &bL_status_fops
> +};
> +
> /*
> * Enable cluster-level coherency, in preparation for turning on the MMU.
> */
> @@ -319,3 +366,20 @@ static int __init exynos_mcpm_init(void)
> }
>
> early_initcall(exynos_mcpm_init);
> +
> +static int __init exynos_bl_status_init(void)
> +{
> + int ret;
> +
> + if (!soc_is_exynos5420())
> + return -ENODEV;
> +
> + ret = misc_register(&bL_status_device);
> + if (ret) {
> + pr_info("bl_status not available\n");
> + return ret;
> + }
> + return 0;
> +}
> +
> +late_initcall(exynos_bl_status_init);
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-04-28 11:25 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-26 16:05 [PATCH v3 0/6] MCPM backend for Exynos5420 Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 1/6] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 2/6] ARM: EXYNOS: use generic exynos cpu power control functions Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-05-02 15:25 ` [PATCH v4 2/5] " Abhilash Kesavan
2014-05-02 15:25 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 3/6] arm: exynos: Add generic cluster " Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-05-02 15:25 ` [PATCH v4 3/5] " Abhilash Kesavan
2014-05-02 15:25 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 4/6] ARM: dts: exynos5420: add CCI node Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-05-02 15:25 ` [PATCH v4 4/5] " Abhilash Kesavan
2014-05-02 15:25 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 5/6] arm: exynos: Add MCPM call-back functions Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-04-28 17:44 ` Lorenzo Pieralisi
2014-04-28 17:44 ` Lorenzo Pieralisi
2014-04-29 3:32 ` Abhilash Kesavan
2014-04-29 3:32 ` Abhilash Kesavan
2014-04-29 18:49 ` Nicolas Pitre
2014-04-29 18:49 ` Nicolas Pitre
2014-04-30 3:01 ` Abhilash Kesavan
2014-04-30 3:01 ` Abhilash Kesavan
2014-04-30 10:24 ` Dave Martin
2014-04-30 10:24 ` Dave Martin
2014-04-30 14:43 ` Nicolas Pitre
2014-04-30 14:43 ` Nicolas Pitre
2014-05-01 9:39 ` Abhilash Kesavan
2014-05-01 9:39 ` Abhilash Kesavan
2014-04-30 14:59 ` Lorenzo Pieralisi
2014-04-30 14:59 ` Lorenzo Pieralisi
2014-05-01 9:39 ` Abhilash Kesavan
2014-05-01 9:39 ` Abhilash Kesavan
2014-05-02 15:25 ` [PATCH v4 5/5] " Abhilash Kesavan
2014-05-02 15:25 ` Abhilash Kesavan
2014-05-02 18:16 ` Nicolas Pitre
2014-05-02 18:16 ` Nicolas Pitre
2014-05-02 18:23 ` Andrew Bresticker
2014-05-02 18:23 ` Andrew Bresticker
2014-05-02 18:37 ` Nicolas Pitre
2014-05-02 18:37 ` Nicolas Pitre
2014-05-05 16:26 ` Abhilash Kesavan
2014-05-05 16:26 ` Abhilash Kesavan
2014-05-05 16:25 ` Abhilash Kesavan
2014-05-05 16:25 ` Abhilash Kesavan
2014-04-26 16:05 ` [PATCH v3 6/6] arm: exynos: Add /dev/bL_status user interface on Exynos5420 Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
2014-04-28 11:25 ` Daniel Lezcano [this message]
2014-04-28 11:25 ` Daniel Lezcano
2014-04-28 12:49 ` Abhilash Kesavan
2014-04-28 12:49 ` Abhilash Kesavan
2014-04-30 14:49 ` Nicolas Pitre
2014-04-30 14:49 ` Nicolas Pitre
2014-05-01 9:39 ` Abhilash Kesavan
2014-05-01 9:39 ` Abhilash Kesavan
2014-05-02 15:24 ` [PATCH v4 0/5] MCPM backend for Exynos5420 Abhilash Kesavan
2014-05-02 15:24 ` Abhilash Kesavan
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=535E3A8C.6070304@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.