diff options
| -rw-r--r-- | drivers/acpi/apei/erst.c | 2 | ||||
| -rw-r--r-- | drivers/firmware/efi/efi-pstore.c | 2 | ||||
| -rw-r--r-- | fs/pstore/platform.c | 17 | ||||
| -rw-r--r-- | fs/pstore/ram.c | 2 | ||||
| -rw-r--r-- | include/linux/pstore.h | 8 |
5 files changed, 21 insertions, 10 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index f096ab3cb54d..ec4f507b524f 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
| @@ -938,7 +938,7 @@ static int erst_clearer(enum pstore_type_id type, u64 id, int count, | |||
| 938 | static struct pstore_info erst_info = { | 938 | static struct pstore_info erst_info = { |
| 939 | .owner = THIS_MODULE, | 939 | .owner = THIS_MODULE, |
| 940 | .name = "erst", | 940 | .name = "erst", |
| 941 | .flags = PSTORE_FLAGS_FRAGILE, | 941 | .flags = PSTORE_FLAGS_DMESG, |
| 942 | .open = erst_open_pstore, | 942 | .open = erst_open_pstore, |
| 943 | .close = erst_close_pstore, | 943 | .close = erst_close_pstore, |
| 944 | .read = erst_reader, | 944 | .read = erst_reader, |
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c index 30a24d09ea6c..4daa5acd9117 100644 --- a/drivers/firmware/efi/efi-pstore.c +++ b/drivers/firmware/efi/efi-pstore.c | |||
| @@ -362,7 +362,7 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
| 362 | static struct pstore_info efi_pstore_info = { | 362 | static struct pstore_info efi_pstore_info = { |
| 363 | .owner = THIS_MODULE, | 363 | .owner = THIS_MODULE, |
| 364 | .name = "efi", | 364 | .name = "efi", |
| 365 | .flags = PSTORE_FLAGS_FRAGILE, | 365 | .flags = PSTORE_FLAGS_DMESG, |
| 366 | .open = efi_pstore_open, | 366 | .open = efi_pstore_open, |
| 367 | .close = efi_pstore_close, | 367 | .close = efi_pstore_close, |
| 368 | .read = efi_pstore_read, | 368 | .read = efi_pstore_read, |
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 16ecca5b72d8..76dd604a0f2c 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
| @@ -659,13 +659,14 @@ int pstore_register(struct pstore_info *psi) | |||
| 659 | if (pstore_is_mounted()) | 659 | if (pstore_is_mounted()) |
| 660 | pstore_get_records(0); | 660 | pstore_get_records(0); |
| 661 | 661 | ||
| 662 | pstore_register_kmsg(); | 662 | if (psi->flags & PSTORE_FLAGS_DMESG) |
| 663 | 663 | pstore_register_kmsg(); | |
| 664 | if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) { | 664 | if (psi->flags & PSTORE_FLAGS_CONSOLE) |
| 665 | pstore_register_console(); | 665 | pstore_register_console(); |
| 666 | if (psi->flags & PSTORE_FLAGS_FTRACE) | ||
| 666 | pstore_register_ftrace(); | 667 | pstore_register_ftrace(); |
| 668 | if (psi->flags & PSTORE_FLAGS_PMSG) | ||
| 667 | pstore_register_pmsg(); | 669 | pstore_register_pmsg(); |
| 668 | } | ||
| 669 | 670 | ||
| 670 | if (pstore_update_ms >= 0) { | 671 | if (pstore_update_ms >= 0) { |
| 671 | pstore_timer.expires = jiffies + | 672 | pstore_timer.expires = jiffies + |
| @@ -689,12 +690,14 @@ EXPORT_SYMBOL_GPL(pstore_register); | |||
| 689 | 690 | ||
| 690 | void pstore_unregister(struct pstore_info *psi) | 691 | void pstore_unregister(struct pstore_info *psi) |
| 691 | { | 692 | { |
| 692 | if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) { | 693 | if (psi->flags & PSTORE_FLAGS_PMSG) |
| 693 | pstore_unregister_pmsg(); | 694 | pstore_unregister_pmsg(); |
| 695 | if (psi->flags & PSTORE_FLAGS_FTRACE) | ||
| 694 | pstore_unregister_ftrace(); | 696 | pstore_unregister_ftrace(); |
| 697 | if (psi->flags & PSTORE_FLAGS_CONSOLE) | ||
| 695 | pstore_unregister_console(); | 698 | pstore_unregister_console(); |
| 696 | } | 699 | if (psi->flags & PSTORE_FLAGS_DMESG) |
| 697 | pstore_unregister_kmsg(); | 700 | pstore_unregister_kmsg(); |
| 698 | 701 | ||
| 699 | free_buf_for_compression(); | 702 | free_buf_for_compression(); |
| 700 | 703 | ||
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 2340262a7e97..c2ebf5084977 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
| @@ -623,6 +623,8 @@ static int ramoops_probe(struct platform_device *pdev) | |||
| 623 | goto fail_clear; | 623 | goto fail_clear; |
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | cxt->pstore.flags = PSTORE_FLAGS_ALL; | ||
| 627 | |||
| 626 | err = pstore_register(&cxt->pstore); | 628 | err = pstore_register(&cxt->pstore); |
| 627 | if (err) { | 629 | if (err) { |
| 628 | pr_err("registering with pstore failed\n"); | 630 | pr_err("registering with pstore failed\n"); |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 899e95e84400..f5806b2a6f7a 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
| @@ -74,7 +74,13 @@ struct pstore_info { | |||
| 74 | void *data; | 74 | void *data; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | #define PSTORE_FLAGS_FRAGILE 1 | 77 | #define PSTORE_FLAGS_DMESG (1 << 0) |
| 78 | #define PSTORE_FLAGS_FRAGILE PSTORE_FLAGS_DMESG | ||
| 79 | #define PSTORE_FLAGS_CONSOLE (1 << 1) | ||
| 80 | #define PSTORE_FLAGS_FTRACE (1 << 2) | ||
| 81 | #define PSTORE_FLAGS_PMSG (1 << 3) | ||
| 82 | |||
| 83 | #define PSTORE_FLAGS_ALL ((1 << 4) - 1) | ||
| 78 | 84 | ||
| 79 | extern int pstore_register(struct pstore_info *); | 85 | extern int pstore_register(struct pstore_info *); |
| 80 | extern void pstore_unregister(struct pstore_info *); | 86 | extern void pstore_unregister(struct pstore_info *); |
