1. 13 6月, 2015 2 次提交
  2. 10 6月, 2015 4 次提交
    • F
      sbs-battery: add option to always register battery · f4ed950a
      Frans Klaver 提交于
      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: NFrans Klaver <frans.klaver@xsens.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      f4ed950a
    • H
      power: Add devm_power_supply_get_by_phandle() helper function · fe27e1df
      Hans de Goede 提交于
      This commit adds a resource-managed version of the
      power_supply_get_by_phandle() function.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      fe27e1df
    • K
      power_supply: max17042: Add OF support for setting thresholds · a6e6b63e
      Krzysztof Kozlowski 提交于
      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: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: edd4ab05 ("power: max17042_battery: add HEALTH and TEMP_* properties support")
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      a6e6b63e
    • K
      power_supply: sysfs: Bring back write to writeable properties · 5c6e3a97
      Krzysztof Kozlowski 提交于
      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: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      5c6e3a97
  3. 03 6月, 2015 3 次提交
    • A
      power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled · fb323ecc
      Anda-Maria Nicolae 提交于
      If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and
      compilation fails. Therefore, the functions that process USB event
      notifications are defined only if CONFIG_USB_PHY is enabled.
      There is no need to define these functions if CONFIG_USB_PHY is not
      enabled, since no USB notifications are received in this case.
      Also, since rt9455_set_boost_voltage_before_boost_mode() function is
      called only if USB_EVENT_ID notification is received, this function should
      also be defined only if CONFIG_USB_PHY is enabled.
      Signed-off-by: NAnda-Maria Nicolae <anda-maria.nicolae@intel.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      fb323ecc
    • H
      power: reset: gpio-restart: increase priority slightly · bcd56fe1
      Heiko Stübner 提交于
      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: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      bcd56fe1
    • L
      power_supply: bq25890: make chip_id int · 23fa43a2
      Laurentiu Palcu 提交于
      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: NLaurentiu Palcu <laurentiu.palcu@intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      23fa43a2
  4. 30 5月, 2015 3 次提交
  5. 29 5月, 2015 2 次提交
  6. 24 5月, 2015 13 次提交
  7. 21 5月, 2015 2 次提交
    • K
      power_supply: Fix possible NULL pointer dereference on early uevent · 7f1a57fd
      Krzysztof Kozlowski 提交于
      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: NH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 297d716f ("power_supply: Change ownership from driver to core")
      Tested-By: NDr. H. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      7f1a57fd
    • K
      power_supply: Fix NULL pointer dereference during bq27x00_battery probe · 8e59c7f2
      Krzysztof Kozlowski 提交于
      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: NH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 297d716f ("power_supply: Change ownership from driver to core")
      Tested-By: NDr. H. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: NSebastian Reichel <sre@kernel.org>
      8e59c7f2
  8. 19 5月, 2015 3 次提交
    • L
      Linux 4.1-rc4 · e2608180
      Linus Torvalds 提交于
      e2608180
    • P
      watchdog: Fix merge 'conflict' · ab992dc3
      Peter Zijlstra 提交于
      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: NMichal Hocko <mhocko@suse.cz>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ab992dc3
    • L
      Merge tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd · 7cf7d424
      Linus Torvalds 提交于
      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
  9. 17 5月, 2015 8 次提交
    • L
      Merge tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · c0655fe9
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'tty-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · dd8edd7e
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'staging-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 3f4741b1
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 148c46f3
      Linus Torvalds 提交于
      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
    • L
      Merge branch 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 92752b5c
      Linus Torvalds 提交于
      Pull UML hostfs fix from Richard Weinberger:
       "This contains a single fix for a regression introduced in 4.1-rc1"
      
      * 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        hostfs: Use correct mask for file mode
      92752b5c
    • L
      Merge tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs · 1630ee5e
      Linus Torvalds 提交于
      Pull UBI bufix from Richard Weinberger:
       "This contains a single bug fix for the UBI block driver"
      
      * tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs:
        UBI: block: Add missing cache flushes
      1630ee5e
    • L
      Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 6a8098a4
      Linus Torvalds 提交于
      Pull ext4 fixes from Ted Ts'o:
       "Fix a number of ext4 bugs; the most serious of which is a bug in the
        lazytime mount optimization code where we could end up updating the
        timestamps to the wrong inode"
      
      * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix an ext3 collapse range regression in xfstests
        jbd2: fix r_count overflows leading to buffer overflow in journal recovery
        ext4: check for zero length extent explicitly
        ext4: fix NULL pointer dereference when journal restart fails
        ext4: remove unused function prototype from ext4.h
        ext4: don't save the error information if the block device is read-only
        ext4: fix lazytime optimization
      6a8098a4
    • L
      Merge branch 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · c7309e88
      Linus Torvalds 提交于
      Pull btrfs fixes from Chris Mason:
       "The first commit is a fix from Filipe for a very old extent buffer
        reuse race that triggered a BUG_ON.  It hasn't come up often, I looked
        through old logs at FB and we hit it a handful of times over the last
        year.
      
        The rest are other corners he hit during testing"
      
      * 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON
        Btrfs: fix race between block group creation and their cache writeout
        Btrfs: fix panic when starting bg cache writeout after IO error
        Btrfs: fix crash after inode cache writeback failure
      c7309e88