1. 19 4月, 2016 10 次提交
  2. 28 3月, 2016 1 次提交
    • G
      hwmon: (max1111) Return -ENODEV from max1111_read_channel if not instantiated · 3c2e2266
      Guenter Roeck 提交于
      arm:pxa_defconfig can result in the following crash if the max1111 driver
      is not instantiated.
      
      Unhandled fault: page domain fault (0x01b) at 0x00000000
      pgd = c0004000
      [00000000] *pgd=00000000
      Internal error: : 1b [#1] PREEMPT ARM
      Modules linked in:
      CPU: 0 PID: 300 Comm: kworker/0:1 Not tainted 4.5.0-01301-g1701f680 #10
      Hardware name: SHARP Akita
      Workqueue: events sharpsl_charge_toggle
      task: c390a000 ti: c391e000 task.ti: c391e000
      PC is at max1111_read_channel+0x20/0x30
      LR is at sharpsl_pm_pxa_read_max1111+0x2c/0x3c
      pc : [<c03aaab0>]    lr : [<c0024b50>]    psr: 20000013
      ...
      [<c03aaab0>] (max1111_read_channel) from [<c0024b50>]
      					(sharpsl_pm_pxa_read_max1111+0x2c/0x3c)
      [<c0024b50>] (sharpsl_pm_pxa_read_max1111) from [<c00262e0>]
      					(spitzpm_read_devdata+0x5c/0xc4)
      [<c00262e0>] (spitzpm_read_devdata) from [<c0024094>]
      					(sharpsl_check_battery_temp+0x78/0x110)
      [<c0024094>] (sharpsl_check_battery_temp) from [<c0024f9c>]
      					(sharpsl_charge_toggle+0x48/0x110)
      [<c0024f9c>] (sharpsl_charge_toggle) from [<c004429c>]
      					(process_one_work+0x14c/0x48c)
      [<c004429c>] (process_one_work) from [<c0044618>] (worker_thread+0x3c/0x5d4)
      [<c0044618>] (worker_thread) from [<c004a238>] (kthread+0xd0/0xec)
      [<c004a238>] (kthread) from [<c000a670>] (ret_from_fork+0x14/0x24)
      
      This can occur because the SPI controller driver (SPI_PXA2XX) is built as
      module and thus not necessarily loaded. While building SPI_PXA2XX into the
      kernel would make the problem disappear, it appears prudent to ensure that
      the driver is instantiated before accessing its data structures.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      3c2e2266
  3. 09 3月, 2016 1 次提交
  4. 05 3月, 2016 5 次提交
  5. 20 2月, 2016 1 次提交
    • N
      hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook · 000e0949
      Nishanth Menon 提交于
      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: b5cf88e4 ("(gpio-fan): Add thermal control hooks")
      Reported-by: NTony Lindgren <tony@atomide.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      000e0949
  6. 19 2月, 2016 1 次提交
  7. 16 2月, 2016 2 次提交
  8. 28 1月, 2016 1 次提交
  9. 25 1月, 2016 1 次提交
  10. 09 1月, 2016 1 次提交
  11. 05 1月, 2016 1 次提交
  12. 30 12月, 2015 1 次提交
  13. 19 12月, 2015 5 次提交
  14. 11 12月, 2015 1 次提交
    • N
      hwmon: (tmp102) Force wait for conversion time for the first valid data · 00917b5c
      Nishanth Menon 提交于
      TMP102 works based on conversions done periodically. However, as per
      the TMP102 data sheet[1] the first conversion is triggered immediately
      after we program the configuration register. The temperature data
      registers do not reflect proper data until the first conversion is
      complete (in our case HZ/4).
      
      The driver currently sets the last_update to be jiffies - HZ, just
      after the configuration is complete. When TMP102 driver registers
      with the thermal framework, it immediately tries to read the sensor
      temperature data. This takes place even before the conversion on the
      TMP102 is complete and results in an invalid temperature read.
      
      Depending on the value read, this may cause thermal framework to
      assume that a critical temperature event has occurred and attempts to
      shutdown the system.
      
      Instead of causing an invalid mid-conversion value to be read
      erroneously, we mark the last_update to be in-line with the current
      jiffies. This allows the tmp102_update_device function to skip update
      until the required conversion time is complete. Further, we ensure to
      return -EAGAIN result instead of returning spurious temperature (such
      as 0C) values to the caller to prevent any wrong decisions made with
      such values. NOTE: this allows the read functions not to be blocking
      and allows the callers to make the decision if they would like to
      block or try again later. At least the current user(thermal) seems to
      handle this by retrying later.
      
      A simpler alternative approach could be to sleep in the probe for the
      duration required, but that will result in latency that is undesirable
      and delay boot sequence un-necessarily.
      
      [1] http://www.ti.com/lit/ds/symlink/tmp102.pdf
      
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Reported-by: NAparna Balasubramanian <aparnab@ti.com>
      Reported-by: NElvita Lobo <elvita@ti.com>
      Reported-by: NYan Liu <yan-liu@ti.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      00917b5c
  15. 17 11月, 2015 2 次提交
    • S
      hwmon: (scpi) skip unsupported sensors properly · cef03d7e
      Sudeep Holla 提交于
      Currently it's assumed that firmware exports only the class of sensors
      supported by the driver. However with newer firmware or SCPI protocol
      revision, support for newer classes of sensors can be present.
      
      The driver fails to probe with the following warning if an unsupported
      class of sensor is encountered in the firmware.
      
      sysfs: cannot create duplicate filename
      	'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'
      ------------[ cut here ]------------
      WARNING: at fs/sysfs/dir.c:31
      Modules linked in:
      
      CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
      Hardware name: ARM Juno development board (r0) (DT)
      Workqueue: deferwq deferred_probe_work_func
      PC is at sysfs_warn_dup+0x54/0x78
      LR is at sysfs_warn_dup+0x54/0x78
      
      This patch fixes the above issue by skipping through the unsupported
      class of SCPI sensors.
      
      Fixes: 68acc77a ("hwmon: Support thermal zones registration for SCP temperature sensors")
      Fixes: ea98b29a ("hwmon: Support sensors exported via ARM SCP interface")
      Cc: Guenter Roeck <linux@roeck-us.net>
      Reviewed-by: NPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      cef03d7e
    • A
      hwmon: (scpi) add thermal-of dependency · d42d5b6f
      Arnd Bergmann 提交于
      The newly added scpi thermal support is broken when the scpi driver
      is built-in but the thermal driver is a loadable module:
      
      drivers/built-in.o: In function `scpi_hwmon_probe':
      (.text+0x444d70): undefined reference to `thermal_zone_of_sensor_unregister'
      (.text+0x444d94): undefined reference to `thermal_zone_of_sensor_register'
      drivers/built-in.o: In function `scpi_hwmon_remove':
      (text+0x444e6c): undefined reference to `thermal_zone_of_sensor_unregister'
      
      This uses the same Kconfig trick that we have in a couple of other
      drivers already to ensure we can only select the driver in valid
      configurations when either THERMAL_OF is disabled, or when with a
      dependency on CONFIG_THERMAL that can force SCPI to be a loadable
      module in the case I was hitting.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 68acc77a ("hwmon: Support thermal zones registration for SCP temperature sensors")
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      d42d5b6f
  16. 16 11月, 2015 2 次提交
    • S
      hwmon : (applesmc) Fix uninitialized variables warnings · 5e0a0ee4
      Shuah Khan 提交于
      Fix the following "maybe used uninitialized" warnings by
      initializing the variables to keep the compiler quiet.
      There is no "used uninitialized" in this case.
      
        CC [M]  drivers/hwmon/applesmc.o
      drivers/hwmon/applesmc.c: In function ‘applesmc_init_smcreg’:
      drivers/hwmon/applesmc.c:595:43: warning: ‘right_light_sensor’
      may be used uninitialized in this function [-Wmaybe-uninitialized]
        s->num_light_sensors = left_light_sensor + right_light_sensor;
                                                 ^
      drivers/hwmon/applesmc.c:540:26: note: ‘right_light_sensor’ was
      declared here
        bool left_light_sensor, right_light_sensor;
                                ^
      drivers/hwmon/applesmc.c:595:43: warning: ‘left_light_sensor’ may
      be used uninitialized in this function [-Wmaybe-uninitialized]
        s->num_light_sensors = left_light_sensor + right_light_sensor;
                                                 ^
      drivers/hwmon/applesmc.c:540:7: note: ‘left_light_sensor’ was
      declared here
        bool left_light_sensor, right_light_sensor;
             ^
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      5e0a0ee4
    • L
      hwmon: (ina2xx) Fix build issue by selecting REGMAP_I2C · 92e11f00
      Li Yang 提交于
      Since a0de56c8 ("hwmon: (ina2xx) convert driver to using regmap")
      the driver requires REGMAP_I2C to build.  Select it by default
      in Kconfig.
      Reported-by: NGuo Chunrong <B40290@freescale.com>
      Cc: Marc Titinger <mtitinger@baylibre.com>
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Fixes: a0de56c8 ("hwmon: (ina2xx) convert driver to using regmap")
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      92e11f00
  17. 09 11月, 2015 1 次提交
  18. 01 11月, 2015 3 次提交