All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-renesas-soc@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [RFC PATCH] clocksource/drivers/sh_cmt: access registers according to spec
Date: Fri, 18 Nov 2022 08:30:30 +0100	[thread overview]
Message-ID: <Y3c0lpl8zzKMnRPO@ninjato> (raw)
In-Reply-To: <CAMuHMdUVmapwN_OHpn4RtQebZCbEi3avka+2MuWpCk59g5UyLA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]


> unsigned int (everywhere)?
> Yes, this is the result of a long-by-long division, but it should be
> a small value anyway.

OK.

> > +       /* Tests showed that we need to wait 3 clocks here */
> > +       unsigned long cmcnt_delay = ch->cmt->reg_delay * 3 / 2;
> 
> DIV_ROUND_UP()

Really here? reg_delay is ensured to be a multiple of two...

> > +       /* We shall wait 2 input clks after register writes */
> > +       if (cmt->info->model >= SH_CMT_48BIT) // FIXME: Really not needed for older ones?
> > +               cmt->reg_delay = 2000000UL / rate + 1;

... but here it would make a lot of sense!

> > +       cmt->rate = cmt->info->width == 16 ? rate / 512 : rate / 8;
> 
> cmt->rate = rate / (cmt->info->width == 16 ? 512 : 8);

OK. I had it without the parens and it looked ugly. With parens it looks
good.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-11-18  7:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 20:21 [RFC PATCH] clocksource/drivers/sh_cmt: access registers according to spec Wolfram Sang
2022-11-16 21:10 ` Wolfram Sang
2022-11-17  8:45 ` Geert Uytterhoeven
2022-11-18  7:30   ` Wolfram Sang [this message]
2022-11-18  8:25     ` Geert Uytterhoeven
2022-11-18  8:30       ` Wolfram Sang
2022-11-18  8:46         ` Geert Uytterhoeven

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=Y3c0lpl8zzKMnRPO@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=geert@linux-m68k.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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 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.