[Intel-xe] [PATCH v2 1/2] drm/xe: Always invalidate GGTT on map during driver load

Matthew Brost matthew.brost at intel.com
Wed Apr 5 13:46:02 UTC 2023


On Wed, Apr 05, 2023 at 01:50:34PM +0100, Matthew Auld wrote:
> On Wed, 5 Apr 2023 at 03:40, Matthew Brost <matthew.brost at intel.com> wrote:
> >
> > Coalescing GGTT invalidations should work but it creating an issue where
> > the driver sporadically fails to load. For now just disable coalescing
> > during load.
> >
> > Should fix:
> > https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/232
> >
> > Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> 
> Any idea why we don't currently add any 4K padding for
> insert_special_node() users? Don't we need padding for all GGTT
> allocations due to overfetch + coalescing?
> 

Good catch, I wonder if that is causing problems as I swear I thoroughly
tested this before this was merged. Let me look into this a bit more
today.

Matt

> > ---
> >  drivers/gpu/drm/xe/xe_ggtt.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> > index a430d1568890..55d0c2554f7b 100644
> > --- a/drivers/gpu/drm/xe/xe_ggtt.c
> > +++ b/drivers/gpu/drm/xe/xe_ggtt.c
> > @@ -263,6 +263,7 @@ int xe_ggtt_insert_special_node(struct xe_ggtt *ggtt, struct drm_mm_node *node,
> >
> >  void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
> >  {
> > +       struct xe_gt *gt = ggtt->gt;
> >         u64 start = bo->ggtt_node.start;
> >         u64 offset, pte;
> >
> > @@ -278,8 +279,12 @@ void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
> >                 xe_ggtt_set_pte(ggtt, start + bo->size, pte);
> >         }
> >
> > -       if (ggtt->invalidate) {
> > -               xe_ggtt_invalidate(ggtt->gt);
> > +       /*
> > +        * XXX: Unsure why without invalidation on every map during driver load
> > +        * we can fail the driver load.
> > +        */
> > +       if (ggtt->invalidate || !gt->uc.guc.submission_state.enabled) {
> > +               xe_ggtt_invalidate(gt);
> >                 ggtt->invalidate = false;
> >         }
> >  }
> > --
> > 2.34.1
> >


More information about the Intel-xe mailing list