Files
android_kernel_motorola_sm6225/drivers/spi
Haijian Ma 676f8fd1e4 spi: disable_depth > 0 when pm runtime get sync
when unit suspend, pm_runtime_disalbe() would be called. And
then dev.power.disable_depth number will +1. And its value
will be -1 when pm_runtime_enable() is called.
And if spi bus want to work as soon as system resume, it will call
pm_runtime_get_sync(), which would check the value of
disable_depth. If its value is not 0, spi operation will fail.
The sequence is as following:

runtime_suspend
pm_runtime_disable()-> disable_depth +1
rumtime_resume
pm_runtime_eanble() -> disable_depth -1
spi_sync()
pm_runtime_get_sync -> check the value of disable_depth

But for sometimes, spi operation will earlier than pm_runtime_enable()
called. Then spi_sync() will fail duel to non-zero disable_depth value.
So we add a checking logic before pm_runtime_get_sync() to make sure
disable_depth is 0.
(pick from https://gerrit.mot.com/#/c/1500296/)

Change-Id: I69a0ee3d728ffe3c13d95208f203bd9ed22249b2
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1654438
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:12 -03:00
..
…
…
…
…
…
2020-08-19 08:15:06 +02:00