Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723127

[PATCH 06/13] thermal/drivers/hisi: Remove pointless lock

From Daniel Lezcano <daniel.lezcano@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 06/13] thermal/drivers/hisi: Remove pointless lock
Date 2017-08-30 11:00 +0200
Message-ID <uk70R-66H-5@gated-at.bofh.it> (permalink)
References <uk6Rb-63h-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The threaded interrupt inspect the sensors structure to look in the temp
threshold field, but this field is read-only in all the code, except in the
probe function before the threaded interrupt is set. In other words there
is not race window in the threaded interrupt when reading the field value.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/hisi_thermal.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 524310d..6f0dab1 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -221,14 +221,10 @@ static irqreturn_t hisi_thermal_alarm_irq(int irq, void *dev)
 static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev)
 {
 	struct hisi_thermal_data *data = dev;
-	struct hisi_thermal_sensor *sensor;
-
-	mutex_lock(&data->thermal_lock);
-	sensor = &data->sensors;
+	struct hisi_thermal_sensor *sensor = &data->sensors;
 
 	dev_crit(&data->pdev->dev, "THERMAL ALARM: T > %d\n",
 		 sensor->thres_temp);
-	mutex_unlock(&data->thermal_lock);
 
 	thermal_zone_device_update(data->sensors.tzd,
 				   THERMAL_EVENT_UNSPECIFIED);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/13] thermal/drivers/hisi: Fix missing interrupt enablement Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 10:50 +0200
  [PATCH 02/13] thermal/drivers/hisi: Remove the multiple sensors support Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 10:50 +0200
    Re: [PATCH 02/13] thermal/drivers/hisi: Remove the multiple sensors  support Leo Yan <leo.yan@linaro.org> - 2017-09-01 16:10 +0200
      Re: [PATCH 02/13] thermal/drivers/hisi: Remove the multiple sensors  support Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-01 22:50 +0200
  [PATCH 06/13] thermal/drivers/hisi: Remove pointless lock Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 11:00 +0200
    Re: [PATCH 06/13] thermal/drivers/hisi: Remove pointless lock Leo Yan <leo.yan@linaro.org> - 2017-09-01 16:50 +0200
  [PATCH 03/13] thermal/drivers/hisi: Fix kernel panic on alarm interrupt Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 11:00 +0200
    Re: [PATCH 03/13] thermal/drivers/hisi: Fix kernel panic on alarm  interrupt Leo Yan <leo.yan@linaro.org> - 2017-09-01 16:20 +0200
  [PATCH 08/13] thermal/drivers/hisi: Fix configuration register setting Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 11:00 +0200
    Re: [PATCH 08/13] thermal/drivers/hisi: Fix configuration register  setting Leo Yan <leo.yan@linaro.org> - 2017-09-02 05:00 +0200
      Re: [PATCH 08/13] thermal/drivers/hisi: Fix configuration register  setting Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-02 10:40 +0200
        Re: [PATCH 08/13] thermal/drivers/hisi: Fix configuration register  setting Leo Yan <leo.yan@linaro.org> - 2017-09-04 03:00 +0200
          Re: [PATCH 08/13] thermal/drivers/hisi: Fix configuration register  setting Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-04 11:20 +0200
  [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor inspection Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 11:00 +0200
    Re: [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor  inspection Leo Yan <leo.yan@linaro.org> - 2017-09-02 05:30 +0200
      Re: [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor  inspection Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-02 15:20 +0200
        Re: [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor  inspection Leo Yan <leo.yan@linaro.org> - 2017-09-04 03:00 +0200
          Re: [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor  inspection Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-04 13:30 +0200
            Re: [PATCH 09/13] thermal/drivers/hisi: Remove costly sensor  inspection Leo Yan <leo.yan@linaro.org> - 2017-09-04 16:40 +0200
  [PATCH 05/13] thermal/drivers/hisi: Fix multiple alarm interrupts firing Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-08-30 11:00 +0200
    Re: [PATCH 05/13] thermal/drivers/hisi: Fix multiple alarm  interrupts firing Leo Yan <leo.yan@linaro.org> - 2017-09-01 16:50 +0200
  Re: [PATCH 01/13] thermal/drivers/hisi: Fix missing interrupt  enablement Leo Yan <leo.yan@linaro.org> - 2017-09-01 10:40 +0200

csiph-web