mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yang, Wenyou" <Wenyou.Yang@Microchip.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Jonathan Corbet <corbet@lwn.net>, <linux-kernel@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	<linux-arm-kernel@lists.infradead.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH v3 3/5] media: atmel-isc: Enable the clocks during probe
Date: Mon, 9 Oct 2017 18:01:05 +0800	[thread overview]
Message-ID: <82829609-5c87-538c-2c5d-e99d6c516c60@Microchip.com> (raw)
In-Reply-To: <20171009075804.2qr3pbunqzhdz5go@valkosipuli.retiisi.org.uk>

Hi Sakari,

On 2017/10/9 15:58, Sakari Ailus wrote:
> Hi
> Wenyou,
>
> On Mon, Oct 09, 2017 at 01:49:44PM +0800, Yang, Wenyou wrote:
>> Hi Sakari,
>>
>> Sorry for late answer, because I was in vacation last week.
>>
>> On 2017/9/29 5:25, Sakari Ailus wrote:
>>> Hi Wenyou,
>>>
>>> On Thu, Sep 28, 2017 at 04:18:26PM +0800, Wenyou Yang wrote:
>>>> To meet the relationship, enable the HCLOCK and ispck during the
>>>> device probe, "isc_pck frequency is less than or equal to isc_ispck,
>>>> and isc_ispck is greater than or equal to HCLOCK."
>>>> Meanwhile, call the pm_runtime_enable() in the right place.
>>>>
>>>> Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
>>>> ---
>>>>
>>>> Changes in v3: None
>>>> Changes in v2: None
>>>>
>>>>    drivers/media/platform/atmel/atmel-isc.c | 31 +++++++++++++++++++++++++------
>>>>    1 file changed, 25 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c
>>>> index 0b15dc1a3a0b..f092c95587c1 100644
>>>> --- a/drivers/media/platform/atmel/atmel-isc.c
>>>> +++ b/drivers/media/platform/atmel/atmel-isc.c
>>>> @@ -1594,6 +1594,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
>>>>    	struct isc_subdev_entity *sd_entity;
>>>>    	struct video_device *vdev = &isc->video_dev;
>>>>    	struct vb2_queue *q = &isc->vb2_vidq;
>>>> +	struct device *dev = isc->dev;
>>>>    	int ret;
>>>>    	ret = v4l2_device_register_subdev_nodes(&isc->v4l2_dev);
>>>> @@ -1677,6 +1678,10 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
>>>>    		return ret;
>>>>    	}
>>>> +	pm_runtime_set_active(dev);
>>>> +	pm_runtime_enable(dev);
>>>> +	pm_request_idle(dev);
>>> Remember that the driver's async complete function could never get called.
>>>
>>> What would be the reason to move it here?
>> The ISC provides the clock for the sensor, namely, it is the clock provider
>> for the external sensor.
>> So it keeps active to make the sensor probe successfully.
>> Otherwise, the sensor, such as 0v7670 fails to probe due to the failure to
>> clk_enable().
> You'll still need to balance the get and put calls.
>
> complete callback is not necessarily called at all or could be called
> multiple times. Instead, you should probably do pm_runtime_get_sync() when
> the clock is enabled and put when it's disabled.
I will send v4 to update it.

Thank you for your advice.

Best Regards,
Wenyou Yang

  reply	other threads:[~2017-10-09 10:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28  8:18 [PATCH v3 0/5] media: atmel-isc: Rework the format list and clock provider Wenyou Yang
2017-09-28  8:18 ` [PATCH v3 1/5] media: atmel-isc: Add spin lock for clock enable ops Wenyou Yang
2017-09-28  8:18 ` [PATCH v3 2/5] media: atmel-isc: Add prepare and unprepare ops Wenyou Yang
2017-09-28  8:18 ` [PATCH v3 3/5] media: atmel-isc: Enable the clocks during probe Wenyou Yang
2017-09-28 21:25   ` Sakari Ailus
2017-10-09  5:49     ` Yang, Wenyou
2017-10-09  7:58       ` Sakari Ailus
2017-10-09 10:01         ` Yang, Wenyou [this message]
2017-09-28  8:18 ` [PATCH v3 4/5] media: atmel-isc: Remove unnecessary member Wenyou Yang
2017-09-28  8:18 ` [PATCH v3 5/5] media: atmel-isc: Rework the format list Wenyou Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82829609-5c87-538c-2c5d-e99d6c516c60@Microchip.com \
    --to=wenyou.yang@microchip.com \
    --cc=corbet@lwn.net \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome