Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102241
b: refs/heads/master
c: d737bdc
h: refs/heads/master
i:
  102239: 2a96de7
v: v3
  • Loading branch information
Kenji Kaneshige authored and Jesse Barnes committed Jun 10, 2008
1 parent abd5bef commit 893cca2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 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: 125c39f7d233de28f342d80858025ffed0c4b7f4
refs/heads/master: d737bdc141f0f040171fffbb7f9e08a825b27aab
16 changes: 4 additions & 12 deletions trunk/drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,18 @@ static inline int pcie_poll_cmd(struct controller *ctrl)
return timeout;
}

static inline int pcie_wait_cmd(struct controller *ctrl, int poll)
static inline void pcie_wait_cmd(struct controller *ctrl, int poll)
{
int retval = 0;
unsigned int msecs = pciehp_poll_mode ? 2500 : 1000;
unsigned long timeout = msecs_to_jiffies(msecs);
int rc;

if (poll)
rc = pcie_poll_cmd(ctrl);
else
rc = wait_event_interruptible_timeout(ctrl->queue,
!ctrl->cmd_busy, timeout);
rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout);
if (!rc)
dbg("Command not completed in 1000 msec\n");
else if (rc < 0) {
retval = -EINTR;
info("Command was interrupted by a signal\n");
}

return retval;
}

/**
Expand Down Expand Up @@ -365,7 +357,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
if (!(slot_ctrl & HP_INTR_ENABLE) ||
!(slot_ctrl & CMD_CMPL_INTR_ENABLE))
poll = 1;
retval = pcie_wait_cmd(ctrl, poll);
pcie_wait_cmd(ctrl, poll);
}
out:
mutex_unlock(&ctrl->ctrl_lock);
Expand Down Expand Up @@ -797,7 +789,7 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
if (intr_loc & CMD_COMPLETED) {
ctrl->cmd_busy = 0;
smp_mb();
wake_up_interruptible(&ctrl->queue);
wake_up(&ctrl->queue);
}

if (!(intr_loc & ~CMD_COMPLETED))
Expand Down

0 comments on commit 893cca2

Please sign in to comment.