From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Chris P Wilson <chris.p.wilson@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftest: Disable IRQ for timestamp calculation
Date: Wed, 01 Dec 2021 17:34:22 -0800 [thread overview]
Message-ID: <87y253yeld.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20211130132005.6305-1-anshuman.gupta@intel.com>
On Tue, 30 Nov 2021 05:20:05 -0800, Anshuman Gupta wrote:
>
> gt_pm selftest calculates engine ticks cycles and wall time
> cycles by delta of respective engine elapsed TIMESTAMP and ktime
> for period of 1000us.
> It compares the engine ticks cycles with wall time cycles.
>
> Disable local cpu interrupt so that interrupt handler does not
> switch out the thread during measure_clocks() and prevent
> miscalculation of engine tick cycles.
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> v2:
> - nuke preempt_{disable,enable}, as disable_local_irq()
> disable the preemption. (Chris)
>
> Cc: Chris P Wilson <chris.p.wilson@intel.com>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
> drivers/gpu/drm/i915/gt/selftest_gt_pm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> index b9441217ca3d..55c5cdb99f45 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> @@ -43,7 +43,7 @@ static void measure_clocks(struct intel_engine_cs *engine,
> int i;
>
> for (i = 0; i < 5; i++) {
> - preempt_disable();
> + local_irq_disable();
> cycles[i] = -ENGINE_READ_FW(engine, RING_TIMESTAMP);
> dt[i] = ktime_get();
>
> @@ -51,7 +51,7 @@ static void measure_clocks(struct intel_engine_cs *engine,
>
> dt[i] = ktime_sub(ktime_get(), dt[i]);
> cycles[i] += ENGINE_READ_FW(engine, RING_TIMESTAMP);
> - preempt_enable();
> + local_irq_enable();
> }
>
> /* Use the median of both cycle/dt; close enough */
> --
> 2.26.2
>
next prev parent reply other threads:[~2021-12-02 1:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 13:20 [Intel-gfx] [PATCH] drm/i915/selftest: Disable IRQ for timestamp calculation Anshuman Gupta
2021-11-30 14:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftest: Disable IRQ for timestamp calculation (rev3) Patchwork
2021-11-30 18:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-12-03 8:40 ` Anshuman Gupta
2021-12-03 16:38 ` Vudum, Lakshminarayana
2021-12-02 1:34 ` Dixit, Ashutosh [this message]
2021-12-03 16:30 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
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=87y253yeld.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=chris.p.wilson@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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