All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/3] pci: pcie_dw_rockchip: Use udelay instead of msleep
Date: Fri, 7 May 2021 00:10:25 +0530	[thread overview]
Message-ID: <CANAwSgQfadtTGz31H12BB-7Akr+KyTLRoxpiz-kw8ooGK5bSbQ@mail.gmail.com> (raw)
In-Reply-To: <YIhlq6C4nyTuF1Hu@mone.fritz.box>

Hi Patrick,

On Wed, 28 Apr 2021 at 00:57, Patrick Wildt <patrick@blueri.se> wrote:
>
> Am Tue, Apr 27, 2021 at 11:11:19AM +0530 schrieb Anand Moon:
> > hi Patrick,
> >
> > On Tue, 27 Apr 2021 at 01:38, Patrick Wildt <patrick@blueri.se> wrote:
> > >
> > > Am Mon, Apr 26, 2021 at 01:26:32PM +0000 schrieb Anand Moon:
> > > > Use udelay instead of msleep fix the below warning.
> > >
> > > You sure that's correct? the m in msleep means milli, while the u
> > > in udelay means micro.  That's a factor of 1000 of a difference.
> > >
> > Thanks for your review comments.
> >
> > Most of the u-boot driver prefers udelay and usleep_range internally
> > calls udelay.
> >
> > I don't have the HW to test and verify.
> >
> > -Anand
>
> Sure, I'm not complaining about that.  My point is that if you pass
> e. g. 8 milliseconds to a function that takes microseconds, you need
> to add the factor.
>
> Not good: msleep(1000) -> udelay(1000)
> Much better: msleep(1000) -> udelay(1000 * 1000)
>
> Which also means that you either have to rename PERST_WAIT_MS and change
> its value, or do udelay(PERST_WAIT_MS * 1000)

Thanks for this tip, can we use mdelay as sugged above.
.
static inline void mdelay(unsigned long msec)
{
        udelay(1000 * msec);
}

Thanks
-Anand

  reply	other threads:[~2021-05-06 18:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 13:26 [PATCH 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Anand Moon
2021-04-26 13:26 ` [PATCH 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
2021-05-21 13:21   ` Kever Yang
2021-04-26 13:26 ` [PATCH 3/3] pci: pcie_dw_rockchip: Use udelay instead of msleep Anand Moon
2021-04-26 20:08   ` Patrick Wildt
2021-04-27  5:41     ` Anand Moon
2021-04-27 19:27       ` Patrick Wildt
2021-05-06 18:40         ` Anand Moon [this message]
2021-05-21 13:20   ` Kever Yang
2021-04-26 20:10 ` [PATCH 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Patrick Wildt
2021-04-27  5:40   ` Anand Moon
2021-05-21 13:21 ` Kever Yang
2021-05-21 16:58   ` Anand Moon

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=CANAwSgQfadtTGz31H12BB-7Akr+KyTLRoxpiz-kw8ooGK5bSbQ@mail.gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=u-boot@lists.denx.de \
    --subject='Re: [PATCH 3/3] pci: pcie_dw_rockchip: Use udelay instead of msleep' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.