[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] kbdfront: repair resolution setting via xenstore


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Thu, 04 May 2017 12:44:02 +0000
  • Delivery-date: Thu, 04 May 2017 12:44:10 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Juergen Gross <jgross@xxxxxxxx>
# Date 1493900943 -7200
#      Thu May 04 14:29:03 2017 +0200
# Node ID 6dceaf8439228ba45948713fdc3136bc0b117383
# Parent  e08ba8d3bafe591e62743749863806b6fe618911
kbdfront: repair resolution setting via xenstore

Setting the pointing device resolution via Xenstore isn't working
reliably: in case XenbusStateInitWait has been missed the resolution
settings won't be read. Correct this.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r e08ba8d3bafe -r 6dceaf843922 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c      Mon Jan 09 12:07:20 2017 +0100
+++ b/drivers/xen/fbfront/xenkbd.c      Thu May 04 14:29:03 2017 +0200
@@ -273,11 +273,28 @@ static void xenkbd_disconnect_backend(st
        info->irq = -1;
 }
 
+static void xenkbd_set_connected(struct xenbus_device *dev)
+{
+       struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
+       int ret, val;
+
+       ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
+                          "feature-abs-pointer", "%d", &val);
+       if (ret > 0 && val) {
+               ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
+                                  "request-abs-pointer", "1");
+               if (ret)
+                       printk(KERN_WARNING "xenkbd: can't request 
abs-pointer");
+       }
+
+       xenbus_switch_state(dev, XenbusStateConnected);
+}
+
 static void xenkbd_backend_changed(struct xenbus_device *dev,
                                   enum xenbus_state backend_state)
 {
        struct xenkbd_info *info = dev->dev.driver_data;
-       int ret, val;
+       int val;
 
        switch (backend_state) {
        case XenbusStateInitialising:
@@ -288,18 +305,7 @@ static void xenkbd_backend_changed(struc
                break;
 
        case XenbusStateInitWait:
-       InitWait:
-               ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
-                                  "feature-abs-pointer", "%d", &val);
-               if (ret < 0)
-                       val = 0;
-               if (val) {
-                       ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
-                                          "request-abs-pointer", "1");
-                       if (ret)
-                               ; /* FIXME */
-               }
-               xenbus_switch_state(dev, XenbusStateConnected);
+               xenkbd_set_connected(dev);
                break;
 
        case XenbusStateConnected:
@@ -309,7 +315,8 @@ static void xenkbd_backend_changed(struc
                 * get Connected twice here.
                 */
                if (dev->state != XenbusStateConnected)
-                       goto InitWait; /* no InitWait seen yet, fudge it */
+                       /* No InitWait seen yet, fudge it. */
+                       xenkbd_set_connected(dev);
 
                /* Set input abs params to match backend screen res */
                if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.