[PATCH linux dev-4.10 2/2] drivers: hwmon: occ: Add sysfs_notify to throttling attributes

Andrew Jeffery andrew at aj.id.au
Fri Oct 13 17:11:09 AEDT 2017


On Fri, 2017-10-06 at 15:43 -0500, Eddie James wrote:
> From: "Edward A. James" <eajames at us.ibm.com>
> 
> Need to alert user space when we change throttling state.
> 
> Signed-off-by: Edward A. James <eajames at us.ibm.com>
> ---
>  drivers/hwmon/occ/common.c | 25 +++++++++++++++++++++----
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
> index e8579b6..242ba40 100644
> --- a/drivers/hwmon/occ/common.c
> +++ b/drivers/hwmon/occ/common.c
> @@ -182,6 +182,7 @@ int occ_poll(struct occ *occ)
>  	u16 checksum = occ->poll_cmd_data + 1;
>  	u8 cmd[8];
>  	u8 occs_present = header->occs_present;
> +	u8 ext_status = header->ext_status;
>  
>  	cmd[0] = 0;
>  	cmd[1] = 0;
> @@ -206,10 +207,26 @@ int occ_poll(struct occ *occ)
>  	} else
>  		occ->last_safe = 0;
>  
> -	if (occs_present != header->occs_present && occ->hwmon &&
> -	    (header->status & OCC_STAT_MASTER)) {
> -		sysfs_notify(&occ->bus_dev->kobj, NULL,
> -			     occ->status_attrs[7].dev_attr.attr.name);
> +	if (occ->hwmon) {
> +		if (occs_present != header->occs_present &&
> +		    (header->status & OCC_STAT_MASTER))
> +			sysfs_notify(&occ->bus_dev->kobj, NULL,
> +				     occ->status_attrs[7].dev_attr.attr.name);

Why are we now protecting this under the occ->hwmon condition? Shouldn't we
have done that in the previous patch which introduced the notify for
occs_present?

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20171013/b1dfa467/attachment.sig>


More information about the openbmc mailing list