From nobody@FreeBSD.org  Fri Oct 26 19:06:19 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 245F8910
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Oct 2012 19:06:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 0CEDA8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Oct 2012 19:06:19 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9QJ6Ivh056271
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Oct 2012 19:06:18 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9QJ6I3v056270;
	Fri, 26 Oct 2012 19:06:18 GMT
	(envelope-from nobody)
Message-Id: <201210261906.q9QJ6I3v056270@red.freebsd.org>
Date: Fri, 26 Oct 2012 19:06:18 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] rc.resume doesn't always restore moused to sane state; mouse freaks out in X11
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: crees@FreeBSD.org

>Number:         173133
>Category:       bin
>Synopsis:       [suspend/resume] moused(8) sometimes fails to reinitialise after suspend
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 26 19:10:00 UTC 2012
>Closed-Date:    
>Last-Modified:  Tue Apr 22 05:31:00 UTC 2014
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD tamara.local 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r241971M: Tue Oct 23 18:55:55 PDT 2012     root@tamara.local:/usr/obj/usr/src/sys/NETBOOK  i386
>Description:
Whenever I suspend and resume my netbook, moused freaks out when I try to use the touchpad and the pointer jumps all over the screen in X11 -- probably because the file descriptors aren't closed and reopened in moused properly.

The attached patch mitigates my issues, but probably isn't the correct resolution to the problem.

More details:

atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3

>How-To-Repeat:
1. Install CURRENT on netbook.
2. Start X11 (I use fluxbox).
3. Suspend netbook.
4. Resume netbook.
5. Try to use the mouse.
>Fix:


Patch attached with submission follows:

Index: etc/rc.resume
===================================================================
--- etc/rc.resume	(revision 241971)
+++ etc/rc.resume	(working copy)
@@ -43,9 +43,7 @@
 	echo 'rc.resume: killed rc.suspend that was still around'
 fi
 
-if [ -r /var/run/moused.pid ]; then
-	pkill -HUP -F /var/run/moused.pid
-fi
+service moused quietrestart
 
 # Turns on a power supply of a card in the slot inactivated.
 # See also contrib/pccardq.c (only for PAO users).


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 27 02:28:53 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173133 
Responsible-Changed-From-To: freebsd-rc->glebius 
Responsible-Changed-By: crees 
Responsible-Changed-When: Fri Nov 2 12:01:32 UTC 2012 
Responsible-Changed-Why:  
Subversion blames you, what do you think? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173133 
Responsible-Changed-From-To: glebius->freebsd-rc 
Responsible-Changed-By: crees 
Responsible-Changed-When: Fri Nov 2 12:50:56 UTC 2012 
Responsible-Changed-Why:  
The current code worked for glebius because moused didn't break on his 
machine. 

rc will deal with it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173133 
Responsible-Changed-From-To: freebsd-rc->freebsd-bugs 
Responsible-Changed-By: crees 
Responsible-Changed-When: Sun Nov 4 12:08:19 UTC 2012 
Responsible-Changed-Why:  
Remove [patch] tag from Synopsis and reassign, this is a bug with moused. 

Reading the man page, it should exhibit the correct behaviour when sent 
SIGHUP. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173133 

From: Chris Rees <crees@FreeBSD.org>
To: "bug-followup@freebsd.org" <bug-followup@freebsd.org>
Cc:  
Subject: Re: bin/173133: moused sometimes fails to reinitialise after suspend
Date: Wed, 7 Nov 2012 18:19:19 +0000

 Last bit here--  you haven't got AllowEmptyInput in your xorg.conf have you?
 
 http://www.wonkity.com/~wblock/docs/html/aei.html
 
 Chris
>Unformatted:
