Commit b4cb2941 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Paul Mackerras

[POWERPC] PS3: Use the HVs storage device notification mechanism properly

The PS3 hypervisor has a storage device notification mechanism to wait
until a storage device is ready.  Unfortunately the storage device
probing code used this mechanism in an incorrect way, needing a
polling loop and handling of devices that are not yet ready.

This change corrects this by:
  - First waiting for the reception of an asynchronous notification
    that a new storage device became ready,
  - Then looking up the storage device in the device repository.

On shutdown, the storage probe thread is stopped and the storage
notification device is closed using a reboot notifier.
Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e06bcf3c
This diff is collapsed.
......@@ -89,8 +89,6 @@ 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,
};
int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
......
......@@ -344,35 +344,6 @@ 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment