diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/repository.c | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 87d52060fec0..2eb8f92704b4 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -83,6 +83,7 @@ enum ps3_dev_type { | |||
83 | PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */ | 83 | PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */ |
84 | PS3_DEV_TYPE_SB_GPIO = 6, | 84 | PS3_DEV_TYPE_SB_GPIO = 6, |
85 | PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */ | 85 | PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */ |
86 | PS3_DEV_TYPE_STOR_DUMMY = 32, | ||
86 | PS3_DEV_TYPE_NOACCESS = 255, | 87 | PS3_DEV_TYPE_NOACCESS = 255, |
87 | }; | 88 | }; |
88 | 89 | ||
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index 8cc37cfea0f2..1c94824f7b63 100644 --- a/arch/powerpc/platforms/ps3/repository.c +++ b/arch/powerpc/platforms/ps3/repository.c | |||
@@ -349,6 +349,35 @@ int ps3_repository_find_device(struct ps3_repository_device *repo) | |||
349 | return result; | 349 | return result; |
350 | } | 350 | } |
351 | 351 | ||
352 | if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) { | ||
353 | /* | ||
354 | * A storage device may show up in the repository before the | ||
355 | * hypervisor has finished probing its type and regions | ||
356 | */ | ||
357 | unsigned int num_regions; | ||
358 | |||
359 | if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) { | ||
360 | pr_debug("%s:%u storage device not ready\n", __func__, | ||
361 | __LINE__); | ||
362 | return -ENODEV; | ||
363 | } | ||
364 | |||
365 | result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index, | ||
366 | tmp.dev_index, | ||
367 | &num_regions); | ||
368 | if (result) { | ||
369 | pr_debug("%s:%d read_stor_dev_num_regions failed\n", | ||
370 | __func__, __LINE__); | ||
371 | return result; | ||
372 | } | ||
373 | |||
374 | if (!num_regions) { | ||
375 | pr_debug("%s:%u storage device has no regions yet\n", | ||
376 | __func__, __LINE__); | ||
377 | return -ENODEV; | ||
378 | } | ||
379 | } | ||
380 | |||
352 | result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index, | 381 | result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index, |
353 | &tmp.dev_id); | 382 | &tmp.dev_id); |
354 | 383 | ||