hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/fs/pstore/ram.c
....@@ -301,13 +301,13 @@
301301 }
302302 }
303303
304
-#ifdef CONFIG_PSTORE_MCU_LOG
304
+#ifdef CONFIG_PSTORE_BOOT_LOG
305305 if (!prz_ok(prz)) {
306
- while (cxt->mcu_log_read_cnt < cxt->max_mcu_log_cnt && !prz) {
307
- prz = ramoops_get_next_prz(cxt->mcu_przs, &cxt->mcu_log_read_cnt,
308
- cxt->max_mcu_log_cnt, &record->id,
306
+ while (cxt->boot_log_read_cnt < cxt->max_boot_log_cnt && !prz) {
307
+ prz = ramoops_get_next_prz(cxt->boot_przs, &cxt->boot_log_read_cnt,
308
+ cxt->max_boot_log_cnt, &record->id,
309309 &record->type,
310
- PSTORE_TYPE_MCU_LOG, 0);
310
+ PSTORE_TYPE_BOOT_LOG, 0);
311311 if (!prz_ok(prz))
312312 continue;
313313 }
....@@ -320,9 +320,9 @@
320320 }
321321
322322 size = persistent_ram_old_size(prz) - header_length;
323
-#ifdef CONFIG_PSTORE_MCU_LOG
324
- /* don't copy mcu log */
325
- if (record->type == PSTORE_TYPE_MCU_LOG)
323
+#ifdef CONFIG_PSTORE_BOOT_LOG
324
+ /* don't copy boot log */
325
+ if (record->type == PSTORE_TYPE_BOOT_LOG)
326326 goto out;
327327 #endif
328328 /* ECC correction notice */
....@@ -529,13 +529,13 @@
529529 kfree(cxt->fprzs);
530530 cxt->max_ftrace_cnt = 0;
531531 }
532
-#ifdef CONFIG_PSTORE_MCU_LOG
533
- /* Free mcu log PRZs */
534
- if (cxt->mcu_przs) {
535
- for (i = 0; i < cxt->max_mcu_log_cnt; i++)
536
- persistent_ram_free(cxt->mcu_przs[i]);
537
- kfree(cxt->mcu_przs);
538
- cxt->max_mcu_log_cnt = 0;
532
+#ifdef CONFIG_PSTORE_BOOT_LOG
533
+ /* Free boot log PRZs */
534
+ if (cxt->boot_przs) {
535
+ for (i = 0; i < cxt->max_boot_log_cnt; i++)
536
+ persistent_ram_free(cxt->boot_przs[i]);
537
+ kfree(cxt->boot_przs);
538
+ cxt->max_boot_log_cnt = 0;
539539 }
540540 #endif
541541 }
....@@ -716,9 +716,9 @@
716716 parse_size("pmsg-size", pdata->pmsg_size);
717717 parse_size("ecc-size", pdata->ecc_info.ecc_size);
718718 parse_size("flags", pdata->flags);
719
-#ifdef CONFIG_PSTORE_MCU_LOG
720
- parse_size("mcu-log-size", pdata->mcu_log_size);
721
- parse_size("mcu-log-count", pdata->max_mcu_log_cnt);
719
+#ifdef CONFIG_PSTORE_BOOT_LOG
720
+ parse_size("boot-log-size", pdata->boot_log_size);
721
+ parse_size("boot-log-count", pdata->max_boot_log_cnt);
722722 #endif
723723 #undef parse_size
724724
....@@ -760,9 +760,9 @@
760760 goto fail_out;
761761 }
762762
763
-#ifdef CONFIG_PSTORE_MCU_LOG
763
+#ifdef CONFIG_PSTORE_BOOT_LOG
764764 if (!pdata->mem_size || (!pdata->record_size && !pdata->console_size &&
765
- !pdata->ftrace_size && !pdata->pmsg_size && !pdata->mcu_log_size)) {
765
+ !pdata->ftrace_size && !pdata->pmsg_size && !pdata->boot_log_size)) {
766766 pr_err("The memory size and the record/console size must be "
767767 "non-zero\n");
768768 goto fail_out;
....@@ -797,17 +797,28 @@
797797 cxt->dump_oops = pdata->dump_oops;
798798 cxt->flags = pdata->flags;
799799 cxt->ecc_info = pdata->ecc_info;
800
-#ifdef CONFIG_PSTORE_MCU_LOG
801
- cxt->mcu_log_size = pdata->mcu_log_size;
802
- cxt->max_mcu_log_cnt = pdata->max_mcu_log_cnt;
800
+#ifdef CONFIG_PSTORE_BOOT_LOG
801
+ cxt->boot_log_size = pdata->boot_log_size;
802
+ cxt->max_boot_log_cnt = pdata->max_boot_log_cnt;
803803 #endif
804804
805805 paddr = cxt->phys_addr;
806806
807807 dump_mem_sz = cxt->size - cxt->console_size - cxt->ftrace_size
808808 - cxt->pmsg_size;
809
-#ifdef CONFIG_PSTORE_MCU_LOG
810
- dump_mem_sz -= cxt->mcu_log_size;
809
+#ifdef CONFIG_PSTORE_BOOT_LOG
810
+ dump_mem_sz -= cxt->boot_log_size;
811
+#endif
812
+
813
+#ifdef CONFIG_PSTORE_BOOT_LOG
814
+ err = ramoops_init_przs("boot_log", dev, cxt, &cxt->boot_przs, &paddr,
815
+ cxt->boot_log_size, -1,
816
+ &cxt->max_boot_log_cnt, 0, 0);
817
+ if (err)
818
+ goto fail_clear;
819
+ if (cxt->boot_log_size > 0)
820
+ for (i = 0; i < cxt->max_boot_log_cnt; i++)
821
+ pr_info("boot-log-%d\t0x%zx@%pa\n", i, cxt->boot_przs[i]->size, &cxt->boot_przs[i]->paddr);
811822 #endif
812823
813824 err = ramoops_init_przs("dump", dev, cxt, &cxt->dprzs, &paddr,
....@@ -848,17 +859,6 @@
848859 if (cxt->pmsg_size > 0)
849860 pr_info("pmsg\t0x%zx@%pa\n", cxt->mprz->size, &cxt->mprz->paddr);
850861
851
-#ifdef CONFIG_PSTORE_MCU_LOG
852
- err = ramoops_init_przs("mcu_log", dev, cxt, &cxt->mcu_przs, &paddr,
853
- cxt->mcu_log_size, -1,
854
- &cxt->max_mcu_log_cnt, 0, 0);
855
- if (err)
856
- goto fail_clear;
857
- if (cxt->mcu_log_size > 0)
858
- for (i = 0; i < cxt->max_mcu_log_cnt; i++)
859
- pr_info("mcu-log-%d\t0x%zx@%pa\n", i, cxt->mcu_przs[i]->size, &cxt->mcu_przs[i]->paddr);
860
-#endif
861
-
862862 cxt->pstore.data = cxt;
863863 /*
864864 * Prepare frontend flags based on which areas are initialized.
....@@ -875,9 +875,9 @@
875875 cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
876876 if (cxt->pmsg_size)
877877 cxt->pstore.flags |= PSTORE_FLAGS_PMSG;
878
-#ifdef CONFIG_PSTORE_MCU_LOG
879
- if (cxt->mcu_log_size)
880
- cxt->pstore.flags |= PSTORE_FLAGS_MCU_LOG;
878
+#ifdef CONFIG_PSTORE_BOOT_LOG
879
+ if (cxt->boot_log_size)
880
+ cxt->pstore.flags |= PSTORE_FLAGS_BOOT_LOG;
881881 #endif
882882
883883 /*