linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Simon Horman <horms@verge.net.au>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Chris Brandt <Chris.Brandt@renesas.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] clocksource/drivers/ostm: Use unique device name instead of ostm
Date: Fri, 16 Aug 2019 15:18:06 +0200	[thread overview]
Message-ID: <CAMuHMdWVJQ7T06O0Mxj4Zxq9OrMYaVfXyhZSc4_wSi_EbnMohw@mail.gmail.com> (raw)
In-Reply-To: <20190816131129.eh4jgsdle77kulaq@verge.net.au>

Hi Simon,

On Fri, Aug 16, 2019 at 3:11 PM Simon Horman <horms@verge.net.au> wrote:
> On Wed, Aug 07, 2019 at 10:46:35AM +0200, Geert Uytterhoeven wrote:
> > Currently all OSTM devices are called "ostm", also in kernel messages.
> >
> > As there can be multiple instances in an SoC, this can confuse the user.
> > Hence construct a unique name from the DT node name, like is done for
> > platform devices.
> >
> > On RSK+RZA1, the boot log changes like:
> >
> >     -clocksource: ostm: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns
> >     +clocksource: ostm fcfec000.timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns
> >      sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 64440619504ns
> >     -ostm: used for clocksource
> >     -ostm: used for clock events
> >     +ostm fcfec000.timer: used for clocksource
> >     +ostm fcfec400.timer: used for clock events
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v3:
> >   - Make the name format similar to the one used for platform devices,
> >   - Use kasprintf() instead of buffer size guessing,
> >   - Use a real example from rskrza1.
> >
> > v2 (by Jacopo):
> >   - Use np->full_name.
> > ---
> >  drivers/clocksource/renesas-ostm.c | 45 ++++++++++++++++++++----------
> >  1 file changed, 30 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c
> > index 1e22e54d7b0df40d..659e3ec7b86714e3 100644
> > --- a/drivers/clocksource/renesas-ostm.c
> > +++ b/drivers/clocksource/renesas-ostm.c

> > @@ -195,22 +195,35 @@ static int __init ostm_init(struct device_node *np)
> >       if (!ostm)
> >               return -ENOMEM;
> >
> > -     ostm->base = of_iomap(np, 0);
> > -     if (!ostm->base) {
> > +     ret = of_address_to_resource(np, 0, &res);
> > +     if (ret) {
> > +             pr_err("ostm: Failed to obtain I/O memory\n");
> > +             goto err_free;
> > +     }
> > +
> > +     ostm->name = kasprintf(GFP_KERNEL, "ostm %llx.%s",
> > +                            (unsigned long long)res.start, np->name);
>
> I'm not sure, but looking at printk-formats.rst it seems that
> %pa[p] as a format specifier for resource_size_t. If so it may
> allow dropping the cast above.

Using "%pa" adds a "0x" prefix, which we don't want here.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2019-08-16 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07  8:46 [PATCH v3 0/3] clocksource/drivers/ostm: Miscellaneous improvements Geert Uytterhoeven
2019-08-07  8:46 ` [PATCH v3 1/3] clocksource/drivers/renesas-ostm: Use DIV_ROUND_CLOSEST() helper Geert Uytterhoeven
2019-08-16 12:58   ` Simon Horman
2019-08-16 13:00     ` Daniel Lezcano
2019-08-07  8:46 ` [PATCH v3 2/3] clocksource/drivers/renesas-ostm: Fix probe error path Geert Uytterhoeven
2019-08-07 18:13   ` Daniel Lezcano
2019-08-07 18:56     ` Geert Uytterhoeven
2019-08-16 13:19     ` Simon Horman
2019-08-07  8:46 ` [PATCH v3 3/3] clocksource/drivers/ostm: Use unique device name instead of ostm Geert Uytterhoeven
2019-08-16 13:11   ` Simon Horman
2019-08-16 13:12     ` Simon Horman
2019-08-16 13:18     ` Geert Uytterhoeven [this message]
2019-08-21 14:12       ` Simon Horman

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=CAMuHMdWVJQ7T06O0Mxj4Zxq9OrMYaVfXyhZSc4_wSi_EbnMohw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=Chris.Brandt@renesas.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=jacopo+renesas@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).