diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/nvram.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index 55a7141131f1..7e828ba29bc3 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c | |||
@@ -40,6 +40,8 @@ struct err_log_info { | |||
40 | #define NVRAM_MAX_REQ 2079 | 40 | #define NVRAM_MAX_REQ 2079 |
41 | #define NVRAM_MIN_REQ 1055 | 41 | #define NVRAM_MIN_REQ 1055 |
42 | 42 | ||
43 | #define NVRAM_LOG_PART_NAME "ibm,rtas-log" | ||
44 | |||
43 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) | 45 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) |
44 | { | 46 | { |
45 | unsigned int i; | 47 | unsigned int i; |
@@ -262,8 +264,8 @@ int nvram_clear_error_log(void) | |||
262 | * error logs and cleanup partitions if needed. | 264 | * error logs and cleanup partitions if needed. |
263 | * | 265 | * |
264 | * The general strategy is the following: | 266 | * The general strategy is the following: |
265 | * 1.) If there is ppc64,linux partition large enough then use it. | 267 | * 1.) If there is log partition large enough then use it. |
266 | * 2.) If there is not a ppc64,linux partition large enough, search | 268 | * 2.) If there is none large enough, search |
267 | * for a free partition that is large enough. | 269 | * for a free partition that is large enough. |
268 | * 3.) If there is not a free partition large enough remove | 270 | * 3.) If there is not a free partition large enough remove |
269 | * _all_ OS partitions and consolidate the space. | 271 | * _all_ OS partitions and consolidate the space. |
@@ -281,34 +283,35 @@ static int __init pseries_nvram_init_log_partition(void) | |||
281 | nvram_scan_partitions(); | 283 | nvram_scan_partitions(); |
282 | 284 | ||
283 | /* Lookg for ours */ | 285 | /* Lookg for ours */ |
284 | p = nvram_find_partition("ppc64,linux", NVRAM_SIG_OS, &size); | 286 | p = nvram_find_partition(NVRAM_LOG_PART_NAME, NVRAM_SIG_OS, &size); |
285 | 287 | ||
286 | /* Found one but too small, remove it */ | 288 | /* Found one but too small, remove it */ |
287 | if (p && size < NVRAM_MIN_REQ) { | 289 | if (p && size < NVRAM_MIN_REQ) { |
288 | pr_info("nvram: Found too small ppc64,linux partition" | 290 | pr_info("nvram: Found too small "NVRAM_LOG_PART_NAME" partition" |
289 | ",removing it..."); | 291 | ",removing it..."); |
290 | nvram_remove_partition("ppc64,linux", NVRAM_SIG_OS); | 292 | nvram_remove_partition(NVRAM_LOG_PART_NAME, NVRAM_SIG_OS); |
291 | p = 0; | 293 | p = 0; |
292 | } | 294 | } |
293 | 295 | ||
294 | /* Create one if we didn't find */ | 296 | /* Create one if we didn't find */ |
295 | if (!p) { | 297 | if (!p) { |
296 | p = nvram_create_partition("ppc64,linux", NVRAM_SIG_OS, | 298 | p = nvram_create_partition(NVRAM_LOG_PART_NAME, NVRAM_SIG_OS, |
297 | NVRAM_MAX_REQ, NVRAM_MIN_REQ); | 299 | NVRAM_MAX_REQ, NVRAM_MIN_REQ); |
298 | /* No room for it, try to get rid of any OS partition | 300 | /* No room for it, try to get rid of any OS partition |
299 | * and try again | 301 | * and try again |
300 | */ | 302 | */ |
301 | if (p == -ENOSPC) { | 303 | if (p == -ENOSPC) { |
302 | pr_info("nvram: No room to create ppc64,linux" | 304 | pr_info("nvram: No room to create "NVRAM_LOG_PART_NAME |
303 | " partition, deleting all OS partitions..."); | 305 | " partition, deleting all OS partitions..."); |
304 | nvram_remove_partition(NULL, NVRAM_SIG_OS); | 306 | nvram_remove_partition(NULL, NVRAM_SIG_OS); |
305 | p = nvram_create_partition("ppc64,linux", NVRAM_SIG_OS, | 307 | p = nvram_create_partition(NVRAM_LOG_PART_NAME, |
306 | NVRAM_MAX_REQ, NVRAM_MIN_REQ); | 308 | NVRAM_SIG_OS, NVRAM_MAX_REQ, |
309 | NVRAM_MIN_REQ); | ||
307 | } | 310 | } |
308 | } | 311 | } |
309 | 312 | ||
310 | if (p <= 0) { | 313 | if (p <= 0) { |
311 | pr_err("nvram: Failed to find or create ppc64,linux" | 314 | pr_err("nvram: Failed to find or create "NVRAM_LOG_PART_NAME |
312 | " partition, err %d\n", (int)p); | 315 | " partition, err %d\n", (int)p); |
313 | return 0; | 316 | return 0; |
314 | } | 317 | } |