Patchwork [6/6] qeth: fix wait_event_timeout handling

login
register
mail settings
Submitter frank.blaschka@de.ibm.com
Date March 25, 2009, 6:57 a.m.
Message ID <20090325065809.349207000@de.ibm.com>
Download mbox | patch
Permalink /patch/25050/
State Accepted
Headers show

Comments

frank.blaschka@de.ibm.com - March 25, 2009, 6:57 a.m.
From: Heiko Carstens <heiko.carstens@de.ibm.com>

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>
---

 drivers/s390/net/qeth_core_main.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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