aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2012-09-21 12:04:24 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-04 11:30:29 -0400
commit9b6934a3b449266850149b717597408354039e95 (patch)
treeb78cd5db43f49c88afa9ee27e1a7a4ff8e196334 /drivers/tty
parent4ed5978bdd99114db7773cb3d78f2998bd17f694 (diff)
xen/hvc: handle backend CLOSED without CLOSING
Backend drivers shouldn't transistion to CLOSED unless the frontend is CLOSED. If a backend does transition to CLOSED too soon then the frontend may not see the CLOSING state and will not properly shutdown. So, treat an unexpected backend CLOSED state the same as CLOSING. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/hvc/hvc_xen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 2944ff88fdc0..f4abfe238f98 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -478,7 +478,6 @@ static void xencons_backend_changed(struct xenbus_device *dev,
478 case XenbusStateInitialising: 478 case XenbusStateInitialising:
479 case XenbusStateInitialised: 479 case XenbusStateInitialised:
480 case XenbusStateUnknown: 480 case XenbusStateUnknown:
481 case XenbusStateClosed:
482 break; 481 break;
483 482
484 case XenbusStateInitWait: 483 case XenbusStateInitWait:
@@ -488,6 +487,10 @@ static void xencons_backend_changed(struct xenbus_device *dev,
488 xenbus_switch_state(dev, XenbusStateConnected); 487 xenbus_switch_state(dev, XenbusStateConnected);
489 break; 488 break;
490 489
490 case XenbusStateClosed:
491 if (dev->state == XenbusStateClosed)
492 break;
493 /* Missed the backend's CLOSING state -- fallthrough */
491 case XenbusStateClosing: 494 case XenbusStateClosing:
492 xenbus_frontend_closed(dev); 495 xenbus_frontend_closed(dev);
493 break; 496 break;