Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 1/7] lib/gt: Fix IGT_NO_FORCEWAKE handling
Date: Mon, 29 Sep 2025 21:11:06 +0300	[thread overview]
Message-ID: <aNrLukKlUUFcrNsa@intel.com> (raw)
In-Reply-To: <pyt6omty62zzgrcedpr2fxdefmvst6frwvckri7nxmt7bo6pk7@jmc7pwo4x5pw>

On Wed, Sep 24, 2025 at 08:22:22AM -0500, Lucas De Marchi wrote:
> On Mon, Sep 22, 2025 at 07:09:43PM +0300, Ville Syrjälä wrote:
> >From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> >igt_open_forcewake_handle_for_pcidev() forgets to check for
> >the IGT_NO_FORCEWAKE environment variable, which is a real
> >problem when one wants to frob the registers without forcing
> >power state changes in the hardware (eg. to observe display
> >low power watermark residencies/etc.)
> >
> >Add the missing IGT_NO_FORCEWAKE check.
> >
> >Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> >Fixes: 114b9ff31d19 ("lib/igt_gt: Add igt_open_forcewake_handle_for_pcidev()")
> >Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
> 
> We should also probably update this comment in lib/intel_mmio.c:
> 
>         /* Find where the forcewake lock is. Forcewake doesn't exist
>          * gen < 6, but the debugfs should do the right things for us.
>          */
>         ret = igt_open_forcewake_handle_for_pcidev(pci_dev);
>         if (ret < 0)
>                 mmio_data->key = FAKEKEY;
> 
> because it's not only about gen < 6, but rather that it can also be
> bypassed.
> 
> Also odd that there's no way to differentiate a real error from a fake
> forcewake.

Are there real errors? I suppose in some cases you might consider the
lack of a driver to be an error, but for me it basically never is.

I suppose one way we could deal with this is to have the caller of
intel_register_access_init() specify whether it wants forcewake or
not. For display stuff we'd never want it, wheras gt stuff (is
presume there is some?) would perhaps always want it.

intel_reg is a much harder problem because sometimes you want
forcewake and sometimes you don't. That could be the case even
for registers that need forcewake because you may want to see
how the hw behaves when you don't have the required forcewake.

And I typically use both intel_reg and other display specific
tools simultaneously so the env variable takes care of everything
for me. Even if we changed the display tools to not take forcewake
I'd still need to set the env variable for intel_reg.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-29 18:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 16:09 [PATCH i-g-t 0/7] tools/intel_display_poller: Various things Ville Syrjala
2025-09-22 16:09 ` [PATCH i-g-t 1/7] lib/gt: Fix IGT_NO_FORCEWAKE handling Ville Syrjala
2025-09-24 13:22   ` Lucas De Marchi
2025-09-29 18:11     ` Ville Syrjälä [this message]
2025-10-02 19:52   ` Michał Grzelak
2025-09-22 16:09 ` [PATCH i-g-t 2/7] tools/intel_display_poller: Fix long opts Ville Syrjala
2025-10-02 19:54   ` Michał Grzelak
2025-10-02 21:22     ` Ville Syrjälä
2025-09-22 16:09 ` [PATCH i-g-t 3/7] tools/intel_display_poller: Use intel_display_ver() instead of intel_gen() Ville Syrjala
2025-10-02 19:54   ` Michał Grzelak
2025-09-22 16:09 ` [PATCH i-g-t 4/7] tools/intel_display_poller: Add --scanline-offset/-o command line option Ville Syrjala
2025-10-02 19:54   ` Michał Grzelak
2025-09-22 16:09 ` [PATCH i-g-t 5/7] tools/intel_display_poller: Add --auto-scanline-offset/-O comamnd " Ville Syrjala
2025-10-02 19:54   ` Michał Grzelak
2025-09-22 16:09 ` [PATCH i-g-t 6/7] tools/intel_display_poller: Add dsb-status-live test Ville Syrjala
2025-10-02 19:55   ` Michał Grzelak
2025-09-22 16:09 ` [PATCH i-g-t 7/7] tools/intel_display_poller: Add --dsb-id/-d command line option Ville Syrjala
2025-10-02 19:55   ` Michał Grzelak
2025-09-22 18:41 ` ✓ i915.CI.BAT: success for tools/intel_display_poller: Various things Patchwork
2025-09-22 18:50 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-22 20:45 ` ✗ i915.CI.Full: failure " Patchwork
2025-09-22 23:21 ` ✓ Xe.CI.Full: 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=aNrLukKlUUFcrNsa@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@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