• Aneesh Kumar K.V's avatar
    powerpc/mm: Remove dcache flush from memory remove. · 2ac02e5e
    Aneesh Kumar K.V authored
    We added dcache flush on memory add/remove in commit
    fb5924fd ("powerpc/mm: Flush cache on memory hot(un)plug") to
    handle crashes on GPU hotplug. Instead of adding dcache flush in
    generic memory add/remove routine which is used even for regular
    memory, we should handle these devices specific flush in the device
    driver code.
    
    memtrace did handle this in the driver and that was removed by commit
    7fd6641d ("powerpc/powernv/memtrace: Let the arch hotunplug code
    flush cache"). This patch reverts that commit.
    
    The dcache flush in memory add was removed by commit
    ea458eff ("powerpc: Don't flush caches when adding memory") which
    I don't think is correct. The reason why we require dcache flush in
    memtrace is to make sure we don't have a dirty cache when we remap a
    pfn to cache inhibited. We should do that when the memtrace module
    removes the memory and make the pfn available for HTM traces to map it
    as cache inhibited.
    
    The other device mentioned in commit fb5924fd ("powerpc/mm: Flush
    cache on memory hot(un)plug") is nvlink device with coherent memory.
    The support for that was removed in commit
    7eb3cf76 ("powerpc/powernv: remove unused NPU DMA code") and
    commit 25b2995a ("mm: remove MEMORY_DEVICE_PUBLIC support")
    Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20210203045812.234439-3-aneesh.kumar@linux.ibm.com
    2ac02e5e
memtrace.c 7.44 KB