1. 22 Nov, 2013 1 commit
    • Stephen Warren's avatar
      spi: core: invert success test in devm_spi_register_master · 4b92894e
      Stephen Warren authored
      devres_add() should be called when the action to be undone succeeded,
      not when it failed. Fix the inverted test in devm_spi_register_master()
      which was doing the opposite.
      
      The user-visible issue without this fix is:
      insmod spi-tegra114.ko
        Assume there's an MTD device on that SPI bus, which creates /dev/mtd0.
      rmmod spi-tegra114
        Doesn't remove devices on the SPI bus.
      insmod spi-tegra114.ko
        Creates a duplicate SPI device which creates /dev/mtd1.
      hexdump -C /dev/mtd0
        That's the old device, which uses an SPI bus hosted by a non-existent
        module, which causes the oops below.
      
      Unable to handle kernel paging request at virtual address bf0017c0
      pgd = c0004000
      [bf0017c0] *pgd=ad51b811, *pte=00000000, *ppte=00000000
      Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
      ...
      PC is at 0xbf0017c0
      LR is at spi_pump_messages+0x15c/0x204
      pc : [<bf0017c0>] lr : [<c02f0af8>] psr: 60000113
      ...
      
      Fixes: 666d5b4c ("spi: core: Add devm_spi_register_master()")
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      4b92894e
  2. 25 Oct, 2013 35 commits
  3. 23 Oct, 2013 2 commits
  4. 22 Oct, 2013 2 commits
    • Krzysztof Kozlowski's avatar
      spi/s3c64xx: Fix doubled clock disable on suspend · 9d7fd21a
      Krzysztof Kozlowski authored
      Fix doubled clock disable and unprepare during PM suspend which triggered
      the warnings:
      
      WARNING: at drivers/clk/clk.c:800 clk_disable+0x18/0x24()
      Modules linked in:
      CPU: 0 PID: 1745 Comm: sh Not tainted 3.10.14-01211-ge2549bb-dirty #62
      [<c0015980>] (unwind_backtrace+0x0/0x138) from [<c0012a44>] (show_stack+0x10/0x14)
      [<c0012a44>] (show_stack+0x10/0x14) from [<c0022818>] (warn_slowpath_common+0x4c/0x68)
      [<c0022818>] (warn_slowpath_common+0x4c/0x68) from [<c0022850>] (warn_slowpath_null+0x1c/0x24)
      [<c0022850>] (warn_slowpath_null+0x1c/0x24) from [<c036e274>] (clk_disable+0x18/0x24)
      [<c036e274>] (clk_disable+0x18/0x24) from [<c02d5f78>] (s3c64xx_spi_suspend+0x28/0x54)
      [<c02d5f78>] (s3c64xx_spi_suspend+0x28/0x54) from [<c02b3a54>] (platform_pm_suspend+0x2c/0x5c)
      [<c02b3a54>] (platform_pm_suspend+0x2c/0x5c) from [<c02b8a30>] (dpm_run_callback+0x44/0x7c)
      [<c02b8a30>] (dpm_run_callback+0x44/0x7c) from [<c02b8b70>] (__device_suspend+0x108/0x300)
      [<c02b8b70>] (__device_suspend+0x108/0x300) from [<c02ba4e0>] (dpm_suspend+0x54/0x208)
      [<c02ba4e0>] (dpm_suspend+0x54/0x208) from [<c0066bcc>] (suspend_devices_and_enter+0x98/0x458)
      [<c0066bcc>] (suspend_devices_and_enter+0x98/0x458) from [<c0067150>] (pm_suspend+0x1c4/0x25c)
      [<c0067150>] (pm_suspend+0x1c4/0x25c) from [<c0066044>] (state_store+0x6c/0xbc)
      [<c0066044>] (state_store+0x6c/0xbc) from [<c0203290>] (kobj_attr_store+0x14/0x20)
      [<c0203290>] (kobj_attr_store+0x14/0x20) from [<c0157530>] (sysfs_write_file+0xfc/0x164)
      [<c0157530>] (sysfs_write_file+0xfc/0x164) from [<c00fd6b0>] (vfs_write+0xbc/0x1bc)
      [<c00fd6b0>] (vfs_write+0xbc/0x1bc) from [<c00fdaf0>] (SyS_write+0x40/0x68)
      [<c00fdaf0>] (SyS_write+0x40/0x68) from [<c000ea80>] (ret_fast_syscall+0x0/0x3c)
      
      The clocks may be already disabled before suspending. Check PM runtime
      suspend status and disable clocks only if device is not suspended.
      During resume do not enable the clocks if device is runtime suspended.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      9d7fd21a
    • Krzysztof Kozlowski's avatar
      spi/s3c64xx: Do not ignore return value of spi_master_resume/suspend · 347de6ba
      Krzysztof Kozlowski authored
      During PM resume and suspend do not ignore the return value of
      spi_master_suspend() or spi_master_resume(). Instead pass it further.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      347de6ba