summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/ctcm_main.c
diff options
context:
space:
mode:
authorFrank Blaschka <frank.blaschka@de.ibm.com>2009-11-12 21:46:28 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-13 20:46:59 -0800
commit1e1815be87e45ce512f998ab35e9554c25031f4d (patch)
treecdea8e94953577889386289d10b750426aade29c /drivers/s390/net/ctcm_main.c
parentb7c2aecc0747f5c86a1959bce6a7ce8170a556b0 (diff)
ctcm: suspend has to wait for outstanding I/O
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/ctcm_main.c')
-rw-r--r--drivers/s390/net/ctcm_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index db054ed1a8c..ecac3b2e32d 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1720,6 +1720,11 @@ static int ctcm_pm_suspend(struct ccwgroup_device *gdev)
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;