Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stm class: Fix channel free in stm output free path
@ 2019-04-05 10:24 Sai Prakash Ranjan
  2019-04-05 10:32 ` Suzuki K Poulose
  2019-04-05 10:36 ` Alexander Shishkin
  0 siblings, 2 replies; 3+ messages in thread
From: Sai Prakash Ranjan @ 2019-04-05 10:24 UTC (permalink / raw)
  To: Alexander Shishkin, Greg Kroah-Hartman, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, Mathieu Poirier, Suzuki K Poulose,
	Mike Leach, Leo Yan
  Cc: Sai Prakash Ranjan, Rajendra Nayak, Tingwei Zhang, linux-arm-msm,
	linux-kernel, stable, Sibi Sankar, Vivek Gautam, linux-arm-kernel

From: Tingwei Zhang <tingwei@codeaurora.org>

Number of free masters is not set correctly in stm
free path. Fix this by properly adding the number
of output channels before setting them to 0 in
stm_output_disclaim().

Currently it is equivalent to doing nothing since
master->nr_free is incremented by 0.

Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Cc: stable@vger.kernel.org
---
 drivers/hwtracing/stm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index c7ba8acfd4d5..5b5807cbcf7c 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -218,8 +218,8 @@ stm_output_disclaim(struct stm_device *stm, struct stm_output *output)
 	bitmap_release_region(&master->chan_map[0], output->channel,
 			      ilog2(output->nr_chans));
 
-	output->nr_chans = 0;
 	master->nr_free += output->nr_chans;
+	output->nr_chans = 0;
 }
 
 /*
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] stm class: Fix channel free in stm output free path
  2019-04-05 10:24 [PATCH] stm class: Fix channel free in stm output free path Sai Prakash Ranjan
@ 2019-04-05 10:32 ` Suzuki K Poulose
  2019-04-05 10:36 ` Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Suzuki K Poulose @ 2019-04-05 10:32 UTC (permalink / raw)
  To: saiprakash.ranjan, alexander.shishkin, gregkh, mcoquelin.stm32,
	alexandre.torgue, linux-stm32, mathieu.poirier, mike.leach,
	leo.yan
  Cc: rnayak, tingwei, linux-arm-msm, linux-kernel, stable, sibis,
	vivek.gautam, linux-arm-kernel



On 05/04/2019 11:24, Sai Prakash Ranjan wrote:
> From: Tingwei Zhang <tingwei@codeaurora.org>
> 
> Number of free masters is not set correctly in stm
> free path. Fix this by properly adding the number
> of output channels before setting them to 0 in
> stm_output_disclaim().
> 
> Currently it is equivalent to doing nothing since
> master->nr_free is incremented by 0.
> 
> Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
> Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> Cc: stable@vger.kernel.org
> ---
>   drivers/hwtracing/stm/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
> index c7ba8acfd4d5..5b5807cbcf7c 100644
> --- a/drivers/hwtracing/stm/core.c
> +++ b/drivers/hwtracing/stm/core.c
> @@ -218,8 +218,8 @@ stm_output_disclaim(struct stm_device *stm, struct stm_output *output)
>   	bitmap_release_region(&master->chan_map[0], output->channel,
>   			      ilog2(output->nr_chans));
>   
> -	output->nr_chans = 0;
>   	master->nr_free += output->nr_chans;
> +	output->nr_chans = 0;

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] stm class: Fix channel free in stm output free path
  2019-04-05 10:24 [PATCH] stm class: Fix channel free in stm output free path Sai Prakash Ranjan
  2019-04-05 10:32 ` Suzuki K Poulose
@ 2019-04-05 10:36 ` Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2019-04-05 10:36 UTC (permalink / raw)
  To: Sai Prakash Ranjan, Greg Kroah-Hartman, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, Mathieu Poirier, Suzuki K Poulose,
	Mike Leach, Leo Yan
  Cc: Sai Prakash Ranjan, Rajendra Nayak, Tingwei Zhang, linux-arm-msm,
	linux-kernel, stable, Sibi Sankar, Vivek Gautam, linux-arm-kernel

Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> writes:

> From: Tingwei Zhang <tingwei@codeaurora.org>
>
> Number of free masters is not set correctly in stm
> free path. Fix this by properly adding the number
> of output channels before setting them to 0 in
> stm_output_disclaim().
>
> Currently it is equivalent to doing nothing since
> master->nr_free is incremented by 0.

Good catch, thank you!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-05 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-05 10:24 [PATCH] stm class: Fix channel free in stm output free path Sai Prakash Ranjan
2019-04-05 10:32 ` Suzuki K Poulose
2019-04-05 10:36 ` Alexander Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox