Sometimes loses input devices on suspend/resume: Device has changed - disabling.

Bug #327175 reported by Colin Watson
64
This bug affects 9 people
Affects Status Importance Assigned to Milestone
X.Org X server
Fix Released
Medium
xserver-xorg-input-evdev (Ubuntu)
Fix Released
Medium
Steve Beattie

Bug Description

Binary package hint: xserver-xorg-input-evdev

On the way back from Berlin on Friday, I resumed my laptop on the plane to find that X was no longer accepting keyboard events. I tracked this down as far as EvdevCacheCompare having decided that the keyboard wasn't in the same state as it was on suspend and therefore disabling it. It's possible that this is related to bug 322946, but I don't know whether the position fields are defined for keyboard devices; unfortunately, my laptop ran out of battery before I could get it connected to a network, download debugging symbols, and attach gdb to the X server, which had been my plan.

I've attached all the information I gathered before running out of battery, in the hope that it will be helpful. I was running kernel version 2.6.28-6.17.

The error message was: (EE) AT Translated Set 2 keyboard: Device has changed - disabling.

Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=22734)
Xorg.0.log

Forwarding this bug from a Ubuntu reporter:
https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/327175

[Problem]
On resume, X no longer accepts keyboard events, due to EvdevCacheCompare determining keyboard is not in the same state as was on suspend, and thus disabling it.

[Original Report]
On the way back from Berlin on Friday, I resumed my laptop on the plane to find that X was no longer accepting keyboard events. I tracked this down as far as EvdevCacheCompare having decided that the keyboard wasn't in the same state as it was on suspend and therefore disabling it. It's possible that this is related to bug 322946, but I don't know whether the position fields are defined for keyboard devices; unfortunately, my laptop ran out of battery before I could get it connected to a network, download debugging symbols, and attach gdb to the X server, which had been my plan.

I've attached all the information I gathered before running out of battery, in the hope that it will be helpful. I was running kernel version 2.6.28-6.17.

Revision history for this message
In , Bryce Harrington (bryce) wrote :
Revision history for this message
In , Bryce Harrington (bryce) wrote :

Possibly this is a dupe of #19819

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

Do you have a reproducible testcase?
Is it fixed with 0dbb88c52b057cfdff6116060060841e4fc4abb5 (EvdevCacheCompare:
ignore changes in current device position) or is there more state that is
affected?

Revision history for this message
Bryce Harrington (bryce) wrote : Re: sometimes loses input devices on suspend/resume

Hi Colin,

I've forwarded this bug upstream to https://bugs.freedesktop.org/show_bug.cgi?id=20025 - please subscribe to this bug in case upstream needs further info or wishes you to test something.

Changed in xserver-xorg-input-evdev:
importance: Undecided → High
status: New → Triaged
Changed in xorg-server:
status: Unknown → Confirmed
Revision history for this message
Bryce Harrington (bryce) wrote :

Are you able to reproduce this bug at will? I've uploaded the patch for 322946 to -evdev, so it would be good if you could re-test.

Revision history for this message
In , Colin Watson (cjwatson) wrote :

I've only noticed this once on a system that normally suspends/resumes without problems, so I'm afraid I can't reproduce it consistently. I'll see what I can do ...

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: sometimes loses input devices on suspend/resume

Bryce, I think the best thing would be to patch this code so that it prints out exactly which value changed when comparing with the cache. That way, we could see immediately what the problem is and whether the patch in 322946 would help at all.

Revision history for this message
Bryce Harrington (bryce) wrote :

Okay; try this. (Don't think it's necessary to print all the bitmask values, unless it can be verified the 322946 patch doesn't address the issue.)

Changed in xserver-xorg-input-evdev:
status: Triaged → Incomplete
Revision history for this message
Bryce Harrington (bryce) wrote :

Also, upstream would like to know exact steps to reproduce.

Revision history for this message
Colin Watson (cjwatson) wrote :

This is the first time I've noticed this, so I can't guarantee being able to reproduce at will. I'll see what I can do.

Revision history for this message
Bryce Harrington (bryce) wrote :
Revision history for this message
Matt Zimmerman (mdz) wrote :

I just saw this again:

(EE) ThinkPad Extra Buttons: Device has changed - disabling.

after noticing that my hotkeys stopped working.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I've just updated, but the patch above doesn't seem to have been uploaded yet?

Revision history for this message
Bryce Harrington (bryce) wrote :

I wasn't planning on uploading it to the distro since it's merely an debug instrumentation patch. Do you want me to anyway?

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 327175] Re: sometimes loses input devices on suspend/resume

On Wed, Feb 11, 2009 at 08:59:01AM -0000, Bryce Harrington wrote:
> I wasn't planning on uploading it to the distro since it's merely an
> debug instrumentation patch. Do you want me to anyway?

The error message is not useful as it is, and there may be multiple bugs of
this type. I don't see any harm in providing this extra detail in the error
message, and expect it would be useful to submit upstream as well.

I've built it locally and will watch for a recurrence, but I expect that
there are others experiencing this issue who could diagnose it from their
logs if this patch were included.

--
 - mdz

Matt Zimmerman (mdz)
description: updated
Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=22869)
Adds better error messages for 'Device has changed - disabled' errors

Peter, given the confusion on whether this bug is a duplicate of 19819 or not, it seems that this section of code could benefit from some better error messages, especially since this particular issue seems to be infrequent and hard to reproduce at will. Could you please take this patch upstream?

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

> --- Comment #5 from Bryce Harrington <email address hidden> 2009-02-12 11:01:09 PST ---
> Peter, given the confusion on whether this bug is a duplicate of 19819 or not,
> it seems that this section of code could benefit from some better error
> messages, especially since this particular issue seems to be infrequent and
> hard to reproduce at will. Could you please take this patch upstream?

Thanks. Please change the error messages to state the device name.
xf86Msg(X_ERROR, "%s: bitmask has changed.\n", pInfo->name);
and so on. Debugging the log is easier when you know the device name.

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=22874)
updated patch

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

uhm. did you even compile this patch? pInfo->Name?

Also, please don't mark patches as obsolete if the updated patch depends on them. In this case, just squash the two into one patch and re-attach the one, final, patch (at least compile-time tested...)

Revision history for this message
Bryce Harrington (bryce) wrote :

Setting to medium to match upstream's priority, and also from recent comments, it seems this issue is not easily reproduced. Searching google for the error message, it doesn't turn up very many results (mostly just this bug, bug #216927, and some closed launchpad bugs).

I will upload the patch and forward it to upstream.

Changed in xserver-xorg-input-evdev:
importance: High → Medium
Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=22877)
evdevcachecompare_errmsgs.patch

(In reply to comment #8)
> uhm. did you even compile this patch? pInfo->Name?

Current git tree doesn't build for me on Ubuntu. Some error about AXIS_LABEL_PROP.
2.1.1 builds fine.

> Also, please don't mark patches as obsolete if the updated patch depends on
> them. In this case, just squash the two into one patch and re-attach the one,
> final, patch (at least compile-time tested...)

Sorry, was trying to use git to format the patch, but I'm not very well versed on
git so maybe that wasn't a good idea. Here's a plain patch done manually,
successfully compile-time tested against 2.1.1.

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

> Current git tree doesn't build for me on Ubuntu. Some error about
> AXIS_LABEL_PROP.
> 2.1.1 builds fine.

yeah, you need xserver master for that.
> Sorry, was trying to use git to format the patch, but I'm not very well versed
> on
> git so maybe that wasn't a good idea. Here's a plain patch done manually,
> successfully compile-time tested against 2.1.1.

it was a good idea, non-git patches make the maintainer's life harder. Please
read up on git commit --amend and git rebase -i, and then re-submit a git
formatted patch.

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Wow, surprisingly hard to get this patch upstreamed. :-/

Well, I'm not prepared to upgrade to the git xserver at this point since I'm mostly focusing on stabilizing the Ubuntu xserver currently. But hopefully you got the gist of what I'm proposing, I think it would be helpful for you to get better bug reports from people with this class of issue in the future. I think what I've got in Ubuntu should be sufficient for immediate debugging purposes.

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

> Wow, surprisingly hard to get this patch upstreamed. :-/

huh? All I'm asking for is that you re-format your patch and re-attach it.

> Well, I'm not prepared to upgrade to the git xserver at this point since I'm
> mostly focusing on stabilizing the Ubuntu xserver currently.

afaict, your patch should apply to the evdev-2.1 branch, so you can do the
commit there. no need to update the server.

> But hopefully you got the gist of what I'm proposing, I think it would be
> helpful for you to get better bug reports from people with this class of
> issue in the future. I think what I've got in Ubuntu should be sufficient
> for immediate debugging purposes.

yes, it is helpful. but it would be more helpful if you could just provide a
patch that can be applied upstream, without the upstream maintainer* having to
write a commit message, collate multiple patches into one commit, and ensure
that authorship is correct. it's the difference running a single command and
fiddling around for a couple of minutes.
So please, may I ask you that you attach a working patch?

* this applies not just for evdev, for anything else too.

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=22881)
evdevcachecompare_errmsgs.patch git formatted

(In reply to comment #12)
> > Wow, surprisingly hard to get this patch upstreamed. :-/
>
> huh? All I'm asking for is that you re-format your patch and re-attach it.

Well, you had said I needed xserver master installed, which sounds
like it could take a lot of time to get set up.

> > Well, I'm not prepared to upgrade to the git xserver at this point since I'm
> > mostly focusing on stabilizing the Ubuntu xserver currently.
>
> afaict, your patch should apply to the evdev-2.1 branch, so you can do the
> commit there. no need to update the server.

Okay good point, attached.

Revision history for this message
Bryce Harrington (bryce) wrote :

Error message patch is pushed to ubuntu and forwarded upstream.

The status on this bug is waiting for confirmation that the patch to bug #322946 did not already fix the issue, and if not either steps to reproduce the error at will, or a log file from running with the error message patch (included in -evdev 2.1.1-1ubuntu3).

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

Thanks, pushed as 2a6c1d7a605e11189e4539db84b1c4da5707dbc6.

Revision history for this message
Bryce Harrington (bryce) wrote :

Error message patch taken upstream.

Changed in xorg-server:
status: Confirmed → In Progress
Revision history for this message
Steve Beattie (sbeattie) wrote :

Assigning to myself to acknowledge I'm monitoring this bug as a potential regression.

Changed in xserver-xorg-input-evdev (Ubuntu):
assignee: nobody → sbeattie
Revision history for this message
Steve Beattie (sbeattie) wrote :

Hrm, debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520718 looks like it might be something similar.

Bryce Harrington (bryce)
Changed in xserver-xorg-input-evdev (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

After updating to jaunty this happens here too

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

As a workaround, it is possible to download source of X evdev driver, and comment a line like that:

evdev.c:EvdevReopenTimer
        ....
        if (1) /*EvdevCacheCompare(pInfo, TRUE) == Success)*/
        ....

The problem lies in the fact that kernel reports that device slightly changed, (changed key bitmap), and evdev reacts to that very badly by disabling the device.

Probably evdev didn't do that in interpid.

Revision history for this message
romu (rboudot) wrote :

On Jaunty-rc I've tried to change the relevant line in evdev.c as suggested

Compiled and installed, reboot, suspend, resume : my keyboard is still disabled

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

Could you show the Xorg.log, after resume?

Revision history for this message
romu (rboudot) wrote :

I sshed into the laptop after it had resumed and copied the Xorg.0.log file.

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

It looks like you have some different bug.

I am not expert on that, I have just read the bug summary on freedesktop.
In next step however, I would suggest you to install program called 'evtest'

It is nice program, that reads input directly from input devices.
It has no own package, but it is present in few packages
(I think that this is a bug, btw)

maxim@maxim-laptop:~$ dpkg -S $(which evtest)
joystick: /usr/bin/evtest

Then ssh to your laptop, and see if the keyboard device generates events.

For that you do

evetest /dev/input/event1
evetest /dev/input/event2
...

There are many event devices, they include power buttons, keyboards, mices,

evtest shows you roughtly what device you have opened, by listing keys it can generate, and besides, it will show all events everytime you press a key.

Do you have a usb keyboard?

Revision history for this message
Miguel Ramiro (mike.longbow) wrote :

I can confirm this behaviour on my acer aspire one running jaunty with latest updates. In fact, the porblem has been present since I started using jaunty (since beta).

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

It is also an issue for me. Latest Jaunty updates are installed. Most of the time, when I resume from suspend (either to RAM or from hibernation), X throws the mentioned error and my keyboard no longer responds until I restart it.

This is on a Toshiba Satellite A15-S127 laptop, Intel drivers.

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 327175] Re: Sometimes loses input devices on suspend/resume: Device has changed - disabling.

@Mike Ramiro, Cory Maccarrone:

Version 1:2.1.1-1ubuntu3 of xserver-xorg-input-evdev (in February) added
some additional debugging to show exactly what changes in the device state
cause this problem. Your log files should show this additional detail.

Please attach whichever /var/log/Xorg.*.log shows this message so that we
can see it.

--
 - mdz

Steve Beattie (sbeattie)
tags: added: jaunty regression-release
removed: regression-potential
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

I use git of evdev driver.
this is what I get

(--) AlpsPS/2 ALPS GlidePoint touchpad found
(EE) AT Translated Set 2 keyboard: device key_bitmask has changed
(EE) AT Translated Set 2 keyboard: Device has changed - disabling.
(II) PS/2 Mouse: Device reopened after 1 attempts.
(II) Video Bus: Device reopened after 1 attempts.
(II) UnloadModule: "synaptics"
(II) PS/2 Mouse: Close
(II) UnloadModule: "evdev"
(II) Video Bus: Close
(II) UnloadModule: "evdev"
(II) AT Translated Set 2 keyboard: Close
(II) UnloadModule: "evdev"
 ddxSigGiveUp: Closing log

Revision history for this message
TJ (tj) wrote :

I've been experiencing this recently with the Bluetooth mouse. It occurs after multiple suspend/resume cycles - I'd guess 4 or 5 cycles before it hits. The mouse associates but the cursor is no longer controlled, and Xorg.0.log shows:

II) config/hal: Adding input device Bluetooth Travel Mouse
(**) Bluetooth Travel Mouse: always reports core events
(**) Bluetooth Travel Mouse: Device: "/dev/input/event10"
(II) Bluetooth Travel Mouse: Found 8 mouse buttons
(II) Bluetooth Travel Mouse: Found x and y relative axes
(II) Bluetooth Travel Mouse: Configuring as mouse
(**) Bluetooth Travel Mouse: YAxisMapping: buttons 4 and 5
(**) Bluetooth Travel Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(EE) Too many input devices. Ignoring Bluetooth Travel Mouse
(II) UnloadModule: "evdev"
(EE) config/hal: NewInputDeviceRequest failed (11)

Changed in xorg-server:
status: In Progress → Fix Released
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

It indeed appears that this one is fixed, at least here it works now

Revision history for this message
Bryce Harrington (bryce) wrote :

Colin, you're the original reporter - can you also confirm the issue as fixed in current jaunty?

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 327175] Re: Sometimes loses input devices on suspend/resume: Device has changed - disabling.

It's working for me now.

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 327175] Re: Sometimes loses input devices on suspend/resume: Device has changed - disabling.

I was never able to reproduce this with a recipe, though it did happen to
me several times. I haven't seen it happen in a long time, though.

--
 - mdz

Revision history for this message
mcnaz (mcnazar) wrote : Re: [Bug 327175] Re: Sometimes loses input devices on suspend/resume: Device has changed - disabling.

Sadly, still an issue for me on:

uname -a

2.6.28-14-generic #46-Ubuntu SMP Wed Jul 8 07:21:34 UTC 2009.

Manifests when resuming from hibernate (hibernating whilst on battery) and
resuming while on power. Switching user on password screen works partially
but ALT or SHIFT keys become stuck. Restart X fixes problem.

This is not consistent btw... :(

HW: Dell XPS M1330 Model:PP25L

Please advise how to supply more info.

> --
> Sometimes loses input devices on suspend/resume: Device has changed -
> disabling.
> https://bugs.launchpad.net/bugs/327175
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>
> Status in X.Org X server: Fix Released
> Status in “xserver-xorg-input-evdev” package in Ubuntu: Confirmed
>
> Bug description:
> Binary package hint: xserver-xorg-input-evdev
>
> On the way back from Berlin on Friday, I resumed my laptop on the plane to
> find that X was no longer accepting keyboard events. I tracked this down as
> far as EvdevCacheCompare having decided that the keyboard wasn't in the same
> state as it was on suspend and therefore disabling it. It's possible that
> this is related to bug 322946, but I don't know whether the position fields
> are defined for keyboard devices; unfortunately, my laptop ran out of
> battery before I could get it connected to a network, download debugging
> symbols, and attach gdb to the X server, which had been my plan.
>
> I've attached all the information I gathered before running out of battery,
> in the hope that it will be helpful. I was running kernel version
> 2.6.28-6.17.
>
> The error message was: (EE) AT Translated Set 2 keyboard: Device has
> changed - disabling.
>

Revision history for this message
Bryce Harrington (bryce) wrote :

@mcnaz, given your results differ from everyone else's, you might have some unrelated bug, although you've not provided enough info to guess one way or another.

Anyway, given that three people who have been following this bug for a while have confirmed they are no longer seeing it, and it's been marked fixed upstream since February, I'm going to provisionally close the bug as resolved. Colin, do of course feel free to reopen it if it is still is reproducing.

Changed in xserver-xorg-input-evdev (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Rod McFarland (rod-mcfarland) wrote :

This bug is affecting me on Karmic, Acer Aspire 5920 -- no keyboard on resume from suspend. Mouse works. Zap brings the keyboard back.

Revision history for this message
odonata (jeremy-uniquerish) wrote :

I know this particular bug has been marked "Fix Released", but I thought it might be worthwhile to chime in that I am seeing the same behavior as TJ and Rod McFarland above. This is on a MacbookPro1,1, with Karmic. Both my bluetooth keyboard and mouse will randomly become unresponsive after resume from suspend. From what I can tell, both the keyboard and mouse re-associate properly, but X fails to pick them up. Excerpt of Xorg log attached.

Changed in xorg-server:
importance: Unknown → Medium
Changed in xorg-server:
importance: Medium → Unknown
Changed in xorg-server:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.