28.04.2020 19:04, Dmitry Osipenko пишет:
...
>>>>>>>> + ret = pm_runtime_get_sync(csi->dev);
>>>>>>>> + if (ret < 0) {
>>>>>>>> + dev_err(csi->dev,
>>>>>>>> + "failed to get runtime PM: %d\n",
>>>>>>>> ret);
>>>>>>>> + pm_runtime_put_noidle(csi->dev);
>>> Why this pm_runtime_put_noidle() is needed? This should be wrong, please
>>> remove it.
>>
>> pm_runtime_get_sync() increments power.usage_count prior to rpm_resume
>>
>> if rpm_resume fails it does not decrement usage_count.
>>
>> So to balance count on failure, calling pm_runtime_put_noidle()
>
> Hmm.. maybe you're right. I'll need to take a more detailed look.
>
I checked the RPM's use-count after error condition and yours variant is
correct. Perhaps we should start correcting all other Tegra drivers that
do not handle the RPM error properly.