[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6e34203-3e4b-b804-30a5-bf78445ab366@gmail.com>
Date: Tue, 28 Apr 2020 19:04:41 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Sowjanya Komatineni <skomatineni@...dia.com>,
thierry.reding@...il.com, jonathanh@...dia.com, frankc@...dia.com,
hverkuil@...all.nl
Cc: linux-media@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v1 3/5] media: tegra-video: Move PM runtime handle to
streaming
28.04.2020 18:22, Sowjanya Komatineni пишет:
>
> On 4/28/20 8:15 AM, Dmitry Osipenko wrote:
>> External email: Use caution opening links or attachments
>>
>>
>> 28.04.2020 18:08, Sowjanya Komatineni пишет:
>>> On 4/28/20 7:59 AM, Dmitry Osipenko wrote:
>>>> External email: Use caution opening links or attachments
>>>>
>>>>
>>>> 28.04.2020 17:51, Sowjanya Komatineni пишет:
>>>>> On 4/28/20 6:59 AM, Dmitry Osipenko wrote:
>>>>>> External email: Use caution opening links or attachments
Is it possible to disable this corporate-email message?
>>>>>>
>>>>>>
>>>>>> 28.04.2020 07:20, Sowjanya Komatineni пишет:
>>>>>>> diff --git a/drivers/staging/media/tegra-video/csi.c
>>>>>>> b/drivers/staging/media/tegra-video/csi.c
>>>>>>> index b3dd0c3..29ccdae 100644
>>>>>>> --- a/drivers/staging/media/tegra-video/csi.c
>>>>>>> +++ b/drivers/staging/media/tegra-video/csi.c
>>>>>>> @@ -272,8 +272,25 @@ static int tegra_csi_s_stream(struct
>>>>>>> v4l2_subdev
>>>>>>> *subdev, int enable)
>>>>>>> struct tegra_vi_channel *chan =
>>>>>>> v4l2_get_subdev_hostdata(subdev);
>>>>>>> struct tegra_csi_channel *csi_chan = to_csi_chan(subdev);
>>>>>>> struct tegra_csi *csi = csi_chan->csi;
>>>>>>> + int ret;
>>>>>>> +
>>>>>>> + if (enable && atomic_add_return(1, &csi->clk_refcnt) == 1) {
>>>>>>> + 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.
Powered by blists - more mailing lists