mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sang Min Kim <hypmean.kim@samsung.com>
To: "bzolnier@gmail.com" <bzolnier@gmail.com>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"amitk@kernel.org" <amitk@kernel.org>,
	"rui.zhang@intel.com" <rui.zhang@intel.com>,
	ALIM AKHTAR <alim.akhtar@samsung.com>,
	"edubezval@gmail.com" <edubezval@gmail.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org" 
	<linux-samsung-soc@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v3] thermal: exynos: fix masking value for exynos7 temp_error
Date: Fri, 01 Apr 2022 09:27:53 +0900	[thread overview]
Message-ID: <20220401002753epcms2p6cd5882f4909247461434f42e933591af@epcms2p6> (raw)
In-Reply-To: <20220401002153.62648-1-hypmean.kim@samsung.com>

Modify mask value for the temp_error in the sanitize_temp_error() function.
 
sanitize_temp_error masks temp_error2 with EXYNOS_TMU_TEMP_MASK(0xff) value
even in the case of EXYNOS7. In addition, when entering the if statement,
both temp_error1 and 2 are masked with EXYNOS_TMU_TEMP_MASK(0xff).
By modifying to use the previously declared local variable tmu_temp_mask,
the mask value suitable for the SOC can be applied.
 
Fixes: aef27b658b43 ("thermal: exynos: use sanitize_temp_error() in exynos7_tmu_initialize()")
Signed-off-by: sangmin kim <hypmean.kim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 V2 -> V3: Modify the location of fixes tag and add reviewed tag
 V1 -> V2: Add fixes tag
 
 drivers/thermal/samsung/exynos_tmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
 
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index f4ab4c5b4b62..08c63fe5566e 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -243,17 +243,17 @@ static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info)
 
         data->temp_error1 = trim_info & tmu_temp_mask;
         data->temp_error2 = ((trim_info >> EXYNOS_TRIMINFO_85_SHIFT) &
-                                EXYNOS_TMU_TEMP_MASK);
+                                tmu_temp_mask);
 
         if (!data->temp_error1 ||
             (data->min_efuse_value > data->temp_error1) ||
             (data->temp_error1 > data->max_efuse_value))
-                data->temp_error1 = data->efuse_value & EXYNOS_TMU_TEMP_MASK;
+                data->temp_error1 = data->efuse_value & tmu_temp_mask;
 
         if (!data->temp_error2)
                 data->temp_error2 =
                         (data->efuse_value >> EXYNOS_TRIMINFO_85_SHIFT) &
-                        EXYNOS_TMU_TEMP_MASK;
+                        tmu_temp_mask;
 }
 
 static int exynos_tmu_initialize(struct platform_device *pdev)
--
2.9.5
 
 

       reply	other threads:[~2022-04-01  0:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220401002153.62648-1-hypmean.kim@samsung.com>
     [not found] ` <CGME20220401002131epcas2p320f8513a9bd1413af0ace6c20f2caba6@epcms2p6>
2022-04-01  0:27   ` Sang Min Kim [this message]
2022-04-14  7:42     ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401002753epcms2p6cd5882f4909247461434f42e933591af@epcms2p6 \
    --to=hypmean.kim@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=amitk@kernel.org \
    --cc=bzolnier@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®