• Andy Lutomirski's avatar
    Add arch_phys_wc_{add, del} to manipulate WC MTRRs if needed · d0d98eed
    Andy Lutomirski authored
    Several drivers currently use mtrr_add through various #ifdef guards
    and/or drm wrappers.  The vast majority of them want to add WC MTRRs
    on x86 systems and don't actually need the MTRR if PAT (i.e.
    ioremap_wc, etc) are working.
    
    arch_phys_wc_add and arch_phys_wc_del are new functions, available
    on all architectures and configurations, that add WC MTRRs on x86 if
    needed (and handle errors) and do nothing at all otherwise.  They're
    also easier to use than mtrr_add and mtrr_del, so the call sites can
    be simplified.
    
    As an added benefit, this will avoid wasting MTRRs and possibly
    warning pointlessly on PAT-supporting systems.
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    d0d98eed
mtrr.h 4.47 KB