All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon (occ): Fix extended status bits
@ 2019-04-15 10:37 Lei YU
  2019-04-15 20:28 ` Guenter Roeck
  2019-04-16  0:20 ` Guenter Roeck
  0 siblings, 2 replies; 5+ messages in thread
From: Lei YU @ 2019-04-15 10:37 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eddie James, Lei YU, linux-hwmon,
	linux-kernel
  Cc: Joel Stanley, Andrew Jeffery

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.

Signed-off-by: Lei YU <mine260309@gmail.com>
---
 drivers/hwmon/occ/sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
index fe3d15e..a71ca94 100644
--- a/drivers/hwmon/occ/sysfs.c
+++ b/drivers/hwmon/occ/sysfs.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] hwmon (occ): Fix extended status bits
  2019-04-15 10:37 [PATCH] hwmon (occ): Fix extended status bits Lei YU
@ 2019-04-15 20:28 ` Guenter Roeck
  2019-04-15 22:17   ` Eddie James
  2019-04-16  0:20 ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2019-04-15 20:28 UTC (permalink / raw)
  To: Lei YU
  Cc: Jean Delvare, Eddie James, linux-hwmon, linux-kernel,
	Joel Stanley, Andrew Jeffery

On Mon, Apr 15, 2019 at 06:37:20PM +0800, Lei YU wrote:
> 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.
> 
> Signed-off-by: Lei YU <mine260309@gmail.com>

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

Thanks,
Guenter

> ---
>  drivers/hwmon/occ/sysfs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
> index fe3d15e..a71ca94 100644
> --- a/drivers/hwmon/occ/sysfs.c
> +++ b/drivers/hwmon/occ/sysfs.c
> @@ -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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hwmon (occ): Fix extended status bits
  2019-04-15 20:28 ` Guenter Roeck
@ 2019-04-15 22:17   ` Eddie James
  0 siblings, 0 replies; 5+ messages in thread
From: Eddie James @ 2019-04-15 22:17 UTC (permalink / raw)
  To: Guenter Roeck, Lei YU
  Cc: Jean Delvare, linux-hwmon, linux-kernel, Joel Stanley, Andrew Jeffery


On 4/15/19 3:28 PM, Guenter Roeck wrote:
> On Mon, Apr 15, 2019 at 06:37:20PM +0800, Lei YU wrote:
>> 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.
>>
>> Signed-off-by: Lei YU <mine260309@gmail.com>
> Looks ok to me, but can I get a confirmation from someone at IBM ?


Yes. Thanks Lei.


Reviewed-by: Eddie James <eajames@linux.ibm.com>


>
> Thanks,
> Guenter
>
>> ---
>>   drivers/hwmon/occ/sysfs.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
>> index fe3d15e..a71ca94 100644
>> --- a/drivers/hwmon/occ/sysfs.c
>> +++ b/drivers/hwmon/occ/sysfs.c
>> @@ -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;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hwmon (occ): Fix extended status bits
  2019-04-15 10:37 [PATCH] hwmon (occ): Fix extended status bits Lei YU
  2019-04-15 20:28 ` Guenter Roeck
@ 2019-04-16  0:20 ` Guenter Roeck
  2019-04-16  7:47   ` Andrew Jeffery
  1 sibling, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2019-04-16  0:20 UTC (permalink / raw)
  To: Lei YU
  Cc: Jean Delvare, Eddie James, linux-hwmon, linux-kernel,
	Joel Stanley, Andrew Jeffery

On Mon, Apr 15, 2019 at 06:37:20PM +0800, Lei YU wrote:
> 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.
> 
> Signed-off-by: Lei YU <mine260309@gmail.com>
> Reviewed-by: Eddie James <eajames@linux.ibm.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/occ/sysfs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
> index fe3d15e..a71ca94 100644
> --- a/drivers/hwmon/occ/sysfs.c
> +++ b/drivers/hwmon/occ/sysfs.c
> @@ -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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hwmon (occ): Fix extended status bits
  2019-04-16  0:20 ` Guenter Roeck
@ 2019-04-16  7:47   ` Andrew Jeffery
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Jeffery @ 2019-04-16  7:47 UTC (permalink / raw)
  To: Mine, openbmc; +Cc: Eddie James, Joel Stanley



On Tue, 16 Apr 2019, at 09:50, Guenter Roeck wrote:
> On Mon, Apr 15, 2019 at 06:37:20PM +0800, Lei YU wrote:
> > 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.
> > 
> > Signed-off-by: Lei YU <mine260309@gmail.com>
> > Reviewed-by: Eddie James <eajames@linux.ibm.com>
> 
> Applied.

I've also applied this to dev-5.0.

Cheers,

Andrew

> 
> Thanks,
> Guenter
> 
> > ---
> >  drivers/hwmon/occ/sysfs.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
> > index fe3d15e..a71ca94 100644
> > --- a/drivers/hwmon/occ/sysfs.c
> > +++ b/drivers/hwmon/occ/sysfs.c
> > @@ -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;
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-16  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 10:37 [PATCH] hwmon (occ): Fix extended status bits Lei YU
2019-04-15 20:28 ` Guenter Roeck
2019-04-15 22:17   ` Eddie James
2019-04-16  0:20 ` Guenter Roeck
2019-04-16  7:47   ` Andrew Jeffery

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.