public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Imberton Guilhem-gimb01 <guilhem.imberton@motorola.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
	"Nayak, Rajendra" <rnayak@ti.com>,
	"Roger Quadros" <ext-roger.quadros@nokia.com>,
	"Kalle Jokiniemi" <ext-kalle.jokiniemi@nokia.com>,
	"Reddy, Teerth" <teerth@ti.com>,
	"Kevin Hilman" <khilman@deeprootsystems.com>,
	"Paul Walmsley" <paul@pwsan.com>,
	"Högander Jouni" <jouni.hogander@nokia.com>,
	"Mike Chan" <mikechan@google.com>
Subject: Re: [PATCH 2/2 v2] OMAP3:PM:SR: SmartReflex Refactor Rev3.0
Date: Thu, 22 Oct 2009 21:40:14 -0500	[thread overview]
Message-ID: <4AE1178E.5060302@ti.com> (raw)
In-Reply-To: <6A943D54E5EAED4BA437305D3EF62FB30326E922@zuk35exm61.ds.mot.com>

Imberton Guilhem-gimb01 had written, on 10/22/2009 04:04 PM, the following:
>  I have one small comment on the actual implementation
>> +     do {
>> +             value = prm_read_mod_reg(OMAP3430_GR_MOD,
>> +                                      OMAP3_PRM_VC_BYPASS_VAL_OFFSET)
>> +                 & OMAP3430_VALID;
>> +             /* should i wait? */
>> +             if (value && (count % 50))
>> +                     udelay(10);
>> +             count--;
>> +             *timeout_us -= 5;
>> +     } while (value && count);
> 
> Why are you removing 5us every read ?
Thanks for catching this. Yep, I have got my counters mixed up :(.. will 
add it as part of v2 for tomorrow evening with other potential comments 
if any.

> If 50 iteration is 1us and we delay every loop by 10us we should remove 11us
> 
> Shouldn't it be:
> 
> +       do {
> +               value = prm_read_mod_reg(OMAP3430_GR_MOD,
> +                                        OMAP3_PRM_VC_BYPASS_VAL_OFFSET)
> +                   & OMAP3430_VALID;
> +               /* should i wait? */
> +               if (value && (count % 50)) {
> +                       udelay(10);
> +                     *timeout_us -= 11;
> +           }
> +               count--;
> +       } while (value && count);
> 
here is a problem with the above logic:
a) I dont know for sure if 50 iterations == 1 uSec.
b) count = timeout*5
   ==> if function is called with timeout = 10 uSec, count = 50, and 
udelay(10) will be called once. now *timeout -=11 will make it a 
negative value, which is not helpeful.

so, the decrement has to be by 10 OR i can pad timeout_us .. not exactly 
useful either..
-- 
Regards,
Nishanth Menon

  reply	other threads:[~2009-10-23  2:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-22 17:27 [PATCH 0/2 v2] OMAP3:PM: refactor Smart Reflex Nishanth Menon
2009-10-22 17:28 ` [PATCH 1/2 v2] OMAP3:PM:SR: prepare: remove old SR code Nishanth Menon
2009-10-22 17:28   ` [PATCH 2/2 v2] OMAP3:PM:SR: SmartReflex Refactor Rev3.0 Nishanth Menon
2009-10-22 21:04     ` Imberton Guilhem-gimb01
2009-10-23  2:40       ` Nishanth Menon [this message]
2009-10-23 10:12         ` Imberton Guilhem-gimb01

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=4AE1178E.5060302@ti.com \
    --to=nm@ti.com \
    --cc=ext-kalle.jokiniemi@nokia.com \
    --cc=ext-roger.quadros@nokia.com \
    --cc=guilhem.imberton@motorola.com \
    --cc=jouni.hogander@nokia.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mikechan@google.com \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=teerth@ti.com \
    /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