linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] memory/samsung: reduce protected code area in IRQ
@ 2020-05-12 12:31 Bernard Zhao
  2020-05-12 12:52 ` Lukasz Luba
  2020-05-12 13:16 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Bernard Zhao @ 2020-05-12 12:31 UTC (permalink / raw)
  To: Lukasz Luba, Kukjin Kim, Krzysztof Kozlowski, linux-pm,
	linux-samsung-soc, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel, Bernard Zhao

This change will speed-up a bit this IRQ processing and there
is no need to protect return value or printing.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
Changes since v1:
*change release lock before the if statement.
*revert dmc->df->lock mutex lock to protect function
exynos5_dmc_perf_events_check

Changes since v2:
*Improve subject and commit message

Link for V1:
*https://lore.kernel.org/patchwork/patch/1238888/
---
 drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 22a43d662833..25196d6268e2 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1346,15 +1346,13 @@ static irqreturn_t dmc_irq_thread(int irq, void *priv)
 	struct exynos5_dmc *dmc = priv;
 
 	mutex_lock(&dmc->df->lock);
-
 	exynos5_dmc_perf_events_check(dmc);
-
 	res = update_devfreq(dmc->df);
+	mutex_unlock(&dmc->df->lock);
+
 	if (res)
 		dev_warn(dmc->dev, "devfreq failed with %d\n", res);
 
-	mutex_unlock(&dmc->df->lock);
-
 	return IRQ_HANDLED;
 }
 
-- 
2.26.2


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

* Re: [PATCH v3] memory/samsung: reduce protected code area in IRQ
  2020-05-12 12:31 [PATCH v3] memory/samsung: reduce protected code area in IRQ Bernard Zhao
@ 2020-05-12 12:52 ` Lukasz Luba
  2020-05-12 13:16 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Lukasz Luba @ 2020-05-12 12:52 UTC (permalink / raw)
  To: Bernard Zhao, Kukjin Kim, Krzysztof Kozlowski, linux-pm,
	linux-samsung-soc, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel



On 5/12/20 1:31 PM, Bernard Zhao wrote:
> This change will speed-up a bit this IRQ processing and there
> is no need to protect return value or printing.
> 
> Signed-off-by: Bernard Zhao <bernard@vivo.com>

LGTM

Acked-by: Lukasz Luba <lukasz.luba@arm.com>


> ---
> Changes since v1:
> *change release lock before the if statement.
> *revert dmc->df->lock mutex lock to protect function
> exynos5_dmc_perf_events_check
> 
> Changes since v2:
> *Improve subject and commit message
> 
> Link for V1:
> *https://lore.kernel.org/patchwork/patch/1238888/
> ---
>   drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> index 22a43d662833..25196d6268e2 100644
> --- a/drivers/memory/samsung/exynos5422-dmc.c
> +++ b/drivers/memory/samsung/exynos5422-dmc.c
> @@ -1346,15 +1346,13 @@ static irqreturn_t dmc_irq_thread(int irq, void *priv)
>   	struct exynos5_dmc *dmc = priv;
>   
>   	mutex_lock(&dmc->df->lock);
> -
>   	exynos5_dmc_perf_events_check(dmc);
> -
>   	res = update_devfreq(dmc->df);
> +	mutex_unlock(&dmc->df->lock);
> +
>   	if (res)
>   		dev_warn(dmc->dev, "devfreq failed with %d\n", res);
>   
> -	mutex_unlock(&dmc->df->lock);
> -
>   	return IRQ_HANDLED;
>   }
>   
> 

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

* Re: [PATCH v3] memory/samsung: reduce protected code area in IRQ
  2020-05-12 12:31 [PATCH v3] memory/samsung: reduce protected code area in IRQ Bernard Zhao
  2020-05-12 12:52 ` Lukasz Luba
@ 2020-05-12 13:16 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2020-05-12 13:16 UTC (permalink / raw)
  To: Bernard Zhao
  Cc: Lukasz Luba, Kukjin Kim, linux-pm, linux-samsung-soc,
	linux-arm-kernel, linux-kernel, opensource.kernel

On Tue, May 12, 2020 at 05:31:49AM -0700, Bernard Zhao wrote:
> This change will speed-up a bit this IRQ processing and there
> is no need to protect return value or printing.
> 
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
> ---
> Changes since v1:
> *change release lock before the if statement.
> *revert dmc->df->lock mutex lock to protect function
> exynos5_dmc_perf_events_check
> 
> Changes since v2:
> *Improve subject and commit message
> 
> Link for V1:
> *https://lore.kernel.org/patchwork/patch/1238888/
> ---
>  drivers/memory/samsung/exynos5422-dmc.c | 6 ++----

Thanks, applied.

Best regards,
Krzysztof


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

end of thread, other threads:[~2020-05-12 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 12:31 [PATCH v3] memory/samsung: reduce protected code area in IRQ Bernard Zhao
2020-05-12 12:52 ` Lukasz Luba
2020-05-12 13:16 ` Krzysztof Kozlowski

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).