]> asedeno.scripts.mit.edu Git - linux.git/commit
i2c: rcar: Fix clients using i2c from suspend callback
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 22 Jan 2019 10:03:57 +0000 (11:03 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 22 Jan 2019 22:55:08 +0000 (23:55 +0100)
commit81d696c7c4ff8c981333159d072da65268bfe6d5
tree7cd27763869f0e4b8c6ab5b707f1ff36a59eff14
parent3d5b38684951564d07e3f4bb482ef9491f49ced1
i2c: rcar: Fix clients using i2c from suspend callback

When doing s2idle/s2ram on Salvator-X(S):

    WARNING: CPU: 2 PID: 971 at drivers/i2c/i2c-core-base.c:1869 __i2c_transfer+0x608/0x910
[...]
    Call trace:
     __i2c_transfer+0x608/0x910
     i2c_smbus_xfer_emulated+0x158/0x5b0
     __i2c_smbus_xfer+0x17c/0x818
     i2c_smbus_xfer+0x64/0x98
     i2c_smbus_read_byte_data+0x40/0x70
     cs2000_bset.isra.1+0x2c/0x68
     __cs2000_set_rate.constprop.7+0x80/0x148
     cs2000_resume+0x18/0x20
     dpm_run_callback+0x74/0x330
     device_resume_early+0xd4/0x120
     dpm_resume_early+0x158/0x4f8
     suspend_devices_and_enter+0x36c/0xd98
[...]

On second resume, the sound driver fails with:

    cs2000-cp 2-004f: pll lock failed
    rcar_sound ec500000.sound: can't use clk 1

As the CS2000 clock driver needs to send I2C messages during suspend,
the I2C controller driver should be suspended later, and resumed
earlier.  Fix this by using the noirq sleep ops instead of the normal
sleep ops, which are called after the late sleep ops, as used by the
CS2000 clock driver.

Fixes: 18569fa89a4db9ed ("i2c: rcar: add suspend/resume support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-rcar.c