Skip to content

Commit 545daf9

Browse files
Naoya TezukaTzung-Bi Shih
authored andcommitted
platform/chrome: chromeos_pstore: Add ecc_size module parameter
On ChromiumOS devices, the `ecc_size` is set to 0 (check dmesg | grep ecc  to see `ecc: 0`): this disables ECC for ramoops region, even when  `ramoops.ecc=1` is given to kernel command line parameter. Introduce `ecc_size` module parameter to provide a method to turn on ECC for ramoops and set different values of ecc_size per devices. A large `ecc_size` value can cause a kernel panic due to a constraint in Reed-Solomon code library. The validation for this constraint should belong to the common pstore RAM layer, not in each individual driver. So this check is handled by a separate patch [1]. [1] https://lore.kernel.org/lkml/[email protected] Signed-off-by: Naoya Tezuka <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 8866f4e commit 545daf9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/platform/chrome/chromeos_pstore.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include <linux/platform_device.h>
1010
#include <linux/pstore_ram.h>
1111

12+
static int ecc_size;
13+
module_param(ecc_size, int, 0400);
14+
MODULE_PARM_DESC(ecc_size, "ECC parity data size in bytes. A positive value enables ECC for the ramoops region.");
15+
1216
static const struct dmi_system_id chromeos_pstore_dmi_table[] __initconst = {
1317
{
1418
/*
@@ -117,6 +121,9 @@ static int __init chromeos_pstore_init(void)
117121
{
118122
bool acpi_dev_found;
119123

124+
if (ecc_size > 0)
125+
chromeos_ramoops_data.ecc_info.ecc_size = ecc_size;
126+
120127
/* First check ACPI for non-hardcoded values from firmware. */
121128
acpi_dev_found = chromeos_check_acpi();
122129

0 commit comments

Comments
 (0)