diff options
author | David Vrabel <david.vrabel@citrix.com> | 2012-10-18 06:03:38 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-10-30 09:29:07 -0400 |
commit | 2ebb939ab9c6a2484866c5eae4184c83c2b21af8 (patch) | |
tree | 24b5bd880f9ac58c2524620fe08046519bba6219 /drivers/input | |
parent | 01bc825f6311ba2878ae353418eee575d3051594 (diff) |
xen-kbdfront: 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.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/xen-kbdfront.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 02ca8680ea5b..6f7d99013031 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c | |||
@@ -311,7 +311,6 @@ static void xenkbd_backend_changed(struct xenbus_device *dev, | |||
311 | case XenbusStateReconfiguring: | 311 | case XenbusStateReconfiguring: |
312 | case XenbusStateReconfigured: | 312 | case XenbusStateReconfigured: |
313 | case XenbusStateUnknown: | 313 | case XenbusStateUnknown: |
314 | case XenbusStateClosed: | ||
315 | break; | 314 | break; |
316 | 315 | ||
317 | case XenbusStateInitWait: | 316 | case XenbusStateInitWait: |
@@ -350,6 +349,10 @@ InitWait: | |||
350 | 349 | ||
351 | break; | 350 | break; |
352 | 351 | ||
352 | case XenbusStateClosed: | ||
353 | if (dev->state == XenbusStateClosed) | ||
354 | break; | ||
355 | /* Missed the backend's CLOSING state -- fallthrough */ | ||
353 | case XenbusStateClosing: | 356 | case XenbusStateClosing: |
354 | xenbus_frontend_closed(dev); | 357 | xenbus_frontend_closed(dev); |
355 | break; | 358 | break; |