+ ps3-ignore-storage-devices-that-are-still-being.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     PS3: ignore storage devices that are still being probed
has been added to the -mm tree.  Its filename is
     ps3-ignore-storage-devices-that-are-still-being.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: PS3: ignore storage devices that are still being probed
From: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>

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 <Geert.Uytterhoeven@xxxxxxxxxxx>
Acked-by: Geoff Levand <geoffrey.levand@xxxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/powerpc/platforms/ps3/platform.h   |    1 
 arch/powerpc/platforms/ps3/repository.c |   29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff -puN arch/powerpc/platforms/ps3/platform.h~ps3-ignore-storage-devices-that-are-still-being arch/powerpc/platforms/ps3/platform.h
--- a/arch/powerpc/platforms/ps3/platform.h~ps3-ignore-storage-devices-that-are-still-being
+++ a/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 -puN arch/powerpc/platforms/ps3/repository.c~ps3-ignore-storage-devices-that-are-still-being arch/powerpc/platforms/ps3/repository.c
--- a/arch/powerpc/platforms/ps3/repository.c~ps3-ignore-storage-devices-that-are-still-being
+++ a/arch/powerpc/platforms/ps3/repository.c
@@ -349,6 +349,35 @@ int ps3_repository_find_device(struct ps
 		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);
 
_

Patches currently in -mm which might be from Geert.Uytterhoeven@xxxxxxxxxxx are

git-scsi-misc.patch
ps3-ignore-storage-devices-that-are-still-being.patch
fbdev-fb_create_modedb-non-static-int-first-=-1.patch
fbdev-fb_create_modedb-non-static-int-first-=-1-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux