Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1390288 > unrolled thread

Re: [PATCH 4/9] thermal: rockchip: handle the power sequence for tsadc controller

Started byEduardo Valentin <edubezval@gmail.com>
First post2016-04-28 17:10 +0200
Last post2016-05-03 04:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 4/9] thermal: rockchip: handle the power sequence for  tsadc controller Eduardo Valentin <edubezval@gmail.com> - 2016-04-28 17:10 +0200
    Re: [PATCH 4/9] thermal: rockchip: handle the power sequence for  tsadc controller Caesar Wang <caesar.upstream@gmail.com> - 2016-05-03 04:30 +0200

#1390288 — Re: [PATCH 4/9] thermal: rockchip: handle the power sequence for tsadc controller

FromEduardo Valentin <edubezval@gmail.com>
Date2016-04-28 17:10 +0200
SubjectRe: [PATCH 4/9] thermal: rockchip: handle the power sequence for tsadc controller
Message-ID<rsVJL-5u4-13@gated-at.bofh.it>
On Thu, Apr 28, 2016 at 09:50:29AM +0800, Caesar Wang wrote:
> 
> 
> 在 2016年04月28日 07:48, Eduardo Valentin 写道:
> >On Mon, Apr 18, 2016 at 11:35:56AM +0800, Caesar Wang wrote:
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_ON);
> >>+		mdelay(10);
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_OFF);
> >>+		udelay(100); /* The spec note says at least 15 us */
> >>+		regmap_write(grf, GRF_SARADC_TESTBIT, GRF_SARADC_TESTBIT_ON);
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_H, GRF_TSADC_TESTBIT_H_ON);
> >>+		udelay(200); /* The spec note says at least 90 us */
> >Does it make sense to use usleep_range() instead?
> 
> I think so in the past, but I'm digging into the the udelay/usleep for
> kernel.

What do you mean by in the past? timekeeping doc still recommends the
range 10us to 20ms for usleep_range()

> 
> In general,
> 
> udelay < 10us ~100us
> mdelay > 1m, <1000ms/HZ
> usleep_range(min,max) > 100us, <20ms

even here, your udelays could be replaced by usleep_range().

Any particular reason you believe spining is better than sleeping in
your case?

> msleep > 20ms,  < 1000ms
> 
> So the udelay is suit for tsadc power sequence.
> ---
> 
> 
> Also,  we have used the mdelay(10), so it doesn't matter if use the udelay.
> After all the udelay is stable than the usleep_range.

What do you mean udelay is stable than usleep_range? usleep_range will
give the opportunity to the scheduler to coalesce wakeups. udelay is a
busyloop spin. Besides, I am not sure the current situation, but
busylooping may be affected by cpu frequency.

> 
> -Caesar
> 
> >1.9.1
> >
> >
> >
> >
> >-- 
> >Thanks,
> >Caesar

[toc] | [next] | [standalone]


#1392996

FromCaesar Wang <caesar.upstream@gmail.com>
Date2016-05-03 04:30 +0200
Message-ID<ruyg2-7Lh-11@gated-at.bofh.it>
In reply to#1390288

在 2016年04月28日 23:04, Eduardo Valentin 写道:
> On Thu, Apr 28, 2016 at 09:50:29AM +0800, Caesar Wang wrote:
>>
>> 在 2016年04月28日 07:48, Eduardo Valentin 写道:
>>> On Mon, Apr 18, 2016 at 11:35:56AM +0800, Caesar Wang wrote:
>>>> +		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_ON);
>>>> +		mdelay(10);
>>>> +		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_OFF);
>>>> +		udelay(100); /* The spec note says at least 15 us */
>>>> +		regmap_write(grf, GRF_SARADC_TESTBIT, GRF_SARADC_TESTBIT_ON);
>>>> +		regmap_write(grf, GRF_TSADC_TESTBIT_H, GRF_TSADC_TESTBIT_H_ON);
>>>> +		udelay(200); /* The spec note says at least 90 us */
>>> Does it make sense to use usleep_range() instead?
>> I think so in the past, but I'm digging into the the udelay/usleep for
>> kernel.
> What do you mean by in the past? timekeeping doc still recommends the
> range 10us to 20ms for usleep_range()
>
>> In general,
>>
>> udelay < 10us ~100us
>> mdelay > 1m, <1000ms/HZ
>> usleep_range(min,max) > 100us, <20ms
> even here, your udelays could be replaced by usleep_range().
>
> Any particular reason you believe spining is better than sleeping in
> your case?
>
>> msleep > 20ms,  < 1000ms
>>
>> So the udelay is suit for tsadc power sequence.
>> ---
>>
>>
>> Also,  we have used the mdelay(10), so it doesn't matter if use the udelay.
>> After all the udelay is stable than the usleep_range.
> What do you mean udelay is stable than usleep_range? usleep_range will
> give the opportunity to the scheduler to coalesce wakeups. udelay is a
> busyloop spin. Besides, I am not sure the current situation, but
> busylooping may be affected by cpu frequency.

Okay, thanks for pointing out.

Send the fixes patch on https://patchwork.kernel.org/patch/8999971/

Thank you!


-Caesar
>
>> -Caesar
>>
>>> 1.9.1
>>>
>>>
>>>
>>>
>>> -- 
>>> Thanks,
>>> Caesar
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip


-- 
Thanks,
Caesar

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web