Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81331
b: refs/heads/master
c: 972b1f0
h: refs/heads/master
i:
  81329: cf96004
  81327: 97cbe60
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Paul Mackerras committed Jan 25, 2008
1 parent bbf97b5 commit 442e7d5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4cb2941f855993410ca456ef998888434e86098
refs/heads/master: 972b1f040c8698ef2a44ad3f2b790039d5a8ac09
46 changes: 33 additions & 13 deletions trunk/arch/powerpc/platforms/ps3/device-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,38 @@ static int ps3_register_repository_device(
return result;
}

static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
{
struct ps3_repository_device repo;
int res;
unsigned int retries;
unsigned long rem;

/*
* On some firmware versions (e.g. 1.90), the device may not show up
* in the repository immediately
*/
for (retries = 0; retries < 10; retries++) {
res = ps3_repository_find_device_by_id(&repo, bus_id, dev_id);
if (!res)
goto found;

rem = msleep_interruptible(100);
if (rem)
break;
}
pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__,
bus_id, dev_id);
return;

found:
if (retries)
pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
__func__, __LINE__, bus_id, dev_id, retries);

ps3_register_repository_device(&repo);
return;
}

#define PS3_NOTIFICATION_DEV_ID ULONG_MAX
#define PS3_NOTIFICATION_INTERRUPT_ID 0
Expand Down Expand Up @@ -600,7 +632,6 @@ static struct task_struct *probe_task;
static int ps3_probe_thread(void *data)
{
struct ps3_notification_device dev;
struct ps3_repository_device repo;
int res;
unsigned int irq;
u64 lpar;
Expand Down Expand Up @@ -682,18 +713,7 @@ static int ps3_probe_thread(void *data)
continue;
}

res = ps3_repository_find_device_by_id(&repo, dev.sbd.bus_id,
notify_event->dev_id);
if (res) {
pr_warning("%s:%u: device %lu:%lu not found\n",
__func__, __LINE__, dev.sbd.bus_id,
notify_event->dev_id);
continue;
}

pr_debug("%s:%u: device %lu:%lu found\n", __func__, __LINE__,
dev.sbd.bus_id, notify_event->dev_id);
ps3_register_repository_device(&repo);
ps3_find_and_add_device(dev.sbd.bus_id, notify_event->dev_id);

} while (!kthread_should_stop());

Expand Down

0 comments on commit 442e7d5

Please sign in to comment.