1. 30 3月, 2016 1 次提交
    • W
      i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_CORE · 8dcf3217
      Wolfram Sang 提交于
      Jan reported this:
      
      ===
      After enabling CONFIG_I2C_DEBUG_CORE my system was broken
      (no network, console login not possible). System log was
      flooded with the this message:
      
       ...
      [  608.052077] rtc-ds1307 0-0068: uevent
      [  608.052500] rtc-ds1307 0-0068: uevent
      [  608.052925] rtc-ds1307 0-0068: uevent
       ...
      
      The culprit is the dev_dbg printk in the i2c uevent handler.
      If this is activated (for instance by CONFIG_I2C_DEBUG_CORE)
      it results in an endless loop with systemd-journald.
      
      This happens if user-space scans the system log and reads the uevent
      file to get information about a newly created device, which seems fair
      use to me. Unfortunately reading the "uevent" file uses the same
      function that runs for creating the uevent for a new device,
      generating the next syslog entry.
      
      Ideally user-space would implement a recursion detection and
      after reading the same device file for the 1000th time call it a
      day, but nevertheless I think we should avoid this problem by
      removing the debug print completely or using another print variant.
      
      The same problem seems to be reported here:
      https://bugs.freedesktop.org/show_bug.cgi?id=76886
      ===
      
      His patch converted the message to pr_debug, but I think the debug can
      simply go. We have other means to see code paths these days. This
      enables us to clean up the function some more while we are here.
      Reported-by: NJan Glauber <jglauber@cavium.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Acked-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Tested-by: NJan Glauber <jglauber@cavium.com>
      8dcf3217
  2. 15 3月, 2016 1 次提交
  3. 12 3月, 2016 1 次提交
  4. 21 2月, 2016 1 次提交
  5. 10 1月, 2016 1 次提交
  6. 18 12月, 2015 1 次提交
  7. 14 12月, 2015 1 次提交
  8. 20 11月, 2015 1 次提交
  9. 25 10月, 2015 1 次提交
    • D
      i2c: add ACPI support for I2C mux ports · 8eb5c87a
      Dustin Byford 提交于
      Although I2C mux devices are easily enumerated using ACPI (_HID/_CID or
      device property compatible string match), enumerating I2C client devices
      connected through an I2C mux needs a little extra work.
      
      This change implements a method for describing an I2C device hierarchy that
      includes mux devices by using an ACPI Device() for each mux channel along
      with an _ADR to set the channel number for the device.  See
      Documentation/acpi/i2c-muxes.txt for a simple example.
      
      To make this work the ismt, i801, and designware pci/platform devs now
      share an ACPI companion with their I2C adapter dev similar to how it's done
      in OF.  This is done on the assumption that power management functions will
      not be called directly on the I2C dev that is sharing the ACPI node.
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NDustin Byford <dustin@cumulusnetworks.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      8eb5c87a
  10. 20 10月, 2015 1 次提交
  11. 15 10月, 2015 1 次提交
  12. 27 8月, 2015 1 次提交
    • D
      i2c: allow specifying separate wakeup interrupt in device tree · 3fffd128
      Dmitry Torokhov 提交于
      Instead of having each i2c driver individually parse device tree data in
      case it or platform supports separate wakeup interrupt, and handle
      enabling and disabling wakeup interrupts in their power management
      routines, let's have i2c core do that for us.
      
      Platforms wishing to specify separate wakeup interrupt for the device
      should use named interrupt syntax in their DTSes:
      
      	interrupt-parent = <&intc1>;
      	interrupts = <5 0>, <6 0>;
      	interrupt-names = "irq", "wakeup";
      
      This patch is inspired by work done by Vignesh R <vigneshr@ti.com> for
      pixcir_i2c_ts driver.
      
      Note that the original code tried to preserve any existing wakeup
      settings from userspace but was not quite right in that regard:
      it would preserve wakeup flag set by userspace upon driver rebinding;
      but it would re-arm the wakeup flag if it was disabled by userspace.
      
      We think that resetting the flag upon re-binding the driver is proper
      behavior as the driver is responsible for setting up and handling
      wakeups.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Tested-by: NVignesh R <vigneshr@ti.com>
      [wsa: updated the commit message]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      3fffd128
  13. 24 8月, 2015 8 次提交
  14. 10 8月, 2015 2 次提交
    • V
      i2c: core: add and export of_get_i2c_adapter_by_node() interface · 48e9743d
      Vladimir Zapolskiy 提交于
      of_find_i2c_adapter_by_node() call requires quite often missing
      put_device(), and i2c_put_adapter() releases a device locked by
      i2c_get_adapter() only. In general module_put(adapter->owner) and
      put_device(dev) are not interchangeable.
      
      This is a common error reproduction scenario as a result of the
      misusage described above (for clearness this is run on iMX6 platform
      with HDMI and I2C bus drivers compiled as kernel modules):
      
          root@mx6q:~# lsmod | grep i2c
          i2c_imx                10213  0
          root@mx6q:~# lsmod | grep dw_hdmi_imx
          dw_hdmi_imx             3631  0
          dw_hdmi                11846  1 dw_hdmi_imx
          imxdrm                  8674  3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb
          drm_kms_helper        113765  5 dw_hdmi,imxdrm,imx_ipuv3_crtc,imx_ldb
          root@mx6q:~# rmmod dw_hdmi_imx
          root@mx6q:~# lsmod | grep i2c
          i2c_imx                10213  -1
      
                                       ^^^^^
      
          root@mx6q:~# rmmod i2c_imx
          rmmod: ERROR: Module i2c_imx is in use
      
      To fix existing users of these interfaces and to avoid any further
      confusion and misusage in future, add one more interface
      of_get_i2c_adapter_by_node(), it is similar to i2c_get_adapter() in
      sense that an I2C bus device driver found and locked by user can be
      correctly unlocked by i2c_put_adapter().
      Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      48e9743d
    • V
      i2c: core: manage i2c bus device refcount in i2c_[get|put]_adapter · 611e12ea
      Vladimir Zapolskiy 提交于
      In addition to module_get()/module_put() add get_device()/put_device()
      calls into i2c_get_adapter()/i2c_put_adapter() exported
      interfaces. This is done to lock I2C bus device, if it is in use by a
      client.
      Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      611e12ea
  15. 01 8月, 2015 1 次提交
  16. 31 7月, 2015 1 次提交
  17. 10 7月, 2015 1 次提交
  18. 02 6月, 2015 1 次提交
  19. 01 6月, 2015 3 次提交
  20. 13 5月, 2015 2 次提交
  21. 24 4月, 2015 1 次提交
  22. 16 4月, 2015 1 次提交
    • M
      i2c: core: Export bus recovery functions · c1c21f4e
      Mark Brown 提交于
      Current -next fails to link an ARM allmodconfig because drivers that use
      the core recovery functions can be built as modules but those functions
      are not exported:
      
      ERROR: "i2c_generic_gpio_recovery" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      ERROR: "i2c_generic_scl_recovery" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      ERROR: "i2c_recover_bus" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      
      Add exports to fix this.
      
      Fixes: 5f9296ba (i2c: Add bus recovery infrastructure)
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      c1c21f4e
  23. 10 4月, 2015 1 次提交
  24. 18 3月, 2015 1 次提交
  25. 17 3月, 2015 1 次提交
  26. 13 3月, 2015 1 次提交
  27. 12 3月, 2015 1 次提交
  28. 06 2月, 2015 1 次提交
  29. 27 1月, 2015 1 次提交