Nishanth Menon 000e094914 hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook
Thermal hook gpio_fan_get_cur_state is only interested in knowing
the current speed index that was setup in the system, this is
already available as part of fan_data->speed_index which is always
set by set_fan_speed. Using get_fan_speed_index is useful when we
have no idea about the fan speed configuration (for example during
fan_ctrl_init).

When thermal framework invokes
gpio_fan_get_cur_state=>get_fan_speed_index via gpio_fan_get_cur_state
especially in a polled configuration for thermal governor, we
basically hog the i2c interface to the extent that other functions
fail to get any traffic out :(.

Instead, just provide the last state set in the driver - since the gpio
fan driver is responsible for the fan state immaterial of override, the
fan_data->speed_index should accurately reflect the state.

Fixes: b5cf88e46bad ("(gpio-fan): Add thermal control hooks")
Reported-by: Tony Lindgren <tony@atomide.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-02-19 17:14:25 -08:00
..
2014-01-29 20:40:08 +01:00
2015-05-31 22:58:36 -07:00
2014-08-04 07:01:35 -07:00
2014-12-14 16:10:09 -08:00
2015-08-09 13:44:27 -07:00
2015-12-18 08:20:59 -08:00
2014-08-04 07:01:36 -07:00
2015-10-14 07:57:14 -07:00
2013-03-18 21:19:49 +01:00
2014-08-05 19:44:42 -07:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2015-12-18 08:20:59 -08:00
2014-01-29 20:40:08 +01:00
2014-01-29 20:40:08 +01:00
2015-08-10 23:00:10 -07:00
2015-06-21 22:54:53 -07:00