Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [PATCH 2/2] drm/xe/vf: Perform early GT MMIO initialization to read GMDID
Date: Mon, 2 Dec 2024 19:38:53 +0100	[thread overview]
Message-ID: <20241202183853.7liw6iungfopyp6h@intel.com> (raw)
In-Reply-To: <20241114175955.2299-3-michal.wajdeczko@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on czw [2024-lis-14 18:59:55 +0100]:
> VFs need to communicate with the GuC to obtain the GMDID value
> and existing GuC functions used for that assume that the GT has
> it's MMIO members already setup. However, due to recent refactoring
> the gt->mmio is initialized later, and any attempt by the VF to use
> xe_mmio_read|write() from GuC functions will lead to NPD crash due
> to unset MMIO register address:
> 
> [] xe 0000:00:02.1: [drm] Running in SR-IOV VF mode
> [] xe 0000:00:02.1: [drm] GT0: sending H2G MMIO 0x5507
> [] BUG: unable to handle page fault for address: 0000000000190240
> 
> Since we are already tweaking the id and type of the primary GT to
> mimic it's a Media GT before initializing the GuC communication,
> we can also call xe_gt_mmio_init() to perform early setup of the
> gt->mmio which will make those GuC functions work again.
> 
> Fixes: 58548b91101f ("drm/xe: Defer gt->mmio initialization until after multi-tile setup")
> Fixes: 0afda5d7bba4 ("drm/xe/pci: Convert register access to use xe_mmio")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 9b81e7d00a86..8388a92c8fc2 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -507,6 +507,7 @@ static void read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver,
>  			gt->info.type = XE_GT_TYPE_MAIN;
>  		}
>  
> +		xe_gt_mmio_init(gt);
>  		xe_guc_comm_init_early(&gt->uc.guc);
>  
>  		/* Don't bother with GMDID if failed to negotiate the GuC ABI */

LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

> -- 
> 2.43.0
> 

-- 

  reply	other threads:[~2024-12-02 18:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 17:59 [PATCH 0/2] VF: Fix early read of GDMID Michal Wajdeczko
2024-11-14 17:59 ` [PATCH 1/2] drm/xe: Always setup GT MMIO adjustment data Michal Wajdeczko
2024-11-14 19:23   ` Lucas De Marchi
2024-11-14 19:36     ` Michal Wajdeczko
2024-11-19 20:33       ` Lucas De Marchi
2024-12-03 20:37         ` Matt Roper
2024-12-09 14:44           ` Lucas De Marchi
2025-01-14 16:32             ` Lucas De Marchi
2024-11-14 17:59 ` [PATCH 2/2] drm/xe/vf: Perform early GT MMIO initialization to read GMDID Michal Wajdeczko
2024-12-02 18:38   ` Piotr Piórkowski [this message]
2025-01-14 21:13   ` [PATCH v2 " Michal Wajdeczko
2024-11-14 19:41 ` ✓ CI.Patch_applied: success for VF: Fix early read of GDMID Patchwork
2024-11-14 19:41 ` ✓ CI.checkpatch: " Patchwork
2024-11-14 19:42 ` ✓ CI.KUnit: " Patchwork
2024-11-14 19:54 ` ✓ CI.Build: " Patchwork
2024-11-14 19:56 ` ✓ CI.Hooks: " Patchwork
2024-11-14 19:58 ` ✓ CI.checksparse: " Patchwork
2024-11-14 20:23 ` ✓ CI.BAT: " Patchwork
2024-11-15 15:07 ` ✗ CI.FULL: failure " Patchwork
2025-01-14 20:40   ` Michal Wajdeczko
2025-01-15  0:48 ` ✓ CI.Patch_applied: success for VF: Fix early read of GDMID (rev2) Patchwork
2025-01-15  0:48 ` ✓ CI.checkpatch: " Patchwork
2025-01-15  0:49 ` ✓ CI.KUnit: " Patchwork
2025-01-15  1:08 ` ✓ CI.Build: " Patchwork
2025-01-15  1:10 ` ✓ CI.Hooks: " Patchwork
2025-01-15  1:11 ` ✓ CI.checksparse: " Patchwork
2025-01-15  1:38 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-15 11:07 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-18 20:57   ` Michal Wajdeczko

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=20241202183853.7liw6iungfopyp6h@intel.com \
    --to=piotr.piorkowski@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@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