All of lore.kernel.org
 help / color / mirror / Atom feed
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] coresight: add PM runtime calls to coresight_simple_func()
Date: Thu, 23 Jun 2016 17:37:12 +0100	[thread overview]
Message-ID: <576C1038.502@arm.com> (raw)
In-Reply-To: <1466185307-19539-1-git-send-email-mathieu.poirier@linaro.org>



On 17/06/16 18:41, Mathieu Poirier wrote:
> It is mandatory to enable a coresight block's power domain before
> trying to access management registers.  Otherwise the transaction
> simply stalls, leading to a system hang.
>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>   drivers/hwtracing/coresight/coresight-priv.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> index ad975c58080d..b047241e7496 100644
> --- a/drivers/hwtracing/coresight/coresight-priv.h
> +++ b/drivers/hwtracing/coresight/coresight-priv.h
> @@ -16,6 +16,7 @@
>   #include <linux/bitops.h>
>   #include <linux/io.h>
>   #include <linux/coresight.h>
> +#include <linux/pm_runtime.h>
>
>   /*
>    * Coresight management registers (0xf00-0xfcc)
> @@ -42,8 +43,10 @@ static ssize_t name##_show(struct device *_dev,				\
>   			   struct device_attribute *attr, char *buf)	\
>   {									\
>   	type *drvdata = dev_get_drvdata(_dev->parent);			\
> +	pm_runtime_get_sync(_dev->parent);				\
>   	return scnprintf(buf, PAGE_SIZE, "0x%x\n",			\
>   			 readl_relaxed(drvdata->base + offset));	\
> +	pm_runtime_put_sync(_dev->parent);				\

This is wrong, I just noticed when I was playing around this.
Perhaps you meant to do this before returning ? I wonder why compiler
doesn't throw any error.

-- 
Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla@arm.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Cc: Sudeep Holla <sudeep.holla@arm.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coresight: add PM runtime calls to coresight_simple_func()
Date: Thu, 23 Jun 2016 17:37:12 +0100	[thread overview]
Message-ID: <576C1038.502@arm.com> (raw)
In-Reply-To: <1466185307-19539-1-git-send-email-mathieu.poirier@linaro.org>



On 17/06/16 18:41, Mathieu Poirier wrote:
> It is mandatory to enable a coresight block's power domain before
> trying to access management registers.  Otherwise the transaction
> simply stalls, leading to a system hang.
>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>   drivers/hwtracing/coresight/coresight-priv.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> index ad975c58080d..b047241e7496 100644
> --- a/drivers/hwtracing/coresight/coresight-priv.h
> +++ b/drivers/hwtracing/coresight/coresight-priv.h
> @@ -16,6 +16,7 @@
>   #include <linux/bitops.h>
>   #include <linux/io.h>
>   #include <linux/coresight.h>
> +#include <linux/pm_runtime.h>
>
>   /*
>    * Coresight management registers (0xf00-0xfcc)
> @@ -42,8 +43,10 @@ static ssize_t name##_show(struct device *_dev,				\
>   			   struct device_attribute *attr, char *buf)	\
>   {									\
>   	type *drvdata = dev_get_drvdata(_dev->parent);			\
> +	pm_runtime_get_sync(_dev->parent);				\
>   	return scnprintf(buf, PAGE_SIZE, "0x%x\n",			\
>   			 readl_relaxed(drvdata->base + offset));	\
> +	pm_runtime_put_sync(_dev->parent);				\

This is wrong, I just noticed when I was playing around this.
Perhaps you meant to do this before returning ? I wonder why compiler
doesn't throw any error.

-- 
Regards,
Sudeep

  reply	other threads:[~2016-06-23 16:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 17:41 [PATCH] coresight: add PM runtime calls to coresight_simple_func() Mathieu Poirier
2016-06-17 17:41 ` Mathieu Poirier
2016-06-23 16:37 ` Sudeep Holla [this message]
2016-06-23 16:37   ` Sudeep Holla
2016-06-23 17:10   ` Mathieu Poirier
2016-06-23 17:10     ` Mathieu Poirier

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=576C1038.502@arm.com \
    --to=sudeep.holla@arm.com \
    --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.