Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d51dd3de87026cb0ea1ea5f873f08e930053bfc5
Commit:     d51dd3de87026cb0ea1ea5f873f08e930053bfc5
Parent:     ef8034d01a080e81488e9cf74052acf1e2a37bd0
Author:     Geert Uytterhoeven <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 6 18:14:57 2007 +0200
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Tue Sep 11 04:30:37 2007 +1000

    [POWERPC] cell/PS3: Ignore storage devices that are still being probed
    
    On PS3, A storage device may show up in the repository before the hypervisor
    has finished probing:
      - If its type is not yet known, it shows up as PS3_DEV_TYPE_STOR_DUMMY,
      - If its regions are being probed, it shows up as having zero regions.
    If any of these happen, consider the device not yet present.  The storage
    probe thread will retry later.
    
    This fixes the timing-dependent problem where a kernel booted from FLASH ROM
    sometimes cannot find the hard disk.
    
    Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]>
    Acked-by: Geoff Levand <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/ps3/platform.h   |    1 +
 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 87d5206..2eb8f92 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -83,6 +83,7 @@ enum ps3_dev_type {
        PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,       /* 5 */
        PS3_DEV_TYPE_SB_GPIO = 6,
        PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,     /* 14 */
+       PS3_DEV_TYPE_STOR_DUMMY = 32,
        PS3_DEV_TYPE_NOACCESS = 255,
 };
 
diff --git a/arch/powerpc/platforms/ps3/repository.c 
b/arch/powerpc/platforms/ps3/repository.c
index 8cc37cf..1c94824 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)
                return result;
        }
 
+       if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
+               /*
+                * A storage device may show up in the repository before the
+                * hypervisor has finished probing its type and regions
+                */
+               unsigned int num_regions;
+
+               if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
+                       pr_debug("%s:%u storage device not ready\n", __func__,
+                                __LINE__);
+                       return -ENODEV;
+               }
+
+               result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
+                                                                 tmp.dev_index,
+                                                                 &num_regions);
+               if (result) {
+                       pr_debug("%s:%d read_stor_dev_num_regions failed\n",
+                                __func__, __LINE__);
+                       return result;
+               }
+
+               if (!num_regions) {
+                       pr_debug("%s:%u storage device has no regions yet\n",
+                                __func__, __LINE__);
+                       return -ENODEV;
+               }
+       }
+
        result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
                &tmp.dev_id);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to