diff options
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/rtasd.c | 7 | ||||
-rw-r--r-- | include/asm-powerpc/nvram.h | 6 |
3 files changed, 13 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 4a4d785a08d3..0ed31f220482 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -38,8 +38,6 @@ static struct nvram_partition * nvram_part; | |||
38 | static long nvram_error_log_index = -1; | 38 | static long nvram_error_log_index = -1; |
39 | static long nvram_error_log_size = 0; | 39 | static long nvram_error_log_size = 0; |
40 | 40 | ||
41 | extern volatile int error_log_cnt; | ||
42 | |||
43 | struct err_log_info { | 41 | struct err_log_info { |
44 | int error_type; | 42 | int error_type; |
45 | unsigned int seq_num; | 43 | unsigned int seq_num; |
@@ -627,7 +625,8 @@ void __exit nvram_cleanup(void) | |||
627 | * sequence #: The unique sequence # for each event. (until it wraps) | 625 | * sequence #: The unique sequence # for each event. (until it wraps) |
628 | * error log: The error log from event_scan | 626 | * error log: The error log from event_scan |
629 | */ | 627 | */ |
630 | int nvram_write_error_log(char * buff, int length, unsigned int err_type) | 628 | int nvram_write_error_log(char * buff, int length, |
629 | unsigned int err_type, unsigned int error_log_cnt) | ||
631 | { | 630 | { |
632 | int rc; | 631 | int rc; |
633 | loff_t tmp_index; | 632 | loff_t tmp_index; |
@@ -665,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type) | |||
665 | * | 664 | * |
666 | * Reads nvram for error log for at most 'length' | 665 | * Reads nvram for error log for at most 'length' |
667 | */ | 666 | */ |
668 | int nvram_read_error_log(char * buff, int length, unsigned int * err_type) | 667 | int nvram_read_error_log(char * buff, int length, |
668 | unsigned int * err_type, unsigned int * error_log_cnt) | ||
669 | { | 669 | { |
670 | int rc; | 670 | int rc; |
671 | loff_t tmp_index; | 671 | loff_t tmp_index; |
@@ -691,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type) | |||
691 | return rc; | 691 | return rc; |
692 | } | 692 | } |
693 | 693 | ||
694 | error_log_cnt = info.seq_num; | 694 | *error_log_cnt = info.seq_num; |
695 | *err_type = info.error_type; | 695 | *err_type = info.error_type; |
696 | 696 | ||
697 | return 0; | 697 | return 0; |
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index b802a272bd29..30925d29bcea 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c | |||
@@ -56,7 +56,7 @@ static int full_rtas_msgs = 0; | |||
56 | /* Stop logging to nvram after first fatal error */ | 56 | /* Stop logging to nvram after first fatal error */ |
57 | static int no_more_logging; | 57 | static int no_more_logging; |
58 | 58 | ||
59 | volatile int error_log_cnt = 0; | 59 | static int error_log_cnt; |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Since we use 32 bit RTAS, the physical address of this must be below | 62 | * Since we use 32 bit RTAS, the physical address of this must be below |
@@ -218,7 +218,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal) | |||
218 | 218 | ||
219 | /* Write error to NVRAM */ | 219 | /* Write error to NVRAM */ |
220 | if (!no_more_logging && !(err_type & ERR_FLAG_BOOT)) | 220 | if (!no_more_logging && !(err_type & ERR_FLAG_BOOT)) |
221 | nvram_write_error_log(buf, len, err_type); | 221 | nvram_write_error_log(buf, len, err_type, error_log_cnt); |
222 | 222 | ||
223 | /* | 223 | /* |
224 | * rtas errors can occur during boot, and we do want to capture | 224 | * rtas errors can occur during boot, and we do want to capture |
@@ -412,7 +412,8 @@ static int rtasd(void *unused) | |||
412 | 412 | ||
413 | /* See if we have any error stored in NVRAM */ | 413 | /* See if we have any error stored in NVRAM */ |
414 | memset(logdata, 0, rtas_error_log_max); | 414 | memset(logdata, 0, rtas_error_log_max); |
415 | rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type); | 415 | rc = nvram_read_error_log(logdata, rtas_error_log_max, |
416 | &err_type, &error_log_cnt); | ||
416 | 417 | ||
417 | if (!rc) { | 418 | if (!rc) { |
418 | if (err_type != ERR_FLAG_ALREADY_LOGGED) { | 419 | if (err_type != ERR_FLAG_ALREADY_LOGGED) { |
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h index f3563e11e260..9877982508bf 100644 --- a/include/asm-powerpc/nvram.h +++ b/include/asm-powerpc/nvram.h | |||
@@ -63,8 +63,10 @@ struct nvram_partition { | |||
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | extern int nvram_write_error_log(char * buff, int length, unsigned int err_type); | 66 | extern int nvram_write_error_log(char * buff, int length, |
67 | extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type); | 67 | unsigned int err_type, unsigned int err_seq); |
68 | extern int nvram_read_error_log(char * buff, int length, | ||
69 | unsigned int * err_type, unsigned int *err_seq); | ||
68 | extern int nvram_clear_error_log(void); | 70 | extern int nvram_clear_error_log(void); |
69 | extern struct nvram_partition *nvram_find_partition(int sig, const char *name); | 71 | extern struct nvram_partition *nvram_find_partition(int sig, const char *name); |
70 | 72 | ||