diff options
author | Igor Mammedov <imammedo@redhat.com> | 2011-04-18 13:17:17 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-04-18 13:17:45 -0400 |
commit | c36b58e8a9112017c2bcc322cc98e71241814303 (patch) | |
tree | 64a4a1b7d7719ef40451493a2c049b3b1ddfd5bb /drivers/input/misc | |
parent | 80b4895aa4578e9372d76cd4063f82d0c3994d77 (diff) |
Input: xen-kbdfront - fix mouse getting stuck after save/restore
Mouse gets "stuck" after restore of PV guest but buttons are in working
condition.
If driver has been configured for ABS coordinates at start it will get
XENKBD_TYPE_POS events and then suddenly after restore it'll start getting
XENKBD_TYPE_MOTION events, that will be dropped later and they won't get
into user-space.
Regression was introduced by hunk 5 and 6 of
5ea5254aa0ad269cfbd2875c973ef25ab5b5e9db
("Input: xen-kbdfront - advertise either absolute or relative
coordinates").
Driver on restore should ask xen for request-abs-pointer again if it is
available. So restore parts that did it before 5ea5254.
Acked-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
[v1: Expanded the commit description]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/xen-kbdfront.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 7077f9bf5ead..62bae99424e6 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c | |||
@@ -303,7 +303,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev, | |||
303 | enum xenbus_state backend_state) | 303 | enum xenbus_state backend_state) |
304 | { | 304 | { |
305 | struct xenkbd_info *info = dev_get_drvdata(&dev->dev); | 305 | struct xenkbd_info *info = dev_get_drvdata(&dev->dev); |
306 | int val; | 306 | int ret, val; |
307 | 307 | ||
308 | switch (backend_state) { | 308 | switch (backend_state) { |
309 | case XenbusStateInitialising: | 309 | case XenbusStateInitialising: |
@@ -316,6 +316,17 @@ static void xenkbd_backend_changed(struct xenbus_device *dev, | |||
316 | 316 | ||
317 | case XenbusStateInitWait: | 317 | case XenbusStateInitWait: |
318 | InitWait: | 318 | InitWait: |
319 | ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend, | ||
320 | "feature-abs-pointer", "%d", &val); | ||
321 | if (ret < 0) | ||
322 | val = 0; | ||
323 | if (val) { | ||
324 | ret = xenbus_printf(XBT_NIL, info->xbdev->nodename, | ||
325 | "request-abs-pointer", "1"); | ||
326 | if (ret) | ||
327 | pr_warning("xenkbd: can't request abs-pointer"); | ||
328 | } | ||
329 | |||
319 | xenbus_switch_state(dev, XenbusStateConnected); | 330 | xenbus_switch_state(dev, XenbusStateConnected); |
320 | break; | 331 | break; |
321 | 332 | ||