From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [RFC] drm/i915/rc6: Access RC6 regs with forcewake
Date: Mon, 25 Apr 2022 09:55:57 +0530 [thread overview]
Message-ID: <5708a76e-8a8b-c4b8-7d93-a265dc7e18ec@intel.com> (raw)
In-Reply-To: <YmLLCLW5R9xzfAAz@mdroper-desk1.amr.corp.intel.com>
On 22-04-2022 21:04, Matt Roper wrote:
> On Fri, Apr 22, 2022 at 07:07:52PM +0530, Badal Nilawar wrote:
>> To access RC6 related MMIO regs use intel_uncore_write(), which grabs
>> forcewake if reg requires a forcewake.
>>
>> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
>> ---
>> drivers/gpu/drm/i915/gt/intel_rc6.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c b/drivers/gpu/drm/i915/gt/intel_rc6.c
>> index b4770690e794..9edaad3f19b5 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_rc6.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_rc6.c
>> @@ -55,7 +55,7 @@ static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc)
>>
>> static void set(struct intel_uncore *uncore, i915_reg_t reg, u32 val)
>> {
>> - intel_uncore_write_fw(uncore, reg, val);
>> + intel_uncore_write(uncore, reg, val);
>
> The set() function is primarily used within the *_rc6_enable() functions.
> Those are all called via intel_rc6_enable() which has already
> grabbed explicit forcewake before calling them:
>
> intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
>
> so there's no need to grab an additional reference on every register
> access. Likewise, the call in vlv_residency_raw() doesn't need
> forcewake because its own caller (intel_rc6_residency_ns) has already
> acquired it.
>
> I think the call in intel_rc6_unpark() is the only one that might be
> questionable from a very quick skim of the code. So rather than
> needlessly grabbing forcewake in all the other spots, it's probably
> better to just replace that single call with a direct call to
> intel_uncore_write() if it actually is problematic.
>
> Even better, we might just want to drop the set() wrapper completely and
> replace all instances with the appropriate intel_uncore_write[_fw]
> calls; I don't really see the slightly shorter lines the wrapper gives
> us as being worth the deviation from the rest of the driver's code
> (especially if it's causing us confusion about what the intendended
> forcewake semantics are).
>
Thanks for clarification.
The change in set() function was done for inte_rc6_unpark/park() only
since 0xA090 RC6_CTRL is getting written without forcewake. For now as
you suggested in inte_rc6_unpark/park() I will replace set() with
intel_uncore_write().
Regards,
Badal
>
> Matt
>
>> }
>>
>> static void gen11_rc6_enable(struct intel_rc6 *rc6)
>> --
>> 2.25.1
>>
>
next prev parent reply other threads:[~2022-04-25 4:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 13:37 [Intel-gfx] [RFC] drm/i915/rc6: Access RC6 regs with forcewake Badal Nilawar
2022-04-22 15:34 ` Matt Roper
2022-04-25 4:25 ` Nilawar, Badal [this message]
2022-04-22 19:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-04-22 23:03 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=5708a76e-8a8b-c4b8-7d93-a265dc7e18ec@intel.com \
--to=badal.nilawar@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox