All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC
Date: Wed, 15 Mar 2023 16:54:28 -0700	[thread overview]
Message-ID: <87r0tpwoy3.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <f1334ee6-2fb8-3306-2344-0c93b76a886e@linux.intel.com>

On Wed, 15 Mar 2023 02:50:17 -0700, Tvrtko Ursulin wrote:
>
> On 10/03/2023 00:59, Ashutosh Dixit wrote:
> > The fallback to requested freq does not work for SLPC because SLPC does not
> > use 'struct intel_rps'. Also for SLPC requested freq can only be obtained
> > from a hw register after acquiring forcewake which we don't want to do for
> > PMU. Therefore remove fallback to requested freq for SLPC. The actual freq
> > will be 0 when gt is in RC6 which is correct. Also this is rare since PMU
> > freq sampling happens only when gt is unparked.
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_pmu.c | 9 ++++++++-
> >   1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> > index 7ece883a7d95..f697fabed64a 100644
> > --- a/drivers/gpu/drm/i915/i915_pmu.c
> > +++ b/drivers/gpu/drm/i915/i915_pmu.c
> > @@ -393,7 +393,14 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns)
> >		 * frequency. Fortunately, the read should rarely fail!
> >		 */
> >		val = intel_rps_read_actual_frequency_fw(rps);
> > -		if (!val)
> > +
> > +		/*
> > +		 * SLPC does not use 'struct intel_rps'. Also for SLPC
> > +		 * requested freq can only be obtained after acquiring
> > +		 * forcewake and reading a hw register. For SLPC just
> > +		 * let val be 0
> > +		 */
> > +		if (!val && !intel_uc_uses_guc_slpc(&gt->uc))
> >			val = intel_gpu_freq(rps, rps->cur_freq);
>
> I really dislike sprinkling of "uses slpc" since I think the thing hasn't
> really been integrated nicely. Case in point is probably the flow duality
> in intel_rps_boost. Data structures as well, even though some fields and
> concepts are shared.
>
> For instance why we can't have the notion of software tracked cur_freq in
> rps, and/or have it zero if with SLPC we can't have it otherwise?

For SLPC:

* We can't have the notion of software tracked cur_freq in rps because FW is
  managing the freq.
* rps->cur_freq /is/ actually 0 since SLPC does not use 'struct
  intel_rps'. So this patch doesn't really make any practical difference,
  PMU values will be exactly the same with or without this patch. It was
  just clarifying things.

> I will abstain, sorry.

I will drop this patch, there doesn't seem much point in it.

Thanks.
--
Ashutosh

WARNING: multiple messages have this Message-ID (diff)
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Badal Nilawar <badal.nilawar@intel.com>,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC
Date: Wed, 15 Mar 2023 16:54:28 -0700	[thread overview]
Message-ID: <87r0tpwoy3.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <f1334ee6-2fb8-3306-2344-0c93b76a886e@linux.intel.com>

On Wed, 15 Mar 2023 02:50:17 -0700, Tvrtko Ursulin wrote:
>
> On 10/03/2023 00:59, Ashutosh Dixit wrote:
> > The fallback to requested freq does not work for SLPC because SLPC does not
> > use 'struct intel_rps'. Also for SLPC requested freq can only be obtained
> > from a hw register after acquiring forcewake which we don't want to do for
> > PMU. Therefore remove fallback to requested freq for SLPC. The actual freq
> > will be 0 when gt is in RC6 which is correct. Also this is rare since PMU
> > freq sampling happens only when gt is unparked.
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_pmu.c | 9 ++++++++-
> >   1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> > index 7ece883a7d95..f697fabed64a 100644
> > --- a/drivers/gpu/drm/i915/i915_pmu.c
> > +++ b/drivers/gpu/drm/i915/i915_pmu.c
> > @@ -393,7 +393,14 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns)
> >		 * frequency. Fortunately, the read should rarely fail!
> >		 */
> >		val = intel_rps_read_actual_frequency_fw(rps);
> > -		if (!val)
> > +
> > +		/*
> > +		 * SLPC does not use 'struct intel_rps'. Also for SLPC
> > +		 * requested freq can only be obtained after acquiring
> > +		 * forcewake and reading a hw register. For SLPC just
> > +		 * let val be 0
> > +		 */
> > +		if (!val && !intel_uc_uses_guc_slpc(&gt->uc))
> >			val = intel_gpu_freq(rps, rps->cur_freq);
>
> I really dislike sprinkling of "uses slpc" since I think the thing hasn't
> really been integrated nicely. Case in point is probably the flow duality
> in intel_rps_boost. Data structures as well, even though some fields and
> concepts are shared.
>
> For instance why we can't have the notion of software tracked cur_freq in
> rps, and/or have it zero if with SLPC we can't have it otherwise?

For SLPC:

* We can't have the notion of software tracked cur_freq in rps because FW is
  managing the freq.
* rps->cur_freq /is/ actually 0 since SLPC does not use 'struct
  intel_rps'. So this patch doesn't really make any practical difference,
  PMU values will be exactly the same with or without this patch. It was
  just clarifying things.

> I will abstain, sorry.

I will drop this patch, there doesn't seem much point in it.

Thanks.
--
Ashutosh

  reply	other threads:[~2023-03-15 23:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  0:59 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: Use common freq functions with sysfs Ashutosh Dixit
2023-03-10  0:59 ` Ashutosh Dixit
2023-03-10  0:59 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Use functions common with sysfs to read actual freq Ashutosh Dixit
2023-03-10  0:59   ` Ashutosh Dixit
2023-03-15  9:43   ` [Intel-gfx] " Tvrtko Ursulin
2023-03-15  9:43     ` Tvrtko Ursulin
2023-03-16  0:53     ` [Intel-gfx] " Dixit, Ashutosh
2023-03-16  0:53       ` Dixit, Ashutosh
2023-03-10  0:59 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC Ashutosh Dixit
2023-03-10  0:59   ` Ashutosh Dixit
2023-03-15  9:50   ` [Intel-gfx] " Tvrtko Ursulin
2023-03-15  9:50     ` Tvrtko Ursulin
2023-03-15 23:54     ` Dixit, Ashutosh [this message]
2023-03-15 23:54       ` Dixit, Ashutosh
2023-03-10  2:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pmu: Use common freq functions with sysfs Patchwork
2023-03-12  9:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-03-09  3:46 [Intel-gfx] [PATCH 0/2] " Ashutosh Dixit
2023-03-09  3:46 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC Ashutosh Dixit

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=87r0tpwoy3.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@linux.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.