linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sanil, Shruthi" <shruthi.sanil@intel.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Cc: "andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"kris.pan@linux.intel.com" <kris.pan@linux.intel.com>,
	"mgross@linux.intel.com" <mgross@linux.intel.com>,
	"Thokala, Srikanth" <srikanth.thokala@intel.com>,
	"Raja Subramanian,
	Lakshmi Bai"  <lakshmi.bai.raja.subramanian@intel.com>,
	"Sangannavar,
	Mallikarjunappa"  <mallikarjunappa.sangannavar@intel.com>
Subject: RE: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
Date: Fri, 24 Dec 2021 09:40:53 +0000	[thread overview]
Message-ID: <BN9PR11MB554543CAACA5FD468B6692F9F17F9@BN9PR11MB5545.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f8af5711-4cc4-7513-5ad3-0f17ce04b346@linaro.org>

> -----Original Message-----
> From: Daniel Lezcano <daniel.lezcano@linaro.org>
> Sent: Thursday, December 23, 2021 7:46 PM
> To: Sanil, Shruthi <shruthi.sanil@intel.com>; Thomas Gleixner
> <tglx@linutronix.de>; 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; Thokala, Srikanth <srikanth.thokala@intel.com>;
> Raja Subramanian, Lakshmi Bai <lakshmi.bai.raja.subramanian@intel.com>;
> Sangannavar, Mallikarjunappa <mallikarjunappa.sangannavar@intel.com>
> Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer support
> 
> On 11/11/2021 11:42, Sanil, Shruthi wrote:
> >> -----Original Message-----
> >> From: Thomas Gleixner <tglx@linutronix.de>
> >> Sent: Monday, September 27, 2021 3:11 AM
> >> To: Sanil, Shruthi <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; Thokala, Srikanth
> >> <srikanth.thokala@intel.com>; Raja Subramanian, Lakshmi Bai
> >> <lakshmi.bai.raja.subramanian@intel.com>;
> >> Sangannavar, Mallikarjunappa
> <mallikarjunappa.sangannavar@intel.com>;
> >> Sanil, Shruthi <shruthi.sanil@intel.com>
> >> Subject: Re: [PATCH v6 2/2] clocksource: Add Intel Keem Bay timer
> >> support
> >>
> >> 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?
> >
> > Yes, we had initially implemented it in the similar way, but in the
> > course of review it got changed to use IDA.
> >
> >>
> >>> +
> >>> +	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.
> >
> > Instead of
> > keembay_ce_to->clkevt.cpumask = cpumask_of(0); can I update it as
> > keembay_ce_to->clkevt.cpumask = cpu_possible_mask; so that each timer
> > would be associated with different cores?
> 
> Let me try to clarify:
> 
> The Intel Keem bay Soc is a 4 x Cortex-A53
> 
> The arch ARM timer is per CPU on this platform.
> 
> Case 1:
> -------
>  - the architected timer is not desired and this timer is wanted to be used
> instead (but rating tells the opposite) => rewrite per cpu code
> 
> Case 2:
> -------
>  - the architected timer are desired and this timer is used as a broadcast
> timer when a core is going done with cpuidle. One timer is needed.
> 
>  - In order to prevent useless wakeup, the timer uses the flag DYNIRQ.
> However, cpumask_of(0) is set and makes inoperative this flag. In order to
> make full use of it, clkevt.cpumask must be cpu_possible_mask
> 
> Hope that helps
> 
>   -- Daniel
> 

Thank You Daniel for the explanation.
In case of KMB, we are using the ARM architecture timer.
We would be using the timer for case2. So I need to register Just 1 timer.
I'll check and make the changes accordingly and submit the next patch.

Thank You!
Regards,
Shruthi

> 
> 
> 
> 
> 
> 
> 
> --
> <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
> 
> Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
> <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-
> blog/> Blog

  reply	other threads:[~2021-12-24  9: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
2021-11-11 10:42     ` Sanil, Shruthi
2021-12-23 14:16       ` Daniel Lezcano
2021-12-24  9:40         ` Sanil, Shruthi [this message]
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=BN9PR11MB554543CAACA5FD468B6692F9F17F9@BN9PR11MB5545.namprd11.prod.outlook.com \
    --to=shruthi.sanil@intel.com \
    --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=srikanth.thokala@intel.com \
    --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).