1. 26 4月, 2016 3 次提交
  2. 25 4月, 2016 1 次提交
  3. 10 1月, 2016 1 次提交
  4. 15 10月, 2015 1 次提交
  5. 13 5月, 2015 2 次提交
  6. 24 1月, 2015 1 次提交
    • P
      i2c: s3c2410: fix ABBA deadlock by keeping clock prepared · 34e81ad5
      Paul Osmialowski 提交于
      This patch solves deadlock between clock prepare mutex and regmap mutex reported
      by Tomasz Figa in [1] by implementing solution from [2]: "always leave the clock
      of the i2c controller in a prepared state".
      
      [1] https://lkml.org/lkml/2014/7/2/171
      [2] https://lkml.org/lkml/2014/7/2/207
      
      On each i2c transfer handled by s3c24xx_i2c_xfer(), clk_prepare_enable() was
      called, which calls clk_prepare() then clk_enable(). clk_prepare() takes
      prepare_lock mutex before proceeding. Note that i2c transfer functions are
      invoked from many places in kernel, typically with some other additional lock
      held.
      
      It may happen that function on CPU1 (e.g. regmap_update_bits()) has taken a
      mutex (i.e. regmap lock mutex) then it attempts i2c communication in order to
      proceed (so it needs to obtain clock related prepare_lock mutex during transfer
      preparation stage due to clk_prepare() call). At the same time other task on
      CPU0 wants to operate on clock (e.g. to (un)prepare clock for some other reason)
      so it has taken prepare_lock mutex.
      
      CPU0:                        CPU1:
      clk_disable_unused()         regulator_disable()
        clk_prepare_lock()           map->lock(map->lock_arg)
        regmap_read()                s3c24xx_i2c_xfer()
          map->lock(map->lock_arg)     clk_prepare_lock()
      
      Implemented solution from [2] leaves i2c clock prepared. Preparation is done in
      s3c24xx_i2c_probe() function. Without this patch, it is immediately unprepared
      by clk_disable_unprepare() call. I've replaced this call with clk_disable() and
      I've added clk_unprepare() call in s3c24xx_i2c_remove().
      
      The s3c24xx_i2c_xfer() function now uses clk_enable() instead of
      clk_prepare_enable() (and clk_disable() instead of clk_unprepare_disable()).
      Signed-off-by: NPaul Osmialowski <p.osmialowsk@samsung.com>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      34e81ad5
  7. 24 11月, 2014 1 次提交
  8. 08 11月, 2014 1 次提交
  9. 20 10月, 2014 1 次提交
  10. 26 8月, 2014 1 次提交
  11. 02 8月, 2014 1 次提交
  12. 17 7月, 2014 1 次提交
  13. 03 6月, 2014 1 次提交
  14. 15 5月, 2014 1 次提交
  15. 13 3月, 2014 2 次提交
    • S
      i2c: s3c2410: Leave the bus disabled unless it is in use · 069a9502
      Simon Glass 提交于
      There is a rather odd feature of the exynos i2c controller that if it
      is left enabled, it can lock itself up with the clk line held low.
      This makes the bus unusable.
      
      Unfortunately, the s3c24xx_i2c_set_master() function does not notice
      this, and reports a timeout. From then on the bus cannot be used until
      the AP is rebooted.
      
      The problem happens when any sort of interrupt occurs (e.g. due to a
      bus transition) when we are not in the middle of a transaction. We
      have seen many instances of this when U-Boot leaves the bus apparently
      happy, but Linux cannot access it.
      
      The current code is therefore pretty fragile.
      
      This fixes things by leaving the bus disabled unless we are actually
      in a transaction. We enable the bus at the start of the transaction and
      disable it at the end. That way we won't get interrupts and will not
      lock up the bus.
      
      It might be possible to clear pending interrupts on start-up, but this
      seems to be a more robust solution. We can't service interrupts when
      we are not in a transaction, and anyway would rather not lock up the
      bus while we try.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Acked-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      069a9502
    • W
      i2c: i2c-s3c2410: deprecate class based instantiation · 5304032c
      Wolfram Sang 提交于
      Warn users that class based instantiation is going away soon in favour
      of more robust probing and faster bootup times.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      5304032c
  16. 16 1月, 2014 1 次提交
  17. 04 1月, 2014 2 次提交
  18. 30 10月, 2013 1 次提交
  19. 28 9月, 2013 1 次提交
    • K
      i2c: s3c2410: fix clk_disable/clk_unprepare WARNings · 15336913
      Kim Phillips 提交于
      commit d16933b3 "i2c: s3c2410: Move
      location of clk_prepare_enable() call in probe function" refactored
      clk_enable and clk_disable calls yet neglected to remove the
      clk_disable_unprepare call in the module's remove().
      
      It helps remove warnings on an arndale during unbind:
      
      echo 12c90000.i2c > /sys/bus/platform/devices/12c90000.i2c/driver/unbind
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 2548 at drivers/clk/clk.c:842 clk_disable+0x18/0x24()
      Modules linked in:
      CPU: 0 PID: 2548 Comm: bash Not tainted 3.11.0-next-20130916-00003-gf4bddbc #6
      [<c0014d48>] (unwind_backtrace+0x0/0xf8) from [<c00117d0>] (show_stack+0x10/0x14)
      [<c00117d0>] (show_stack+0x10/0x14) from [<c0361be8>] (dump_stack+0x6c/0xac)
      [<c0361be8>] (dump_stack+0x6c/0xac) from [<c001d864>] (warn_slowpath_common+0x64/0x88)
      [<c001d864>] (warn_slowpath_common+0x64/0x88) from [<c001d8a4>] (warn_slowpath_null+0x1c/0x24)
      [<c001d8a4>] (warn_slowpath_null+0x1c/0x24) from [<c02c4a64>] (clk_disable+0x18/0x24)
      [<c02c4a64>] (clk_disable+0x18/0x24) from [<c028d0b0>] (s3c24xx_i2c_remove+0x28/0x70)
      [<c028d0b0>] (s3c24xx_i2c_remove+0x28/0x70) from [<c0217a10>] (platform_drv_remove+0x18/0x1c)
      [<c0217a10>] (platform_drv_remove+0x18/0x1c) from [<c0216358>] (__device_release_driver+0x58/0xb4)
      [<c0216358>] (__device_release_driver+0x58/0xb4) from [<c02163d0>] (device_release_driver+0x1c/0x28)
      [<c02163d0>] (device_release_driver+0x1c/0x28) from [<c02153c0>] (unbind_store+0x58/0x90)
      [<c02153c0>] (unbind_store+0x58/0x90) from [<c0214c90>] (drv_attr_store+0x20/0x2c)
      [<c0214c90>] (drv_attr_store+0x20/0x2c) from [<c01032c0>] (sysfs_write_file+0x168/0x198)
      [<c01032c0>] (sysfs_write_file+0x168/0x198) from [<c00ae1c0>] (vfs_write+0xb0/0x194)
      [<c00ae1c0>] (vfs_write+0xb0/0x194) from [<c00ae594>] (SyS_write+0x3c/0x70)
      [<c00ae594>] (SyS_write+0x3c/0x70) from [<c000e3e0>] (ret_fast_syscall+0x0/0x30)
      ---[ end trace 4c9f9403066f57a6 ]---
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 2548 at drivers/clk/clk.c:751 clk_unprepare+0x14/0x1c()
      Modules linked in:
      CPU: 0 PID: 2548 Comm: bash Tainted: G        W    3.11.0-next-20130916-00003-gf4bddbc #6
      [<c0014d48>] (unwind_backtrace+0x0/0xf8) from [<c00117d0>] (show_stack+0x10/0x14)
      [<c00117d0>] (show_stack+0x10/0x14) from [<c0361be8>] (dump_stack+0x6c/0xac)
      [<c0361be8>] (dump_stack+0x6c/0xac) from [<c001d864>] (warn_slowpath_common+0x64/0x88)
      [<c001d864>] (warn_slowpath_common+0x64/0x88) from [<c001d8a4>] (warn_slowpath_null+0x1c/0x24)
      [<c001d8a4>] (warn_slowpath_null+0x1c/0x24) from [<c02c5834>] (clk_unprepare+0x14/0x1c)
      [<c02c5834>] (clk_unprepare+0x14/0x1c) from [<c028d0b8>] (s3c24xx_i2c_remove+0x30/0x70)
      [<c028d0b8>] (s3c24xx_i2c_remove+0x30/0x70) from [<c0217a10>] (platform_drv_remove+0x18/0x1c)
      [<c0217a10>] (platform_drv_remove+0x18/0x1c) from [<c0216358>] (__device_release_driver+0x58/0xb4)
      [<c0216358>] (__device_release_driver+0x58/0xb4) from [<c02163d0>] (device_release_driver+0x1c/0x28)
      [<c02163d0>] (device_release_driver+0x1c/0x28) from [<c02153c0>] (unbind_store+0x58/0x90)
      [<c02153c0>] (unbind_store+0x58/0x90) from [<c0214c90>] (drv_attr_store+0x20/0x2c)
      [<c0214c90>] (drv_attr_store+0x20/0x2c) from [<c01032c0>] (sysfs_write_file+0x168/0x198)
      [<c01032c0>] (sysfs_write_file+0x168/0x198) from [<c00ae1c0>] (vfs_write+0xb0/0x194)
      [<c00ae1c0>] (vfs_write+0xb0/0x194) from [<c00ae594>] (SyS_write+0x3c/0x70)
      [<c00ae594>] (SyS_write+0x3c/0x70) from [<c000e3e0>] (ret_fast_syscall+0x0/0x30)
      ---[ end trace 4c9f9403066f57a7 ]---
      Signed-off-by: NKim Phillips <kim.phillips@linaro.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      15336913
  20. 23 8月, 2013 1 次提交
    • W
      i2c: move OF helpers into the core · 687b81d0
      Wolfram Sang 提交于
      I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
      that it is much cleaner to have this in the core. This also removes a
      circular dependency between the helpers and the core, and so we can
      finally register child nodes in the core instead of doing this manually
      in each driver. So, fix the drivers and documentation, too.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      687b81d0
  21. 20 8月, 2013 1 次提交
  22. 18 5月, 2013 1 次提交
  23. 09 4月, 2013 1 次提交
    • J
      i2c: s3c2410: Add SMBus emulation for block read · 85747311
      Jaemin Yoo 提交于
      SMBus read and write are supported by the emulation layer of i2c
      framework if the controller doesn't have SMBus features.
      
      I2C_M_RECV_LEN flag is used to let i2c drivers know rx length is not
      yet determined but will be read to the first byte in rx buffer.
      
      s3c2410 doesn't handle this flag. So only one byte is read from slave.
      There fore following two features are added to the driver code.
      
      1. skip rx length check if I2C_M_RECV_LEN is set and the length is 1.
      2. add actual bytes to the rx length after reading first bytes if
         I2C_M_RECV_LEN.
      
      I2C_M_RECV_LEN is only set for SMBus command. So this code does not
      affect legacy codes which only use i2c command for s3c2410.
      Signed-off-by: NJaemin Yoo <jmin.yoo@samsung.com>
      Tested-by: NPrasanna Kumar <prasanna.ps@samsung.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      85747311
  24. 24 3月, 2013 2 次提交
  25. 28 1月, 2013 5 次提交
  26. 25 1月, 2013 1 次提交
  27. 23 11月, 2012 1 次提交
  28. 19 11月, 2012 3 次提交