All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: shruthi.sanil@intel.com, daniel.lezcano@linaro.org,
	robh+dt@kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Cc: andriy.shevchenko@linux.intel.com, kris.pan@linux.intel.com,
	mgross@linux.intel.com, srikanth.thokala@intel.com,
	lakshmi.bai.raja.subramanian@intel.com,
	mallikarjunappa.sangannavar@intel.com, shruthi.sanil@intel.com
Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
Date: Sun, 26 Sep 2021 23:41:20 +0200	[thread overview]
Message-ID: <87lf3jaubj.ffs@tglx> (raw)
In-Reply-To: <20210906183621.21075-3-shruthi.sanil@intel.com>

On Tue, Sep 07 2021 at 00:06, shruthi sanil wrote:
> +
> +/* Provides a unique ID for each timer */
> +static DEFINE_IDA(keembay_timer_ida);

> +
> +	timer_id = ida_alloc(&keembay_timer_ida, GFP_KERNEL);
> +	if (timer_id < 0) {
> +		ret = timer_id;
> +		goto err_keembay_ce_to_free;
> +	}

May I ask what the purpose of the IDA, which is backed by a full blown
xarray, is here?

AFAICT all you want is a unique number for the timer name for up to 8
timers.

> +	timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d", timer_id);

So what's wrong about:

static unsigned int keembay_timer_id;

	timer_name = kasprintf(GFP_KERNEL, "keembay_timer%d", keembay_timer_id++);

Hmm?

> +
> +	clockevents_config_and_register(&keembay_ce_to->clkevt,
> +					timer_of_rate(keembay_ce_to),
> +					1,
> +					U32_MAX);

Aside of that what's the point of registering more than one of those
timers as clock event? The core will only use one and the rest is just
going to use memory for no value.

Thanks,

        tglx

  reply	other threads:[~2021-09-26 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 18:36 [PATCH v6 0/2] Add the driver for Intel Keem Bay SoC timer block shruthi.sanil
2021-09-06 18:36 ` [PATCH v6 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer shruthi.sanil
2021-09-07 11:49   ` Rob Herring
2021-09-06 18:36 ` [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support shruthi.sanil
2021-09-26 21:41   ` Thomas Gleixner [this message]
2021-11-11 10:42     ` Sanil, Shruthi
2021-12-23 14:16       ` Daniel Lezcano
2021-12-24  9:40         ` Sanil, Shruthi
2021-11-25 17:29     ` Sanil, Shruthi
2021-12-15 16:23     ` Sanil, Shruthi

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=87lf3jaubj.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kris.pan@linux.intel.com \
    --cc=lakshmi.bai.raja.subramanian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mallikarjunappa.sangannavar@intel.com \
    --cc=mgross@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=shruthi.sanil@intel.com \
    --cc=srikanth.thokala@intel.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.