[Intel-xe] [PATCH 05/12] drm/xe/mmio: Move memory training check to probe vram

Michał Winiarski michal.winiarski at intel.com
Tue Nov 14 09:48:30 UTC 2023


On Thu, Nov 09, 2023 at 01:57:12PM -0800, Matt Roper wrote:
> On Wed, Nov 08, 2023 at 01:33:37AM +0100, Michał Winiarski wrote:
> > The check doesn't have anything to do with initial MMIO setup. Move it
> > to the place where it belongs.
> 
> Even though it's called "LMEM_INIT," we're supposed to make sure we
> don't touch any GT registers until this bit is set (because the GT won't
> be fully functional until that point).  It looks like if we move it to
> probe_vram, we've already tried to touch GT registers (e.g., under
> xe_irq_install) which might cause problems?
> 

It's not documented very well. Sure - I'll keep it in early probe, to be
called right after MMIO regs for root tile are mapped.

Thanks,
-Michał

> 
> Matt
> 
> > 
> > Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_mmio.c | 24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
> > index 0da4f75c07bf6..f4cddf2dfa3a3 100644
> > --- a/drivers/gpu/drm/xe/xe_mmio.c
> > +++ b/drivers/gpu/drm/xe/xe_mmio.c
> > @@ -254,6 +254,18 @@ int xe_mmio_probe_vram(struct xe_device *xe)
> >  
> >  	/* Get the size of the root tile's vram for later accessibility comparison */
> >  	tile = xe_device_get_root_tile(xe);
> > +
> > +	/*
> > +	 * The boot firmware initializes local memory and assesses its health.
> > +	 * If memory training fails, the punit will have been instructed to
> > +	 * keep the GT powered down; we won't be able to communicate with it
> > +	 * and we should not continue with driver initialization.
> > +	 */
> > +	if (IS_DGFX(xe) && !(xe_mmio_read32(xe_root_mmio_gt(xe), GU_CNTL) & LMEM_INIT)) {
> > +		drm_err(&xe->drm, "VRAM not initialized by firmware\n");
> > +		return -ENODEV;
> > +	}
> > +
> >  	err = xe_mmio_tile_vram_size(tile, &vram_size, &tile_size, &tile_offset);
> >  	if (err)
> >  		return err;
> > @@ -384,7 +396,6 @@ static void mmio_fini(struct drm_device *drm, void *arg)
> >  int xe_mmio_init(struct xe_device *xe)
> >  {
> >  	struct xe_tile *root_tile = xe_device_get_root_tile(xe);
> > -	struct xe_gt *gt = xe_root_mmio_gt(xe);
> >  	const int mmio_bar = 0;
> >  	int err;
> >  
> > @@ -409,17 +420,6 @@ int xe_mmio_init(struct xe_device *xe)
> >  	root_tile->mmio.size = xe->mmio.size;
> >  	root_tile->mmio.regs = xe->mmio.regs;
> >  
> > -	/*
> > -	 * The boot firmware initializes local memory and assesses its health.
> > -	 * If memory training fails, the punit will have been instructed to
> > -	 * keep the GT powered down; we won't be able to communicate with it
> > -	 * and we should not continue with driver initialization.
> > -	 */
> > -	if (IS_DGFX(xe) && !(xe_mmio_read32(gt, GU_CNTL) & LMEM_INIT)) {
> > -		drm_err(&xe->drm, "VRAM not initialized by firmware\n");
> > -		return -ENODEV;
> > -	}
> > -
> >  	err = xe_set_dma_info(xe);
> >  	if (err)
> >  		return err;
> > -- 
> > 2.42.0
> > 
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> Linux GPU Platform Enablement
> Intel Corporation


More information about the Intel-xe mailing list