memtest.c (c900529f3d9161bfde5cca0754f83b4d3c3e0220) memtest.c (f1d93b2a010c2c55db86c41ef60c452cf7f99ebc)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/kernel.h>
3#include <linux/types.h>
4#include <linux/init.h>
5#include <linux/memblock.h>
6#include <linux/seq_file.h>
7
8static bool early_memtest_done;

--- 37 unchanged lines hidden (view full) ---

46
47 start_phys_aligned = ALIGN(start_phys, incr);
48 start = __va(start_phys_aligned);
49 end = start + (size - (start_phys_aligned - start_phys)) / incr;
50 start_bad = 0;
51 last_bad = 0;
52
53 for (p = start; p < end; p++)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/kernel.h>
3#include <linux/types.h>
4#include <linux/init.h>
5#include <linux/memblock.h>
6#include <linux/seq_file.h>
7
8static bool early_memtest_done;

--- 37 unchanged lines hidden (view full) ---

46
47 start_phys_aligned = ALIGN(start_phys, incr);
48 start = __va(start_phys_aligned);
49 end = start + (size - (start_phys_aligned - start_phys)) / incr;
50 start_bad = 0;
51 last_bad = 0;
52
53 for (p = start; p < end; p++)
54 *p = pattern;
54 WRITE_ONCE(*p, pattern);
55
56 for (p = start; p < end; p++, start_phys_aligned += incr) {
55
56 for (p = start; p < end; p++, start_phys_aligned += incr) {
57 if (*p == pattern)
57 if (READ_ONCE(*p) == pattern)
58 continue;
59 if (start_phys_aligned == last_bad + incr) {
60 last_bad += incr;
61 continue;
62 }
63 if (start_bad)
64 reserve_bad_mem(pattern, start_bad, last_bad + incr);
65 start_bad = last_bad = start_phys_aligned;

--- 72 unchanged lines hidden ---
58 continue;
59 if (start_phys_aligned == last_bad + incr) {
60 last_bad += incr;
61 continue;
62 }
63 if (start_bad)
64 reserve_bad_mem(pattern, start_bad, last_bad + incr);
65 start_bad = last_bad = start_phys_aligned;

--- 72 unchanged lines hidden ---