Skip to contentSkip to conversation

thermal: tegra_soctherm: fix sign bit of temperature

PATCH Superseded Wei Ni 4 participants 10 messages Feb 29, 2016 – Mar 7, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

PATCH 1/1 thermal: tegra_soctherm: fix sign bit of temperature

The sign bit of temperature readback is bit 0, not bit 1. Change to BIT(0) to fix it.

---
 drivers/thermal/tegra_soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra_soctherm.c +1 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
+#define READBACK_NEGATE				BIT(0)
 
 #define FUSE_TSENSOR8_CALIB			0x180
 #define FUSE_SPARE_REALIGNMENT_REG_0		0x1fc
Signature · 1 line
1.9.1
author
#1 lore raw

Hi, Rui & Thierry & Matt
Could you please take a look on this patch.
It's a bug on the temperature's sign bit, it can't show the negative temperature, although it will not cause problems for now.

Thanks.
Wei.

Quoted 22 lines · Wei Ni

The sign bit of temperature readback is bit 0, not bit 1. Change to BIT(0) to fix it.

---
 drivers/thermal/tegra_soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra_soctherm.c +1 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
+#define READBACK_NEGATE				BIT(0)
 
 #define FUSE_TSENSOR8_CALIB			0x180
 #define FUSE_SPARE_REALIGNMENT_REG_0		0x1fc
#2 lore raw
Quoted 10 lines · Wei Ni

drivers/thermal/tegra_soctherm.c line 60

Quoted 10 lines
drivers/thermal/tegra_soctherm.c +1 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
+#define READBACK_NEGATE				BIT(0)

I confirm that this change is technically correct. It fixes a bug.

author
#3 lore raw

Hi, Rui and Thierry
Could you please take a look at this patch?

Thanks.
Wei.

Quoted 14 lines · Matt Longnecker
Quoted 10 lines · Wei Ni

drivers/thermal/tegra_soctherm.c line 60

Quoted 10 lines
drivers/thermal/tegra_soctherm.c +1 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK            0xff00
 #define READBACK_VALUE_SHIFT            8
 #define READBACK_ADD_HALF            BIT(7)
-#define READBACK_NEGATE                BIT(1)
+#define READBACK_NEGATE                BIT(0)

I confirm that this change is technically correct. It fixes a bug.

#7 lore raw
In reply to Matt Longnecker
Quoted 14 lines · Matt Longnecker
Quoted 10 lines · Wei Ni

drivers/thermal/tegra_soctherm.c line 60

Quoted 10 lines
drivers/thermal/tegra_soctherm.c +1 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
+#define READBACK_NEGATE				BIT(0)

I confirm that this change is technically correct. It fixes a bug.

That usually translates to a Reviewed-by: tag. =)

Thierry

#8 lore raw
In reply to Wei Ni
Quoted 13 lines · Wei Ni

The sign bit of temperature readback is bit 0, not bit 1. Change to BIT(0) to fix it.

---
 drivers/thermal/tegra_soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra_soctherm.c +0 -0
index 74ea5765938b..136975220c92 100644

drivers/thermal/tegra_soctherm.c line 60

Quoted 5 lines
drivers/thermal/tegra_soctherm.c +1 -1
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
+#define READBACK_NEGATE				BIT(0)

I haven't found this documented anywhere. The register documentation indicates that the SOC_THERM_TSENSOR_TEMP1 and SOC_THERM_TSENSOR_TEMP2 registers are in some kind of "temp readback format", but I can't find any specification of that format. Can you point me at the source for this information and file an internal bug report so that we can get the documentation updated?

Thierry

author
#9 lore raw
Quoted 20 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 17 lines · Wei Ni

The sign bit of temperature readback is bit 0, not bit 1. Change to BIT(0) to fix it.

---
 drivers/thermal/tegra_soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/tegra_soctherm.c +0 -1
index 74ea5765938b..136975220c92 100644
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK			0xff00
 #define READBACK_VALUE_SHIFT			8
 #define READBACK_ADD_HALF			BIT(7)
-#define READBACK_NEGATE				BIT(1)
Quoted 8 lines

drivers/thermal/tegra_soctherm.c line 60

Quoted 1 line
drivers/thermal/tegra_soctherm.c +1 -0
+#define READBACK_NEGATE				BIT(0)

I haven't found this documented anywhere. The register documentation indicates that the SOC_THERM_TSENSOR_TEMP1 and SOC_THERM_TSENSOR_TEMP2 registers are in some kind of "temp readback format", but I can't find any specification of that format. Can you point me at the source for this information and file an internal bug report so that we can get the documentation updated?

Sure, I will do it.
Thanks for your comment.

Quoted 6 lines

Thierry

* Unknown Key
* 0x7F3EB3A1

reviewer
#4 lore raw
In reply to Wei Ni

For the soc thermal driver changes, you'd better cc Eduardo at the same time so that he can include this in his soc-thermal pull request. Surely I can queue this for 4.6 if Eduardo miss this.

Thanks,
rui

Quoted 32 lines

-----Original Message-----
From: Wei Ni [mailto:[email protected]]
Sent: Monday, March 07, 2016 4:26 PM
To: [email protected]; Zhang, Rui <[email protected]>; [email protected]
Cc: Matt Longnecker <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] thermal: tegra_soctherm: fix sign bit of temperature
Importance: High

Hi, Rui and Thierry
Could you please take a look at this patch?

Thanks.
Wei.

Quoted 4 lines · Matt Longnecker
Quoted 1 line · Wei Ni

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/thermal/tegra_soctherm.c

Quoted 10 lines
Quoted 9 lines

drivers/thermal/tegra_soctherm.c line 60

Quoted 9 lines

index 74ea5765938b..136975220c92 100644

drivers/thermal/tegra_soctherm.c +1 -1
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK            0xff00
 #define READBACK_VALUE_SHIFT            8
 #define READBACK_ADD_HALF            BIT(7)
-#define READBACK_NEGATE                BIT(1)
+#define READBACK_NEGATE                BIT(0)

I confirm that this change is technically correct. It fixes a bug.

author Reviewed-by Matt Longnecker
#5 lore raw
Quoted 2 lines · Rui

For the soc thermal driver changes, you'd better cc Eduardo at the same time so that he can include this in his soc-thermal pull request. Surely I can queue this for 4.6 if Eduardo miss this.

Thanks for your help.

BTW, please add:

Or I need to send v2 patch to add it?

Thanks.
Wei.

Quoted 36 lines

Thanks,
rui

Quoted 32 lines

-----Original Message-----
From: Wei Ni [mailto:[email protected]]
Sent: Monday, March 07, 2016 4:26 PM
To: [email protected]; Zhang, Rui <[email protected]>; [email protected]
Cc: Matt Longnecker <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] thermal: tegra_soctherm: fix sign bit of temperature
Importance: High

Hi, Rui and Thierry
Could you please take a look at this patch?

Thanks.
Wei.

Quoted 4 lines · Matt Longnecker
Quoted 1 line · Wei Ni

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/thermal/tegra_soctherm.c

Quoted 10 lines
Quoted 9 lines

drivers/thermal/tegra_soctherm.c line 60

Quoted 9 lines

index 74ea5765938b..136975220c92 100644

drivers/thermal/tegra_soctherm.c +1 -1
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK            0xff00
 #define READBACK_VALUE_SHIFT            8
 #define READBACK_ADD_HALF            BIT(7)
-#define READBACK_NEGATE                BIT(1)
+#define READBACK_NEGATE                BIT(0)

I confirm that this change is technically correct. It fixes a bug.

reviewer
#6 lore raw

Oh, BTW, you need to CC [email protected] as well, so that we can see your patch via patchwork.

Please resend patch V2 to [email protected].

Thanks,
rui

Quoted 65 lines

-----Original Message-----
From: Wei Ni [mailto:[email protected]]
Sent: Monday, March 07, 2016 5:16 PM
To: Zhang, Rui <[email protected]>; [email protected]; [email protected]; Eduardo Valentin <[email protected]>
Cc: Matt Longnecker <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] thermal: tegra_soctherm: fix sign bit of temperature
Importance: High

Quoted 1 line · Rui

For the soc thermal driver changes, you'd better cc Eduardo at the same

time so that he can include this in his soc-thermal pull request.

Quoted 1 line

Surely I can queue this for 4.6 if Eduardo miss this.

Thanks for your help.

BTW, please add:

Or I need to send v2 patch to add it?

Thanks.
Wei.

Quoted 10 lines

Thanks,
rui

Quoted 6 lines

-----Original Message-----
From: Wei Ni [mailto:[email protected]]
Sent: Monday, March 07, 2016 4:26 PM
To: [email protected]; Zhang, Rui <[email protected]>; [email protected]
Cc: Matt Longnecker <[email protected]>;

[email protected];

Quoted 27 lines
Quoted 27 lines

[email protected]; [email protected]
Subject: Re: [PATCH] thermal: tegra_soctherm: fix sign bit of temperature
Importance: High

Hi, Rui and Thierry
Could you please take a look at this patch?

Thanks.
Wei.

Quoted 4 lines · Matt Longnecker
Quoted 1 line · Wei Ni

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/thermal/tegra_soctherm.c

Quoted 10 lines
Quoted 9 lines

drivers/thermal/tegra_soctherm.c line 60

Quoted 9 lines

index 74ea5765938b..136975220c92 100644

drivers/thermal/tegra_soctherm.c +1 -1
@@ -57,7 +57,7 @@
 #define READBACK_VALUE_MASK            0xff00
 #define READBACK_VALUE_SHIFT            8
 #define READBACK_ADD_HALF            BIT(7)
-#define READBACK_NEGATE                BIT(1)
+#define READBACK_NEGATE                BIT(0)

I confirm that this change is technically correct. It fixes a bug.