LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] coresight: cti: Correct the parameter for pm_runtime_put
@ 2021-08-19  9:29 Tao Zhang
  2021-08-29 14:28 ` Leo Yan
  2021-09-02 17:18 ` Mathieu Poirier
  0 siblings, 2 replies; 3+ messages in thread
From: Tao Zhang @ 2021-08-19  9:29 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
  Cc: Tao Zhang, Mike Leach, Leo Yan, Greg Kroah-Hartman, coresight,
	linux-arm-kernel, linux-kernel, Tingwei Zhang, Mao Jinlong,
	Yuanfang Zhang

The input parameter of the function pm_runtime_put should be the
same in the function cti_enable_hw and cti_disable_hw. The correct
parameter to use here should be dev->parent.

Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
---
 drivers/hwtracing/coresight/coresight-cti-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c
index e2a3620..8988b2e 100644
--- a/drivers/hwtracing/coresight/coresight-cti-core.c
+++ b/drivers/hwtracing/coresight/coresight-cti-core.c
@@ -175,7 +175,7 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
 	coresight_disclaim_device_unlocked(csdev);
 	CS_LOCK(drvdata->base);
 	spin_unlock(&drvdata->spinlock);
-	pm_runtime_put(dev);
+	pm_runtime_put(dev->parent);
 	return 0;
 
 	/* not disabled this call */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] coresight: cti: Correct the parameter for pm_runtime_put
  2021-08-19  9:29 [PATCH] coresight: cti: Correct the parameter for pm_runtime_put Tao Zhang
@ 2021-08-29 14:28 ` Leo Yan
  2021-09-02 17:18 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Leo Yan @ 2021-08-29 14:28 UTC (permalink / raw)
  To: Tao Zhang
  Cc: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin,
	Mike Leach, Greg Kroah-Hartman, coresight, linux-arm-kernel,
	linux-kernel, Tingwei Zhang, Mao Jinlong, Yuanfang Zhang

Hi Tao,

On Thu, Aug 19, 2021 at 05:29:37PM +0800, Tao Zhang wrote:
> The input parameter of the function pm_runtime_put should be the
> same in the function cti_enable_hw and cti_disable_hw. The correct
> parameter to use here should be dev->parent.
> 
> Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
> ---
>  drivers/hwtracing/coresight/coresight-cti-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c
> index e2a3620..8988b2e 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-core.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-core.c
> @@ -175,7 +175,7 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
>  	coresight_disclaim_device_unlocked(csdev);
>  	CS_LOCK(drvdata->base);
>  	spin_unlock(&drvdata->spinlock);
> -	pm_runtime_put(dev);
> +	pm_runtime_put(dev->parent);

coresight_register() allocates data structure 'coresight_device' and
assigns probed device to the field 'coresight_device::dev::parent';
thus afterwards we need to pass 'coresight_device::dev::parent' for
pm_runtime_xxx() functions.  It's not directive for understanding, so
log the info at here.

For the patch:

Reviewed-by: Leo Yan <leo.yan@linaro.org>

We could wait for Mike to review as well.

Thanks,
Leo

>  	return 0;
>  
>  	/* not disabled this call */
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] coresight: cti: Correct the parameter for pm_runtime_put
  2021-08-19  9:29 [PATCH] coresight: cti: Correct the parameter for pm_runtime_put Tao Zhang
  2021-08-29 14:28 ` Leo Yan
@ 2021-09-02 17:18 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Poirier @ 2021-09-02 17:18 UTC (permalink / raw)
  To: Tao Zhang
  Cc: Suzuki K Poulose, Alexander Shishkin, Mike Leach, Leo Yan,
	Greg Kroah-Hartman, coresight, linux-arm-kernel, linux-kernel,
	Tingwei Zhang, Mao Jinlong, Yuanfang Zhang

Hi Tao,

Apologies for the late reply - this patch fell through the cracks.

On Thu, Aug 19, 2021 at 05:29:37PM +0800, Tao Zhang wrote:
> The input parameter of the function pm_runtime_put should be the
> same in the function cti_enable_hw and cti_disable_hw. The correct
> parameter to use here should be dev->parent.
> 
> Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
> ---
>  drivers/hwtracing/coresight/coresight-cti-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c
> index e2a3620..8988b2e 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-core.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-core.c
> @@ -175,7 +175,7 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
>  	coresight_disclaim_device_unlocked(csdev);
>  	CS_LOCK(drvdata->base);
>  	spin_unlock(&drvdata->spinlock);
> -	pm_runtime_put(dev);
> +	pm_runtime_put(dev->parent);

You are correct - I have added this patch to my next tree.

Thanks,
Mathieu

>  	return 0;
>  
>  	/* not disabled this call */
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-02 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  9:29 [PATCH] coresight: cti: Correct the parameter for pm_runtime_put Tao Zhang
2021-08-29 14:28 ` Leo Yan
2021-09-02 17:18 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).