Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Wu Hao
On Tue, May 07, 2019 at 11:30:57AM -0700, Moritz Fischer wrote: > Please for next round: > > +CC linux-hwmon, Guenter etc ... Thanks a lot for the kindly reminder. I will make sure linux-hwmon, Guenter cced for the next version patchset. Thanks Hao > > On Mon, Apr 29, 2019 at 04:55:48PM +0800

Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Wu Hao
On Tue, May 07, 2019 at 11:35:36AM -0700, Guenter Roeck wrote: > On Tue, May 07, 2019 at 01:20:52PM -0500, Alan Tull wrote: > > On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: > > > > + The hwmon people > > > > > > > > This patch adds support to thermal management private feature for DFL > > > FPG

Re: [PATCH v3 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
On 5/7/19 4:09 PM, Florian Fainelli wrote: If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli --- drivers/hwmon/scmi-hwmon.c | 43

Re: [PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Guenter Roeck
On 5/7/19 2:49 PM, Florian Fainelli wrote: On 5/7/19 2:06 PM, Guenter Roeck wrote: On Tue, May 07, 2019 at 12:35:02PM -0700, Florian Fainelli wrote: Provide a simple macro that can return the value of 10 raised to a positive integer. We are going to use this in order to scale units from firmwar

[PATCH v3 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Florian Fainelli
If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli --- drivers/hwmon/scmi-hwmon.c | 43 +- 1 fil

[PATCH v3 1/2] firmware: arm_scmi: Fetch and store sensor scale

2019-05-07 Thread Florian Fainelli
In preparation for dealing with scales within the SCMI HWMON driver, fetch and store the sensor unit scale into the scmi_sensor_info structure. In order to simplify computations for upper layer, take care of sign extending the scale to a full 8-bit signed value. Signed-off-by: Florian Fainelli --

[PATCH v3 0/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Florian Fainelli
Hi Sudeep, Guenter, This patch series adds support for scaling SCMI sensor values read from firmware. Sudeep, let me know if you think we should be treating scale == 0 as a special value to preserve some firmware compatibility (not that this would be desired). Changes in v3: - add a local __pow1

Re: [PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Florian Fainelli
On 5/7/19 2:06 PM, Guenter Roeck wrote: > On Tue, May 07, 2019 at 12:35:02PM -0700, Florian Fainelli wrote: >> Provide a simple macro that can return the value of 10 raised to a >> positive integer. We are going to use this in order to scale units from >> firmware to HWMON. >> >> Signed-off-by: Flo

Re: [PATCH v2 3/3] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 12:35:04PM -0700, Florian Fainelli wrote: > If the SCMI firmware implementation is reporting values in a scale that > is different from the HWMON units, we need to scale up or down the value > according to how far appart they are. > > Signed-off-by: Florian Fainelli > ---

Re: [PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 12:35:02PM -0700, Florian Fainelli wrote: > Provide a simple macro that can return the value of 10 raised to a > positive integer. We are going to use this in order to scale units from > firmware to HWMON. > > Signed-off-by: Florian Fainelli > --- > include/linux/kernel.h

[PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Florian Fainelli
Provide a simple macro that can return the value of 10 raised to a positive integer. We are going to use this in order to scale units from firmware to HWMON. Signed-off-by: Florian Fainelli --- include/linux/kernel.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/

[PATCH v2 2/3] firmware: arm_scmi: Fetch and store sensor scale

2019-05-07 Thread Florian Fainelli
In preparation for dealing with scales within the SCMI HWMON driver, fetch and store the sensor unit scale into the scmi_sensor_info structure. In order to simplify computations for upper layer, take care of sign extending the scale to a full 8-bit signed value. Signed-off-by: Florian Fainelli --

[PATCH v2 3/3] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Florian Fainelli
If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli --- drivers/hwmon/scmi-hwmon.c | 30 +- 1 file change

[PATCH v2 0/3] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Florian Fainelli
Hi Sudeep, Guenter, This patch series adds support for scaling SCMI sensor values read from firmware. Sudeep, let me know if you think we should be treating scale == 0 as a special value to preserve some firmware compatibility (not that this would be desired). Changes in v2: - added a helper fun

[PATCH] hwmon (occ): Switch power average to between poll responses

2019-05-07 Thread Eddie James
The average power reported in the hwmon OCC driver is not useful because the time it represents is too short. Instead, store the previous power accumulator reported by the OCC and average it with the latest accumulator to obtain an average between poll responses. This does operate under the assumpt

Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 01:20:52PM -0500, Alan Tull wrote: > On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: > > + The hwmon people > > > > > This patch adds support to thermal management private feature for DFL > > FPGA Management Engine (FME). This private feature driver registers > > a hwmon fo

Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Moritz Fischer
Please for next round: +CC linux-hwmon, Guenter etc ... On Mon, Apr 29, 2019 at 04:55:48PM +0800, Wu Hao wrote: > This patch adds support to thermal management private feature for DFL > FPGA Management Engine (FME). This private feature driver registers > a hwmon for thermal/temperature monitorin

Re: [PATCH v2 16/18] fpga: dfl: fme: add power management support

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 01:23:33PM -0500, Alan Tull wrote: > On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: > > + hwmon folks > > > > > This patch adds support for power management private feature under > > FPGA Management Engine (FME). This private feature driver registers > > a hwmon for power

Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Alan Tull
On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: + The hwmon people > > This patch adds support to thermal management private feature for DFL > FPGA Management Engine (FME). This private feature driver registers > a hwmon for thermal/temperature monitoring (hwmon temp1_input). > If hardware automat

Re: [PATCH v2 16/18] fpga: dfl: fme: add power management support

2019-05-07 Thread Alan Tull
On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: + hwmon folks > > This patch adds support for power management private feature under > FPGA Management Engine (FME). This private feature driver registers > a hwmon for power (power1_input), thresholds information, e.g. > (power1_cap / crit) and also

Re: [PATCH 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
Hi Florian, On Tue, May 07, 2019 at 10:44:00AM -0700, Florian Fainelli wrote: > On 5/7/19 6:55 AM, Guenter Roeck wrote: > > Hi Florian, > > > > On 5/6/19 3:41 PM, Florian Fainelli wrote: > >> If the SCMI firmware implementation is reporting values in a scale that > >> is different from the HWMON

Re: [PATCH 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Florian Fainelli
On 5/7/19 6:55 AM, Guenter Roeck wrote: > Hi Florian, > > On 5/6/19 3:41 PM, Florian Fainelli wrote: >> If the SCMI firmware implementation is reporting values in a scale that >> is different from the HWMON units, we need to scale up or down the value >> according to how far appart they are. >> >>

Re: [PATCH 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
Hi Florian, On 5/6/19 3:41 PM, Florian Fainelli wrote: If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli --- drivers/hwmon/scmi

Re: [PATCH 1/2] firmware: arm_scmi: Fetch and store sensor scale

2019-05-07 Thread Guenter Roeck
On 5/6/19 3:41 PM, Florian Fainelli wrote: In preparation for dealing with scales within the SCMI HWMON driver, fetch and store the sensor unit scale into the scmi_sensor_info structure. Signed-off-by: Florian Fainelli --- drivers/firmware/arm_scmi/sensors.c | 7 ++- include/linux/scmi_p