aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-01 20:51:25 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-11-29 23:38:50 -0500
commit9a866b870880065364c894823257e6982103d4e4 (patch)
treec84405cef523bbfdd2df93e23a09771fe0d1ab75 /arch/powerpc/platforms/pseries
parentedc79a2f3ee1c74d915f6a0ce3cb22bf468f5ad5 (diff)
powerpc/nvram: Rename ppc64,linux partition to ibm,rtas-log
I'm not aware of any userspace tool accessing it by its name anyways, it's read back by the kernel itself on the next boot to get back older log entries Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c23
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
43static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) 45static 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 }