1. 26 8月, 2016 6 次提交
  2. 20 6月, 2016 1 次提交
  3. 13 2月, 2016 2 次提交
    • J
      i2c: designware: Prevent runtime suspend during adapter registration · cd998ded
      Jarkko Nikula 提交于
      There can be unnecessary runtime suspend-resume cycle during
      i2c-designware-platdrv probe when it registers the I2C adapter device. This
      happens because i2c-designware-platdrv is set to initially active platform
      device in its probe function and is a parent of I2C adapter.
      
      In that case power.usage_count of i2c-designware device is zero and
      pm_runtime_get()/pm_runtime_put() cycle during probe could put it into
      runtime suspend. This happens when the i2c_register_adapter() calls the
      device_register():
      
      i2c_register_adapter
        device_register
          device_add
            bus_probe_device
              device_initial_probe
                __device_attach
                  if (dev->parent) pm_runtime_get_sync(dev->parent)
                  ...
                  if (dev->parent) pm_runtime_put(dev->parent)
      
      After that the i2c_register_adapter() continues registering I2C slave
      devices. In case slave device probe does I2C transfers the parent will
      resume again and thus get a needless runtime suspend/resume cycle during
      adapter registration.
      
      Prevent this while retaining the runtime PM status of i2c-designware by
      only incrementing/decrementing device power usage count during I2C
      adapter registration. That makes sure there won't be spurious runtime PM
      status changes and lets the driver core to idle the device after probe
      finishes.
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      cd998ded
    • B
      i2c: designware: remove redundant lock · e3c97650
      Baruch Siach 提交于
      The per adapter bus_lock already projects from concurrent calls to the
      master_xfer callback. No need to add a driver internal lock.
      
      Also, rephrase a comment to drop mention of this lock.
      Reported-by: zourongrong's avatarRongrong Zou <zourongrong@gmail.com>
      Signed-off-by: NBaruch Siach <baruch@tkos.co.il>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      e3c97650
  4. 26 1月, 2016 1 次提交
  5. 10 1月, 2016 2 次提交
  6. 13 12月, 2015 1 次提交
  7. 15 10月, 2015 4 次提交
  8. 10 8月, 2015 1 次提交
  9. 15 3月, 2015 1 次提交
  10. 26 1月, 2015 2 次提交
  11. 24 1月, 2015 1 次提交
  12. 21 11月, 2014 1 次提交
  13. 08 11月, 2014 1 次提交
  14. 15 5月, 2014 1 次提交
    • D
      i2c: designware: Mask all interrupts during i2c controller enable · 47bb27e7
      Du, Wenkai 提交于
      There have been "i2c_designware 80860F41:00: controller timed out" errors
      on a number of Baytrail platforms. The issue is caused by incorrect value in
      Interrupt Mask Register (DW_IC_INTR_MASK)  when i2c core is being enabled.
      This causes call to __i2c_dw_enable() to immediately start the transfer which
      leads to timeout. There are 3 failure modes observed:
      
      1. Failure in S0 to S3 resume path
      
      The default value after reset for DW_IC_INTR_MASK is 0x8ff. When we start
      the first transaction after resuming from system sleep, TX_EMPTY interrupt
      is already unmasked because of the hardware default.
      
      2. Failure in normal operational path
      
      This failure happens rarely and is hard to reproduce. Debug trace showed that
      DW_IC_INTR_MASK had value of 0x254 when failure occurred, which meant
      TX_EMPTY was unmasked.
      
      3. Failure in S3 to S0 suspend path
      
      This failure also happens rarely and is hard to reproduce. Adding debug trace
      that read DW_IC_INTR_MASK made this failure not reproducible. But from ISR
      call trace we could conclude TX_EMPTY was unmasked when problem occurred.
      
      The patch masks all interrupts before the controller is enabled to resolve the
      faulty DW_IC_INTR_MASK conditions.
      Signed-off-by: NWenkai Du <wenkai.du@intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [wsa: improved the comment and removed typo in commit msg]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      47bb27e7
  15. 09 3月, 2014 1 次提交
  16. 13 1月, 2014 1 次提交
  17. 15 11月, 2013 1 次提交
  18. 28 9月, 2013 1 次提交
  19. 28 8月, 2013 1 次提交
    • M
      i2c: designware: make HCNT/LCNT values configurable · defc0b2f
      Mika Westerberg 提交于
      The DesignWare I2C controller has high count (HCNT) and low count (LCNT)
      registers for each of the I2C speed modes (standard and fast). These
      registers are programmed based on the input clock speed in the driver.
      
      The current code calculates these values based on the input clock speed and
      tries hard to meet the I2C bus timing requirements. This could result
      non-optimal values with regarding to the bus speed. For example on Intel
      BayTrail we get bus speed of 315.41kHz which is ~20% slower than we would
      expect (400kHz) in fast mode (even though the timing requirements are met).
      
      This patch makes it possible for the platform code to pass more optimal
      HCNT/LCNT values to the core driver if they are known beforehand. If these
      are not set we use the calculated and more conservative values.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NShinya Kuribayashi <skuribay@pobox.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      defc0b2f
  20. 07 8月, 2013 1 次提交
  21. 26 6月, 2013 1 次提交
  22. 15 6月, 2013 1 次提交
    • C
      i2c: designware: fix race between subsequent xfers · 38d7fade
      Christian Ruppert 提交于
      The designware block is not always properly disabled in the case of
      transfer errors. Interrupts from aborted transfers might be handled
      after the data structures for the following transfer are initialised but
      before the hardware is set up. This can corrupt the data structures to
      the point that the system is stuck in an infinite interrupt loop (where
      FIFOs are never emptied because dev->msg_read_idx == dev->msgs_num).
      
      This patch cleanly disables the designware-i2c hardware at the end of
      every transfer, be it successful or not.
      Signed-off-by: NChristian Ruppert <christian.ruppert@abilis.com>
      [wsa: extended the comment]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      38d7fade
  23. 13 6月, 2013 1 次提交
  24. 17 5月, 2013 2 次提交
    • M
      i2c: designware: always clear interrupts before enabling them · 2a2d95e9
      Mika Westerberg 提交于
      If the I2C bus is put to a low power state by an ACPI method it might pull
      the SDA line low (as its power is removed). Once the bus is put to full
      power state again, the SDA line is pulled back to high. This transition
      looks like a STOP condition from the controller point-of-view which sets
      STOP detected bit in its status register causing the driver to fail
      subsequent transfers.
      
      Fix this by always clearing all interrupts before we start a transfer.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      2a2d95e9
    • J
      i2c: designware: fix RX FIFO overrun · e6f34cea
      Josef Ahmad 提交于
      i2c_dw_xfer_msg() pushes a number of bytes to transmit/receive
      to/from the bus into the TX FIFO.
      For master-rx transactions, the maximum amount of data that can be
      received is calculated depending solely on TX and RX FIFO load.
      
      This is racy - TX FIFO may contain master-rx data yet to be
      processed, which will eventually land into the RX FIFO. This
      data is not taken into account and the function may request more
      data than the controller is actually capable of storing.
      
      This patch ensures the driver takes into account the outstanding
      master-rx data in TX FIFO to prevent RX FIFO overrun.
      Signed-off-by: NJosef Ahmad <josef.ahmad@linux.intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      e6f34cea
  25. 16 4月, 2013 3 次提交
  26. 28 1月, 2013 1 次提交