powerpc/mm: Remove dcache flush from memory remove.
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Wed, 3 Feb 2021 04:58:12 +0000 (10:28 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 11 Feb 2021 12:35:07 +0000 (23:35 +1100)
commit2ac02e5ecec0cc2484d60a73b1bc6394aa2fad28
tree237e70db4346b211cbe50348d0af40544bc5b470
parentec94b9b23d620d40ab2ced094a30c22bb8d69b9f
powerpc/mm: Remove dcache flush from memory remove.

We added dcache flush on memory add/remove in commit
fb5924fddf9e ("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
7fd6641de28f ("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
ea458effa88e ("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 fb5924fddf9e ("powerpc/mm: Flush
cache on memory hot(un)plug") is nvlink device with coherent memory.
The support for that was removed in commit
7eb3cf761927 ("powerpc/powernv: remove unused NPU DMA code") and
commit 25b2995a35b6 ("mm: remove MEMORY_DEVICE_PUBLIC support")

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210203045812.234439-3-aneesh.kumar@linux.ibm.com
arch/powerpc/mm/mem.c
arch/powerpc/platforms/powernv/memtrace.c