Skip to contentSkip to conversation

memory/samsung: reduce protected code area in IRQ

PATCH Applied Bernard Zhao 3 participants 3 messages May 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 memory/samsung: reduce protected code area in IRQ

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

---
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(-)
drivers/memory/samsung/exynos5422-dmc.c +2 -4
index 22a43d662833..25196d6268e2 100644
@@ -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;
 }
 
Signature · 1 line
2.26.2
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 4 lines · Bernard Zhao

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

LGTM

Quoted 38 lines

---
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(-)
drivers/memory/samsung/exynos5422-dmc.c +2 -4
index 22a43d662833..25196d6268e2 100644
@@ -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;
  }
 
maintainer Applied
#2 lore raw
In reply to Bernard Zhao
Quoted 10 lines · Bernard Zhao

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

---
Changes since v1:
*change release lock before the if statement. *revert dmc->df->lock mutex lock to protect function exynos5_dmc_perf_events_check

Quoted 7 lines

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