#11260 NORM Not Tri: i8042 data loss over suspend/resume
Zarro Boogs per Child
bugtracker at laptop.org
Tue Sep 20 11:11:38 EDT 2011
#11260: i8042 data loss over suspend/resume
---------------------------------+------------------------------------------
Reporter: dsd | Owner: rsmith
Type: defect | Status: new
Priority: normal | Milestone: Not Triaged
Component: embedded controller | Version: 1.5-C2
Keywords: | Next_action: never set
Verified: 0 | Deployment_affected:
Blockedby: | Blocking:
---------------------------------+------------------------------------------
Testing my XO-1.5, reproduced with both the synaptics-mouse base section
that it came shipped with, and the AVC-mouse base shipped borrowed from my
XO-1.75 B1.
I am finding that if I suspend by typing "echo mem > /sys/power/state" at
the terminal (and terminating with the 'enter' key of course), sometimes
the system suspends before the "enter released" interrupt comes in, and
this interrupt then never properly arrives on resume. I am resuming with
the power button. Reproducible within a few tries (especially on a more
modern kernel which seems to suspend quicker).
Upon wakeup, the i8042 resume code simulates an interrupt (not sure
exactly why, but if we don't do this then no interrupts arrive later).
I8042_STATUS_REG reads 0x10 (i.e. no OBF bit set), indicating no data.
Then Linux receives a real interrupt, but I8042_STATUS_REG reads 0x10
still (no data). And the result is that the "enter released" interrupt
(expected data 0x9c) was never received and the system incorrectly thinks
that enter is held down.
{{{
[ 656.532452] i8042: [65410] read I8042_STATUS_REG=11
[ 656.532466] i8042: [65410] read I8042_DATA_REG=1c
[ 656.532478] i8042: [65410] 1c <- i8042 (interrupt, 0, 1)
[ 656.539243] PM: Syncing filesystems ... done.
[ 656.547792] PM: Preparing system for mem sleep
[ 656.547813] Freezing user space processes ... (elapsed 0.01 seconds)
done.
[ 656.572828] Freezing remaining freezable tasks ... (elapsed 0.01
seconds) done.
[ 656.592816] PM: Entering mem sleep
[ 656.593599] i8042 kbd 00:04: wake-up capability enabled by ACPI
[ 656.599616] i8042 aux 00:03: wake-up capability disabled by ACPI
[ 656.605834] ehci_hcd 0000:00:10.4: PCI INT D disabled
[ 656.610999] uhci_hcd 0000:00:10.2: PCI INT C disabled
[ 656.616305] uhci_hcd 0000:00:10.0: PCI INT A disabled
[ 656.621507] viafb_suspend!
[ 656.624849] viafb 0000:00:01.0: PCI INT A disabled
[ 656.629836] ACPI handle has no context!
[ 656.629850] sdhci-pci 0000:00:0c.0: PCI INT A disabled
[ 656.635060] uhci_hcd 0000:00:10.1: PCI INT B disabled
[ 656.640212] ACPI handle has no context!
[ 656.660048] PM: suspend of devices complete after 66.956 msecs
[ 656.740257] PM: late suspend of devices complete after 74.286 msecs
[ 656.746712] ACPI: Preparing to enter system sleep state S3
[ 656.850073] PM: Saving platform NVS memory
[ 656.850073] ACPI: Low-level resume complete
[ 656.850073] PM: Restoring platform NVS memory
[ 656.850073] ACPI: Waking up from system sleep state S3
[ 656.860330] viafb 0000:00:01.0: restoring config space at offset 0xf
(was 0x100, writing 0x10a)
[ 656.860381] sdhci-pci 0000:00:0c.0: restoring config space at offset
0xf (was 0x100, writing 0x10a)
[ 656.860409] sdhci-pci 0000:00:0c.0: restoring config space at offset
0x6 (was 0x0, writing 0x80002000)
[ 656.860426] sdhci-pci 0000:00:0c.0: restoring config space at offset
0x5 (was 0x0, writing 0x80001000)
[ 656.860443] sdhci-pci 0000:00:0c.0: restoring config space at offset
0x4 (was 0x0, writing 0x80000000)
[ 656.860463] sdhci-pci 0000:00:0c.0: restoring config space at offset
0x1 (was 0x2100010, writing 0x2100016)
[ 656.880042] uhci_hcd 0000:00:10.0: BAR 4: set to [io 0x8000-0x801f]
(PCI address [0x8000-0x801f])
[ 656.889122] uhci_hcd 0000:00:10.0: restoring config space at offset 0xf
(was 0x100, writing 0x10a)
[ 656.889157] uhci_hcd 0000:00:10.0: restoring config space at offset 0x1
(was 0x2100010, writing 0x2100013)
[ 656.900032] uhci_hcd 0000:00:10.1: BAR 4: set to [io 0x8020-0x803f]
(PCI address [0x8020-0x803f])
[ 656.909089] uhci_hcd 0000:00:10.1: restoring config space at offset 0xf
(was 0x200, writing 0x209)
[ 656.909124] uhci_hcd 0000:00:10.1: restoring config space at offset 0x1
(was 0x2100010, writing 0x2100013)
[ 656.920031] uhci_hcd 0000:00:10.2: BAR 4: set to [io 0x8040-0x805f]
(PCI address [0x8040-0x805f])
[ 656.929085] uhci_hcd 0000:00:10.2: restoring config space at offset 0xf
(was 0x300, writing 0x30b)
[ 656.929120] uhci_hcd 0000:00:10.2: restoring config space at offset 0x1
(was 0x2100000, writing 0x2100013)
[ 656.940032] ehci_hcd 0000:00:10.4: BAR 0: set to [mem
0x80003000-0x800030ff] (PCI address [0x80003000-0x800030ff])
[ 656.950508] ehci_hcd 0000:00:10.4: restoring config space at offset 0xf
(was 0x400, writing 0x40a)
[ 656.950542] ehci_hcd 0000:00:10.4: restoring config space at offset 0x1
(was 0x2100010, writing 0x2100012)
[ 656.950681] pci 0000:00:14.0: restoring config space at offset 0xf (was
0x100, writing 0x109)
[ 656.950709] pci 0000:00:14.0: restoring config space at offset 0x4 (was
0x8fff0004, writing 0x80004004)
[ 656.950890] PM: early resume of devices complete after 90.837 msecs
[ 656.957521] viafb 0000:00:01.0: PCI INT A -> GSI 16 (level, low) -> IRQ
16
[ 656.964493] sdhci-pci 0000:00:0c.0: PCI INT A -> GSI 22 (level, low) ->
IRQ 22
[ 656.971814] uhci_hcd 0000:00:10.0: PCI INT A -> GSI 20 (level, low) ->
IRQ 20
[ 656.979054] usb usb2: root hub lost power or was reset
[ 656.984305] uhci_hcd 0000:00:10.1: PCI INT B -> GSI 22 (level, low) ->
IRQ 22
[ 656.991583] uhci_hcd 0000:00:10.2: PCI INT C -> GSI 21 (level, low) ->
IRQ 21
[ 656.998809] usb usb4: root hub lost power or was reset
[ 657.004176] ehci_hcd 0000:00:10.4: PCI INT D -> GSI 23 (level, low) ->
IRQ 23
[ 657.011464] pci 0000:00:13.0: setting latency timer to 64
[ 657.024832] viafb_resume!
[ 657.027960] viafb_resume: Init 3d engine!
[ 657.032287] usb usb3: root hub lost power or was reset
[ 657.032330] sdhci-pci 0000:00:0c.0: setting latency timer to 64
[ 657.032366] sdhci-pci 0000:00:0c.0: setting latency timer to 64
[ 657.032388] sdhci-pci 0000:00:0c.0: setting latency timer to 64
[ 657.052220] i8042 kbd 00:04: wake-up capability disabled by ACPI
[ 657.070911] i8042: [65464] soft resume interrupt
[ 657.070923] i8042: [65464] read I8042_STATUS_REG=10
[ 657.070942] i8042: [65464] read I8042_STATUS_REG=10
[ 657.070951] i8042: [65464] Interrupt 1, without any data
[ 657.280197] PM: resume of devices complete after 322.805 msecs
[ 657.286390] PM: Finishing wakeup.
[ 657.286397] Restarting tasks ... done.
}}}
Kernel which you can use to debug this, which prints all i8042 I/O (as
above):
http://dev.laptop.org/~dsd/20110920/bzImage
Be sure to enable debugging and keyboard wakeup before suspending, with:
{{{
echo 1 > /sys/module/i8042/parameters/debug
echo 1 > /sys/devices/platform/i8042/power/wakeup
echo 1 > /sys/devices/platform/i8042/serio0/power/wakeup
echo 1 > /sys/devices/platform/i8042/serio1/power/wakeup
echo 1 > /sys/devices/platform/i8042/serio0/input/*/power/wakeup
echo 1 > /sys/devices/platform/i8042/serio1/input/*/power/wakeup
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/11260>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list