parisc: Report bad pages as HardwareCorrupted
authorHelge Deller <deller@gmx.de>
Fri, 24 Jul 2020 17:17:52 +0000 (19:17 +0200)
committerHelge Deller <deller@gmx.de>
Tue, 28 Jul 2020 09:19:17 +0000 (11:19 +0200)
The /proc/meminfo file reports physically broken memory pages in the
HardwareCorrupted field. When the parisc kernel boots report physically
bad pages which were recorded in the page deallocation table (PDT) as
HardwareCorrupted too.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/pdt.c

index 6e8550f..fcc761b 100644 (file)
@@ -18,6 +18,8 @@
 #include <linux/kthread.h>
 #include <linux/initrd.h>
 #include <linux/pgtable.h>
+#include <linux/swap.h>
+#include <linux/swapops.h>
 
 #include <asm/pdc.h>
 #include <asm/pdcpat.h>
@@ -230,6 +232,7 @@ void __init pdc_pdt_init(void)
 
                /* mark memory page bad */
                memblock_reserve(pdt_entry[i] & PAGE_MASK, PAGE_SIZE);
+               num_poisoned_pages_inc();
        }
 }