| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | + |
|---|
| 3 | +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| 4 | + |
|---|
| 2 | 5 | #include <linux/init.h> |
|---|
| 3 | 6 | #include <linux/sched.h> |
|---|
| 4 | 7 | #include <linux/kthread.h> |
|---|
| .. | .. |
|---|
| 6 | 9 | #include <linux/memblock.h> |
|---|
| 7 | 10 | |
|---|
| 8 | 11 | #include <asm/proto.h> |
|---|
| 12 | +#include <asm/setup.h> |
|---|
| 9 | 13 | |
|---|
| 10 | 14 | /* |
|---|
| 11 | 15 | * Some BIOSes seem to corrupt the low 64k of memory during events |
|---|
| .. | .. |
|---|
| 41 | 45 | return ret; |
|---|
| 42 | 46 | |
|---|
| 43 | 47 | memory_corruption_check = val; |
|---|
| 48 | + |
|---|
| 44 | 49 | return 0; |
|---|
| 45 | 50 | } |
|---|
| 46 | 51 | early_param("memory_corruption_check", set_corruption_check); |
|---|
| .. | .. |
|---|
| 128 | 133 | } |
|---|
| 129 | 134 | |
|---|
| 130 | 135 | if (num_scan_areas) |
|---|
| 131 | | - printk(KERN_INFO "Scanning %d areas for low memory corruption\n", num_scan_areas); |
|---|
| 136 | + pr_info("Scanning %d areas for low memory corruption\n", num_scan_areas); |
|---|
| 132 | 137 | } |
|---|
| 133 | 138 | |
|---|
| 134 | 139 | |
|---|
| 135 | | -void check_for_bios_corruption(void) |
|---|
| 140 | +static void check_for_bios_corruption(void) |
|---|
| 136 | 141 | { |
|---|
| 137 | 142 | int i; |
|---|
| 138 | 143 | int corruption = 0; |
|---|
| .. | .. |
|---|
| 147 | 152 | for (; size; addr++, size -= sizeof(unsigned long)) { |
|---|
| 148 | 153 | if (!*addr) |
|---|
| 149 | 154 | continue; |
|---|
| 150 | | - printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n", |
|---|
| 151 | | - addr, __pa(addr), *addr); |
|---|
| 155 | + pr_err("Corrupted low memory at %p (%lx phys) = %08lx\n", addr, __pa(addr), *addr); |
|---|
| 152 | 156 | corruption = 1; |
|---|
| 153 | 157 | *addr = 0; |
|---|
| 154 | 158 | } |
|---|
| .. | .. |
|---|
| 172 | 176 | if (!num_scan_areas || !memory_corruption_check || corruption_check_period == 0) |
|---|
| 173 | 177 | return 0; |
|---|
| 174 | 178 | |
|---|
| 175 | | - printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n", |
|---|
| 176 | | - corruption_check_period); |
|---|
| 179 | + pr_info("Scanning for low memory corruption every %d seconds\n", corruption_check_period); |
|---|
| 177 | 180 | |
|---|
| 178 | 181 | /* First time we run the checks right away */ |
|---|
| 179 | 182 | schedule_delayed_work(&bios_check_work, 0); |
|---|
| 183 | + |
|---|
| 180 | 184 | return 0; |
|---|
| 181 | 185 | } |
|---|
| 182 | 186 | device_initcall(start_periodic_check_for_corruption); |
|---|