From: David Vrabel Date: Thu, 18 Oct 2012 10:03:38 +0000 (+0100) Subject: xen-kbdfront: handle backend CLOSED without CLOSING X-Git-Tag: v3.7-rc4~11^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ebb939ab9c6a2484866c5eae4184c83c2b21af8;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: David Vrabel Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 02ca868..6f7d990 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, case XenbusStateReconfiguring: case XenbusStateReconfigured: case XenbusStateUnknown: - case XenbusStateClosed: break; case XenbusStateInitWait: @@ -350,6 +349,10 @@ InitWait: break; + case XenbusStateClosed: + if (dev->state == XenbusStateClosed) + break; + /* Missed the backend's CLOSING state -- fallthrough */ case XenbusStateClosing: xenbus_frontend_closed(dev); break;