Skip to contentSkip to conversation

thermal: exynos: fix masking value for exynos7 temp_error

PATCH In review Sang Min Kim 2 participants 2 messages Apr 1, 2022 – Apr 14, 2022 1 message not in the archive Arm Samsung Exynos

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v3 1/1 thermal: exynos: fix masking value for exynos7 temp_error

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()")

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

#2 lore raw

Hi,

I'm unable to apply your patch, whatever the method:

git b4 20220401002753epcms2p6cd5882f4909247461434f42e933591af@epcms2p6

Applying: thermal: exynos: fix masking value for exynos7 temp_error
error: unrecognized input
Patch failed at 0001 thermal: exynos: fix masking value for exynos7 temp_error
hint: Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Quoted 47 lines · Sang Min Kim

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()")

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

Signature · 10 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel