• Dave Gordon's avatar
    drm/i915/guc: (re)initialise doorbell h/w when enabling GuC submission · 4d75787b
    Dave Gordon authored
    During a hibernate/resume cycle, the whole system is reset, including
    the GuC and the doorbell hardware. Then the system is booted up, drivers
    are loaded, etc -- the GuC firmware may be loaded and set running at
    this point. But then, the booted kernel is replaced by the hibernated
    image, and this resumed kernel will also try to reload the GuC firmware
    (which will fail). To recover, we reset the GuC and try again (which
    should work). But this GuC reset doesn't also reset the doorbell
    hardware, so it can be left in a state inconsistent with that assumed
    by the driver and/or the newly-loaded GuC firmware.
    
    It would be better if the GuC reset also cleared all doorbell state,
    but that's not how the hardware currently works; also, the driver cannot
    directly reprogram the doorbell hardware (only the GuC can do that).
    
    So this patch cycles through all doorbells, assigning and releasing each
    in turn, so that all the doorbell hardware is left in a consistent
    state, no matter how it was programmed by the previously-running kernel
    and/or GuC firmware.
    
    v2: don't use kmap_atomic() now that client page 0 is kept mapped.
    Signed-off-by: default avatarDave Gordon <david.s.gordon@intel.com>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/1465837054-16245-2-git-send-email-david.s.gordon@intel.com
    4d75787b
i915_guc_submission.c 30.9 KB