Skip to contentSkip to conversation

hwmon (occ): Fix extended status bits

PATCH Applied Lei YU 4 participants 5 messages Apr 15, 2019 – Apr 16, 2019 Hardware monitoring

lore
Share & tools
lore

Lei YU

author
#0 lore raw

PATCH 1/1 hwmon (occ): Fix extended status bits

The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.

---
 drivers/hwmon/occ/sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/occ/sysfs.c +4 -4
index fe3d15e..a71ca94 100644
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
 		val = !!(header->status & OCC_STAT_ACTIVE);
 		break;
 	case 2:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
 		break;
 	case 3:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
 		break;
 	case 4:
-		val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+		val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
 		break;
 	case 5:
-		val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+		val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
 		break;
 	case 6:
 		val = header->occ_state;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 5 lines · Lei YU

The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.

Looks ok to me, but can I get a confirmation from someone at IBM ?

Thanks,
Guenter

Quoted 29 lines
---
 drivers/hwmon/occ/sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/occ/sysfs.c +4 -4
index fe3d15e..a71ca94 100644
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
 		val = !!(header->status & OCC_STAT_ACTIVE);
 		break;
 	case 2:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
 		break;
 	case 3:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
 		break;
 	case 4:
-		val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+		val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
 		break;
 	case 5:
-		val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+		val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
 		break;
 	case 6:
 		val = header->occ_state;
Reviewed-by
#2 lore raw
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Lei YU

The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.

Looks ok to me, but can I get a confirmation from someone at IBM ?

Yes. Thanks Lei.

Quoted 33 lines

Thanks,
Guenter

Quoted 29 lines
---
  drivers/hwmon/occ/sysfs.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/occ/sysfs.c +4 -4
index fe3d15e..a71ca94 100644
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
  		val = !!(header->status & OCC_STAT_ACTIVE);
  		break;
  	case 2:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
  		break;
  	case 3:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
  		break;
  	case 4:
-		val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+		val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
  		break;
  	case 5:
-		val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+		val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
  		break;
  	case 6:
  		val = header->occ_state;
maintainer Applied
#3 lore raw
In reply to Lei YU
Quoted 6 lines · Lei YU

The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.

Applied.

Thanks,
Guenter

Quoted 29 lines
---
 drivers/hwmon/occ/sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/occ/sysfs.c +4 -4
index fe3d15e..a71ca94 100644
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
 		val = !!(header->status & OCC_STAT_ACTIVE);
 		break;
 	case 2:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
 		break;
 	case 3:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
 		break;
 	case 4:
-		val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+		val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
 		break;
 	case 5:
-		val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+		val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
 		break;
 	case 6:
 		val = header->occ_state;
#4 lore raw
Quoted 9 lines · Guenter Roeck
Quoted 6 lines · Lei YU

The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.

Applied.

I've also applied this to dev-5.0.

Cheers,

Andrew

Quoted 34 lines

Thanks,
Guenter

Quoted 29 lines
---
 drivers/hwmon/occ/sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/occ/sysfs.c +4 -4
index fe3d15e..a71ca94 100644
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
 		val = !!(header->status & OCC_STAT_ACTIVE);
 		break;
 	case 2:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
 		break;
 	case 3:
-		val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+		val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
 		break;
 	case 4:
-		val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+		val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
 		break;
 	case 5:
-		val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+		val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
 		break;
 	case 6:
 		val = header->occ_state;