1. 15 Jun, 2015 1 commit
  2. 13 Jun, 2015 3 commits
  3. 10 Jun, 2015 4 commits
    • Frans Klaver's avatar
      sbs-battery: add option to always register battery · f4ed950a
      Frans Klaver authored
      Commit a22b41a3 ("sbs-battery: Probe should try talking to the
      device") introduced a step in probing the SBS battery, that tries to
      talk to the device before actually registering it, saying:
      
          this driver doesn't actually try talking to the device at probe
          time, so if it's incorrectly configured in the device tree or
          platform data (or if the battery has been removed from the system),
          then probe will succeed and every access will sit there and time
          out. The end result is a possibly laggy system that thinks it has a
          battery but can never read status, which isn't very useful.
      
      Which is of course reasonable. However, it is also very well possible
      for a device to boot up on wall-power and be connected to a battery
      later on. This is a scenario that the driver supported before said patch
      was applied, and even easily achieved by booting up with the battery
      attached and removing it later on. sbs-battery's 'present' sysfs file
      can be used to determine if the device is available or not.
      
      So with automated device detection lacking for now, in some cases it is
      possible that one wants to register a battery, even if none are attached
      at the moment. To facilitate this, add a module parameter that can be
      used to configure forced loading module loading time. If set, the battery
      will always be registered without checking the sanity of the connection.
      Signed-off-by: default avatarFrans Klaver <frans.klaver@xsens.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      f4ed950a
    • Hans de Goede's avatar
      power: Add devm_power_supply_get_by_phandle() helper function · fe27e1df
      Hans de Goede authored
      This commit adds a resource-managed version of the
      power_supply_get_by_phandle() function.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      fe27e1df
    • Krzysztof Kozlowski's avatar
      power_supply: max17042: Add OF support for setting thresholds · a6e6b63e
      Krzysztof Kozlowski authored
      The commit edd4ab05 ("power: max17042_battery: add HEALTH and TEMP_*
      properties support") added support for setting voltage and temperature
      thresholds with platform data. For DeviceTree default of 0 was always
      used.
      
      This caused reporting battery health always as over voltage or
      over heated.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: edd4ab05 ("power: max17042_battery: add HEALTH and TEMP_* properties support")
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      a6e6b63e
    • Krzysztof Kozlowski's avatar
      power_supply: sysfs: Bring back write to writeable properties · 5c6e3a97
      Krzysztof Kozlowski authored
      The fix for NULL pointer exception related to calling uevent for not
      finished probe caused to set all writeable properties as non-writeable.
      This was caused by checking if property is writeable before the initial
      increase of power supply usage counter and in the same time using
      wrapper over property_is_writeable(). The wrapper returns ENODEV if the
      usage counter is still 0.
      
      The call trace looked like:
        device probe:
          power_supply_register()
            use_cnt = 0;
            device_add()
              create sysfs entries
                power_supply_attr_is_visible()
                  power_supply_property_is_writeable()
                    if (use_cnt == 0) return -ENODEV;
            use_cnt++;
      
      Replace the usage of wrapper with direct call to property_is_writeable()
      from driver. This should be safe call during device probe because
      implementations of this callback just return 0/1 for different
      properties and they do not access any of the driver's internal data.
      
      Fixes: 8e59c7f2 ("power_supply: Fix NULL pointer dereference during bq27x00_battery probe")
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      5c6e3a97
  4. 03 Jun, 2015 1 commit
  5. 02 Jun, 2015 2 commits
    • Heiko Stübner's avatar
      power: reset: gpio-restart: increase priority slightly · bcd56fe1
      Heiko Stübner authored
      gpio-restart uses a priority of 128 and currently most soc-level restart
      mechanisms use the same - with some exceptions even using 192.
      But while the soc-level restarts are provided by the soc itself,
      gpio-restarts will most of the time be board-specfic and be used
      when some special board condition makes the soc-level restart
      only a second choice.
      
      The problem at hand manifested itself on the rk3288-veyron devices.
      While the soc-level restart can sucessfully restart all other rockchip
      boards I have, the veyron devices use an external restart mechanism that
      seems to not only reset the soc but also some external needed components.
      
      With both restart handlers having priority 128 in my tests the soc-specific
      variant took precedent in all cases. While it could restart the soc
      sucessfully in all cases, firmware then got an issue when talking to an
      external component, resulting in the device being put into recovery mode.
      
      So, give the board-specific restart handler a slight push and move it
      to priority 129 to make it more important than the generic soc-specific
      restart-handler.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      bcd56fe1
    • Laurentiu Palcu's avatar
      power_supply: bq25890: make chip_id int · 23fa43a2
      Laurentiu Palcu authored
      Smatch static checker correctly detected an impossible condition because
      chip_id was declared as u8, instead of int:
      
      drivers/power/bq25890_charger.c:843 bq25890_probe()
      warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)'
      
      Also, while at it, fix the return value too.
      Signed-off-by: default avatarLaurentiu Palcu <laurentiu.palcu@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      23fa43a2
  6. 30 May, 2015 3 commits
  7. 29 May, 2015 2 commits
  8. 24 May, 2015 1 commit
  9. 23 May, 2015 12 commits
  10. 21 May, 2015 2 commits
    • Krzysztof Kozlowski's avatar
      power_supply: Fix possible NULL pointer dereference on early uevent · 7f1a57fd
      Krzysztof Kozlowski authored
      Don't call the power_supply_changed() from power_supply_register() when
      parent is still probing because it may lead to accessing parent too
      early.
      
      In bq27x00_battery this caused NULL pointer exception because uevent of
      power_supply_changed called back the the get_property() method provided
      by the driver. The get_property() method accessed pointer which should
      be returned by power_supply_register().
      
      Starting from bq27x00_battery_probe():
        di->bat = power_supply_register()
          power_supply_changed()
            kobject_uevent()
              power_supply_uevent()
                power_supply_show_property()
                  power_supply_get_property()
                    bq27x00_battery_get_property()
                      dereference of di->bat which is NULL here
      
      The dereference of di->bat (value returned by power_supply_register())
      is the currently visible problem. However calling back the methods
      provided by driver before ending the probe may lead to accessing other
      driver-related data which is not yet initialized.
      
      The call to power_supply_changed() is postponed till probing ends -
      mutex of parent device is released.
      Reported-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 297d716f ("power_supply: Change ownership from driver to core")
      Tested-By: default avatarDr. H. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      7f1a57fd
    • Krzysztof Kozlowski's avatar
      power_supply: Fix NULL pointer dereference during bq27x00_battery probe · 8e59c7f2
      Krzysztof Kozlowski authored
      Power supply is often registered during probe of a driver. The
      power_supply_register() returns pointer to newly allocated structure as
      return value. However before returning the power_supply_register()
      calls back the get_property() method provided by the driver through
      uevent.
      
      In that time the driver probe is still in progress and driver did not
      assigned pointer to power supply to its local variables. This leads to
      NULL pointer dereference from get_property() function.
      Starting from bq27x00_battery_probe():
        di->bat = power_supply_register()
          device_add()
            kobject_uevent()
              power_supply_uevent()
                power_supply_show_property()
                  power_supply_get_property()
                    bq27x00_battery_get_property()
                      dereference of (di->bat) which is NULL here
      
      The first uevent of power supply (the one coming from device creation)
      should not call back to the driver. To prevent that from happening,
      increment the atomic use counter at the end of power_supply_register().
      This means that power_supply_get_property() will return -ENODEV.
      
      IMPORTANT:
      The patch has impact on this first uevent sent from power supply because
      it will not contain properties from power supply.
      
      The uevent with properties will be sent later after indicating that
      power supply has changed. This also has a race now, but will be fixed in
      other patches.
      Reported-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 297d716f ("power_supply: Change ownership from driver to core")
      Tested-By: default avatarDr. H. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      8e59c7f2
  11. 18 May, 2015 3 commits
    • Linus Torvalds's avatar
      Linux 4.1-rc4 · e2608180
      Linus Torvalds authored
      e2608180
    • Peter Zijlstra's avatar
      watchdog: Fix merge 'conflict' · ab992dc3
      Peter Zijlstra authored
      Two watchdog changes that came through different trees had a non
      conflicting conflict, that is, one changed the semantics of a variable
      but no actual code conflict happened. So the merge appeared fine, but
      the resulting code did not behave as expected.
      
      Commit 195daf66 ("watchdog: enable the new user interface of the
      watchdog mechanism") changes the semantics of watchdog_user_enabled,
      which thereafter is only used by the functions introduced by
      b3738d29 ("watchdog: Add watchdog enable/disable all functions").
      
      There further appears to be a distinct lack of serialization between
      setting and using watchdog_enabled, so perhaps we should wrap the
      {en,dis}able_all() things in watchdog_proc_mutex.
      
      This patch fixes a s2r failure reported by Michal; which I cannot
      readily explain. But this does make the code internally consistent
      again.
      Reported-and-tested-by: default avatarMichal Hocko <mhocko@suse.cz>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab992dc3
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd · 7cf7d424
      Linus Torvalds authored
      Pull MTD fixes from Brian Norris:
       "Two MTD fixes for 4.1:
      
         - readtest: the signal-handling code was clobbering the error codes
           we should be handling/reporting in this test, rendering it useless.
           Noticed by Coverity.
      
         - the common SPI NOR flash DT binding (merged for 4.1-rc1) is being
           revised, so let's change that before 4.1 is minted"
      
      * tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd:
        Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor"
        mtd: readtest: don't clobber error reports
      7cf7d424
  12. 17 May, 2015 4 commits
    • Linus Torvalds's avatar
      Merge tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · c0655fe9
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some USB fixes and new device ids for 4.1-rc4.
      
        All are pretty minor, and have been in linux-next successfully"
      
      * tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices
        Added another USB product ID for ELAN touchscreen quirks.
        xhci: gracefully handle xhci_irq dead device
        xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256
        xhci: fix isoc endpoint dequeue from advancing too far on transaction error
        usb: chipidea: debug: avoid out of bound read
        USB: visor: Match I330 phone more precisely
        USB: pl2303: Remove support for Samsung I330
        USB: cp210x: add ID for KCF Technologies PRN device
        usb: gadget: remove incorrect __init/__exit annotations
        usb: phy: isp1301: work around tps65010 dependency
        usb: gadget: serial: fix re-ordering of tx data
        usb: gadget: hid: Fix static variable usage
        usb: gadget: configfs: Fix interfaces array NULL-termination
        usb: gadget: xilinx: fix devm_ioremap_resource() check
        usb: dwc3: dwc3-omap: correct the register macros
      c0655fe9
    • Linus Torvalds's avatar
      Merge tag 'tty-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · dd8edd7e
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here's some TTY and serial driver fixes for reported issues.
      
        All of these have been in linux-next successfully"
      
      * tag 'tty-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        pty: Fix input race when closing
        tty/n_gsm.c: fix a memory leak when gsmtty is removed
        Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is not open"
        serial: omap: Fix error handling in probe
        earlycon: Revert log warnings
      dd8edd7e
    • Linus Torvalds's avatar
      Merge tag 'staging-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 3f4741b1
      Linus Torvalds authored
      Pull staging / IIO driver fixes from Greg KH:
       "Here's some staging and iio driver fixes to resolve a number of
        reported issues.
      
        All of these have been in linux-next for a while"
      
      * tag 'staging-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (31 commits)
        iio: light: hid-sensor-prox: Fix memory leak in probe()
        iio: adc: cc10001: Add delay before setting START bit
        iio: adc: cc10001: Fix regulator_get_voltage() return value check
        iio: adc: cc10001: Fix incorrect use of power-up/power-down register
        staging: gdm724x: Correction of variable usage after applying ALIGN()
        iio: adc: cc10001: Fix the channel number mapping
        staging: vt6655: lock MACvWriteBSSIDAddress.
        staging: vt6655: CARDbUpdateTSF bss timestamp correct tsf counter value.
        staging: vt6655: vnt_tx_packet Correct TX order of OWNED_BY_NIC
        staging: vt6655: Fix 80211 control and management status reporting.
        staging: vt6655: implement IEEE80211_TX_STAT_NOACK_TRANSMITTED
        staging: vt6655: device_free_tx_buf use only ieee80211_tx_status_irqsafe
        staging: vt6656: use ieee80211_tx_info to select packet type.
        staging: rtl8712: freeing an ERR_PTR
        staging: sm750: remove incorrect __exit annotation
        iio: kfifo: Set update_needed to false only if a buffer was allocated
        iio: mcp320x: Fix occasional incorrect readings
        iio: accel: mma9553: check input value for activity period
        iio: accel: mma9553: add enable channel for activity
        iio: accel: mma9551_core: prevent buffer overrun
        ...
      3f4741b1
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 148c46f3
      Linus Torvalds authored
      Pull char/misc fix from Greg KH:
       "Here is one fix, in the extcon subsystem, that resolves a reported
        issue.
      
        It's been in linux-next for a number of weeks now, sorry for not
        getting it to you sooner"
      
      * tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        extcon: usb-gpio: register extcon device before IRQ registration
      148c46f3
  13. 16 May, 2015 2 commits