From: Ursula Braun <ursula.braun@de.ibm.com>
To: davem@davemloft.net, netdev@vger.kernel.org, linux-s390@vger.kernel.org
Cc: schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
Frank Blaschka <frank.blaschka@de.ibm.com>,
Ursula Braun <ursula.braun@de.ibm.com>
Subject: [patch 2/4] [PATCH] ctcm: suspend has to wait for outstanding I/O
Date: Fri, 13 Nov 2009 08:46:28 +0100 [thread overview]
Message-ID: <20091113075050.593503000@linux.vnet.ibm.com> (raw)
In-Reply-To: 20091113074626.078348000@linux.vnet.ibm.com
[-- Attachment #1: 614-ctcm-suspend-wait.diff --]
[-- Type: text/plain, Size: 2270 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
State transition to DEV_STATE_STOPPED indicates all outstanding I/O has
finished. Add wait queue to wait for this state.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
---
drivers/s390/net/ctcm_main.c | 5 +++++
drivers/s390/net/fsm.c | 1 +
drivers/s390/net/fsm.h | 2 ++
3 files changed, 8 insertions(+)
diff -urpN linux-2.6/drivers/s390/net/ctcm_main.c linux-2.6-patched/drivers/s390/net/ctcm_main.c
--- linux-2.6/drivers/s390/net/ctcm_main.c 2009-11-12 14:59:32.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/ctcm_main.c 2009-11-12 14:59:32.000000000 +0100
@@ -1720,6 +1720,11 @@ static int ctcm_pm_suspend(struct ccwgro
return 0;
netif_device_detach(priv->channel[READ]->netdev);
ctcm_close(priv->channel[READ]->netdev);
+ if (!wait_event_timeout(priv->fsm->wait_q,
+ fsm_getstate(priv->fsm) == DEV_STATE_STOPPED, CTCM_TIME_5_SEC)) {
+ netif_device_attach(priv->channel[READ]->netdev);
+ return -EBUSY;
+ }
ccw_device_set_offline(gdev->cdev[1]);
ccw_device_set_offline(gdev->cdev[0]);
return 0;
diff -urpN linux-2.6/drivers/s390/net/fsm.c linux-2.6-patched/drivers/s390/net/fsm.c
--- linux-2.6/drivers/s390/net/fsm.c 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/fsm.c 2009-11-12 14:59:32.000000000 +0100
@@ -27,6 +27,7 @@ init_fsm(char *name, const char **state_
return NULL;
}
strlcpy(this->name, name, sizeof(this->name));
+ init_waitqueue_head(&this->wait_q);
f = kzalloc(sizeof(fsm), order);
if (f == NULL) {
diff -urpN linux-2.6/drivers/s390/net/fsm.h linux-2.6-patched/drivers/s390/net/fsm.h
--- linux-2.6/drivers/s390/net/fsm.h 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/fsm.h 2009-11-12 14:59:32.000000000 +0100
@@ -66,6 +66,7 @@ typedef struct fsm_instance_t {
char name[16];
void *userdata;
int userint;
+ wait_queue_head_t wait_q;
#if FSM_DEBUG_HISTORY
int history_index;
int history_size;
@@ -197,6 +198,7 @@ fsm_newstate(fsm_instance *fi, int newst
printk(KERN_DEBUG "fsm(%s): New state %s\n", fi->name,
fi->f->state_names[newstate]);
#endif
+ wake_up(&fi->wait_q);
}
/**
next prev parent reply other threads:[~2009-11-13 7:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 7:46 [patch 0/4] s390: networking patches for 2.6.33 Ursula Braun
2009-11-13 7:46 ` [patch 1/4] [PATCH] iucv: add work_queue cleanup for suspend Ursula Braun
2009-11-13 7:46 ` Ursula Braun [this message]
2009-11-13 7:46 ` [patch 3/4] [PATCH] s390: remove cu3088 layer for lcs and ctcm Ursula Braun
2009-11-13 7:46 ` [patch 4/4] [PATCH] netiucv: displayed TX bytes value much too high Ursula Braun
2009-11-14 4:49 ` [patch 0/4] s390: networking patches for 2.6.33 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091113075050.593503000@linux.vnet.ibm.com \
--to=ursula.braun@de.ibm.com \
--cc=davem@davemloft.net \
--cc=frank.blaschka@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).