WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] [PV Xen] Mouse stuck after save/restore of guest

To: Olaf Hering <olaf@xxxxxxxxx>, dtor@xxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] [PV Xen] Mouse stuck after save/restore of guest.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 14 Apr 2011 14:38:04 -0400
Cc: Igor Mammedov <imammedo@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 14 Apr 2011 11:38:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110414172649.GA7569@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1302795907-321-1-git-send-email-imammedo@xxxxxxxxxx> <20110414155915.GA23629@xxxxxxxxxxxx> <20110414172649.GA7569@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Apr 14, 2011 at 07:26:50PM +0200, Olaf Hering wrote:
> On Thu, Apr 14, Konrad Rzeszutek Wilk wrote:
> 
> > On Thu, Apr 14, 2011 at 05:45:07PM +0200, Igor Mammedov wrote:
> > >     Mouse 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 5ea5254
> > >     in upstream.
> > > 
> > >     Driver on restore should ask xen for request-abs-pointer
> > >     again if it's available. So restore parts that did it 
> > >     before 5ea5254.
> > 
> > Olaf?
> 
> This change is correct. Thanks for spotting, Igor.

Dmitry,

Was wondering if you are OK pushing this for 2.6.39-rc3 or whether you are OK
with me doing. It fixes a regression introduced by the last hunk of 
5ea5254aa0ad269cfbd2875c973ef25ab5b5e9db

The patch rebase on top of 2.6.39-rc3 looks as so:

(and the patch is in 
git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git 
stable/bug-fixes-rc3)
commit 876f162fe6831273fc5d678fa066f26f58be4a2c
Author: Igor Mammedov <imammedo@xxxxxxxxxx>
Date:   Thu Apr 14 17:45:07 2011 +0200

    Input: xen-kbdfront: Mouse stuck after save/restore of guest.
    
    Mouse 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's available. So restore parts that did it
    before 5ea5254.
    
    CC: Dmitry Torokhov <dtor@xxxxxxx>
    Acked-by: Olaf Hering <olaf@xxxxxxxxx>
    Signed-off-by: Igor Mammedov <imammedo@xxxxxxxxxx>
    [v1: Expanded the commit description]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

diff --git a/drivers/input/misc/xen-kbdfront.c 
b/drivers/input/misc/xen-kbdfront.c
index 7077f9b..6d119d5 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,
                                   enum xenbus_state backend_state)
 {
        struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
-       int val;
+       int ret, val;
 
        switch (backend_state) {
        case XenbusStateInitialising:
@@ -316,6 +316,17 @@ static void xenkbd_backend_changed(struct xenbus_device 
*dev,
 
        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_printf(XBT_NIL, info->xbdev->nodename,
+                                            "request-abs-pointer", "1");
+                        if (ret)
+                                pr_warning("xenkbd: can't request 
abs-pointer");
+                }
+
                xenbus_switch_state(dev, XenbusStateConnected);
                break;
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel