summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-sis630.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-02-23 14:48:38 +0100
committerWolfram Sang <wsa@kernel.org>2022-03-01 16:30:53 +0100
commitc57813b8b288dcb5e158993cfdff31a60bc24955 (patch)
treec800b6583a537b06a4ebadd4d5eea70d4440e79f /drivers/i2c/busses/i2c-sis630.c
parent5b9df0acd22a0bcd4e0e97e6f8368c31843ceb95 (diff)
i2c: designware: Lock the adapter while setting the suspended flag
Lock the adapter while setting the suspended flag, to ensure that other locked code always sees the change immediately, rather then possibly using a stale value. This involves splitting the suspend/resume callbacks into separate runtime and normal suspend/resume calls. This is necessary because i2c_dw_xfer() will get called by the i2c-core with the adapter locked and it in turn calls the runtime-resume callback through pm_runtime_get_sync(). So the runtime versions of the suspend/resume callbacks cannot take the adapter-lock. Note this patch simply makes the runtime suspend/resume callbacks not deal with the suspended flag at all. During runtime the pm_runtime_get_sync() from i2c_dw_xfer() will always ensure that the adapter is resumed when necessary. The suspended flag check is only necessary to check proper suspend/resume ordering during normal suspend/resume which makes the pm_runtime_get_sync() call a no-op. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-sis630.c')
0 files changed, 0 insertions, 0 deletions