mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
b7c2aecc07
commit
1e1815be87
3 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue