Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102261
b: refs/heads/master
c: 820943b
h: refs/heads/master
i:
  102259: 5cfe674
v: v3
  • Loading branch information
Kenji Kaneshige authored and Jesse Barnes committed Jun 25, 2008
1 parent 6234edb commit c365542
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 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: b30dd56d1c3786fb0c4e442a58d9a2ea78eeabb9
refs/heads/master: 820943b6fc4781621dee52ba026106758a727dd3
25 changes: 14 additions & 11 deletions trunk/drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,23 @@ static inline int pcie_poll_cmd(struct controller *ctrl)
u16 slot_status;
int timeout = 1000;

if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status))
if (slot_status & CMD_COMPLETED)
goto completed;
for (timeout = 1000; timeout > 0; timeout -= 100) {
if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
if (slot_status & CMD_COMPLETED) {
pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
return 1;
}
}
while (timeout > 1000) {
msleep(100);
if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status))
if (slot_status & CMD_COMPLETED)
goto completed;
timeout -= 100;
if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
if (slot_status & CMD_COMPLETED) {
pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
return 1;
}
}
}
return 0; /* timeout */

completed:
pciehp_writew(ctrl, SLOTSTATUS, CMD_COMPLETED);
return timeout;
}

static inline void pcie_wait_cmd(struct controller *ctrl, int poll)
Expand Down

0 comments on commit c365542

Please sign in to comment.