[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190821141207.wpjodltdidgr5lir@verge.net.au>
Date: Wed, 21 Aug 2019 16:12:07 +0200
From: Simon Horman <horms@...ge.net.au>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jacopo Mondi <jacopo+renesas@...ndi.org>,
Chris Brandt <Chris.Brandt@...esas.com>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] clocksource/drivers/ostm: Use unique device name
instead of ostm
On Fri, Aug 16, 2019 at 03:18:06PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
>
> On Fri, Aug 16, 2019 at 3:11 PM Simon Horman <horms@...ge.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@...der.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.
Thanks, got it.
Powered by blists - more mailing lists