qeth: fix wait_event_timeout handling

wait_event_timeout just takes the numnber of jiffies to wait as
an argument. That value does not include jiffies itself.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Heiko Carstens 2009-03-24 20:57:19 +00:00 committed by David S. Miller
parent 8e98ac48d0
commit 7834cd5ae1
1 changed files with 5 additions and 4 deletions

View File

@ -1676,7 +1676,7 @@ int qeth_send_control_data(struct qeth_card *card, int len,
int rc; int rc;
unsigned long flags; unsigned long flags;
struct qeth_reply *reply = NULL; struct qeth_reply *reply = NULL;
unsigned long timeout; unsigned long timeout, event_timeout;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
QETH_DBF_TEXT(TRACE, 2, "sendctl"); QETH_DBF_TEXT(TRACE, 2, "sendctl");
@ -1701,9 +1701,10 @@ int qeth_send_control_data(struct qeth_card *card, int len,
qeth_prepare_control_data(card, len, iob); qeth_prepare_control_data(card, len, iob);
if (IS_IPA(iob->data)) if (IS_IPA(iob->data))
timeout = jiffies + QETH_IPA_TIMEOUT; event_timeout = QETH_IPA_TIMEOUT;
else else
timeout = jiffies + QETH_TIMEOUT; event_timeout = QETH_TIMEOUT;
timeout = jiffies + event_timeout;
QETH_DBF_TEXT(TRACE, 6, "noirqpnd"); QETH_DBF_TEXT(TRACE, 6, "noirqpnd");
spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags); spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags);
@ -1731,7 +1732,7 @@ int qeth_send_control_data(struct qeth_card *card, int len,
if ((cmd->hdr.command == IPA_CMD_SETIP) && if ((cmd->hdr.command == IPA_CMD_SETIP) &&
(cmd->hdr.prot_version == QETH_PROT_IPV4)) { (cmd->hdr.prot_version == QETH_PROT_IPV4)) {
if (!wait_event_timeout(reply->wait_q, if (!wait_event_timeout(reply->wait_q,
atomic_read(&reply->received), timeout)) atomic_read(&reply->received), event_timeout))
goto time_err; goto time_err;
} else { } else {
while (!atomic_read(&reply->received)) { while (!atomic_read(&reply->received)) {