Hi!
It complains about unbalanced irq 113 wake disable. That one belongs
to matrix-keypad...
Pavel
spend
leds spitz:green:hddactivity: legacy class suspend
leds spitz:amber:charge: legacy class suspend
input input1: type suspend
input input0: type suspend
mtd mtd2ro: legacy class suspend
mtd mtd2: legacy class suspend
mtd mtd1ro: legacy class suspend
mtd mtd1: legacy class suspend
mtd mtd0ro: legacy class suspend
mtd mtd0: legacy class suspend
serial8250 serial8250: suspend
backlight corgi_bl: legacy class suspend
sharpsl-pm sharpsl-pm: suspend
pxa2xx-pcmcia pxa2xx-pcmcia: suspend
platform regulatory.0: suspend
i2c i2c-0: legacy suspend
max1111 spi2.2: legacy suspend
corgi-lcd spi2.1: legacy suspend
ads7846 spi2.0: legacy suspend
sharp-scoop sharp-scoop.1: suspend
pxa2xx-i2c pxa2xx-i2c.0: suspend
pxa2xx-fb pxa2xx-fb: suspend
platform pxa2xx-ir: suspend
platform pxa27x-ohci: suspend
pxa2xx-mci pxa2xx-mci.0: suspend
platform physmap-flash: suspend
sharpsl-nand sharpsl-nand: suspend
leds-gpio leds-gpio: suspend
matrix-keypad matrix-keypad: suspend, may wakeup
sharp-scoop sharp-scoop.0: suspend
pxa2xx-spi pxa2xx-spi.2: suspend
platform pxa27x-pwm.1: suspend
platform pxa27x-pwm.0: suspend
pxa27x-ssp pxa27x-ssp.2: suspend
pxa27x-ssp pxa27x-ssp.1: suspend
pxa27x-ssp pxa27x-ssp.0: suspend
platform pxa-rtc: suspend
platform sa1100-rtc: suspend
platform pxa2xx-i2s: suspend
platform pxa2xx-uart.2: suspend
platform pxa2xx-uart.1: suspend
platform pxa2xx-uart.0: suspend
platform pxa27x-udc: suspend
serial8250 serial8250: LATE suspend
sharpsl-pm sharpsl-pm: LATE suspend
pxa2xx-pcmcia pxa2xx-pcmcia: LATE suspend
platform regulatory.0: LATE suspend
sharp-scoop sharp-scoop.1: LATE suspend
pxa2xx-i2c pxa2xx-i2c.0: LATE suspend
pxa2xx-fb pxa2xx-fb: LATE suspend
platform pxa2xx-ir: LATE suspend
platform pxa27x-ohci: LATE suspend
pxa2xx-mci pxa2xx-mci.0: LATE suspend
platform physmap-flash: LATE suspend
sharpsl-nand sharpsl-nand: LATE suspend
leds-gpio leds-gpio: LATE suspend
matrix-keypad matrix-keypad: LATE suspend, may wakeup
sharp-scoop sharp-scoop.0: LATE suspend
pxa2xx-spi pxa2xx-spi.2: LATE suspend
platform pxa27x-pwm.1: LATE suspend
platform pxa27x-pwm.0: LATE suspend
pxa27x-ssp pxa27x-ssp.2: LATE suspend
pxa27x-ssp pxa27x-ssp.1: LATE suspend
pxa27x-ssp pxa27x-ssp.0: LATE suspend
platform pxa-rtc: LATE suspend
platform sa1100-rtc: LATE suspend
platform pxa2xx-i2s: LATE suspend
platform pxa2xx-uart.2: LATE suspend
platform pxa2xx-uart.1: LATE suspend
platform pxa2xx-uart.0: LATE suspend
platform pxa27x-udc: LATE suspend
suspend debug: Waiting for 5 seconds.
platform pxa27x-udc: EARLY resume
platform pxa2xx-uart.0: EARLY resume
platform pxa2xx-uart.1: EARLY resume
platform pxa2xx-uart.2: EARLY resume
platform pxa2xx-i2s: EARLY resume
platform sa1100-rtc: EARLY resume
platform pxa-rtc: EARLY resume
pxa27x-ssp pxa27x-ssp.0: EARLY resume
pxa27x-ssp pxa27x-ssp.1: EARLY resume
pxa27x-ssp pxa27x-ssp.2: EARLY resume
platform pxa27x-pwm.0: EARLY resume
platform pxa27x-pwm.1: EARLY resume
pxa2xx-spi pxa2xx-spi.2: EARLY resume
sharp-scoop sharp-scoop.0: EARLY resume
matrix-keypad matrix-keypad: EARLY resume
leds-gpio leds-gpio: EARLY resume
sharpsl-nand sharpsl-nand: EARLY resume
platform physmap-flash: EARLY resume
pxa2xx-mci pxa2xx-mci.0: EARLY resume
platform pxa27x-ohci: EARLY resume
platform pxa2xx-ir: EARLY resume
pxa2xx-fb pxa2xx-fb: EARLY resume
pxa2xx-i2c pxa2xx-i2c.0: EARLY resume
sharp-scoop sharp-scoop.1: EARLY resume
platform regulatory.0: EARLY resume
pxa2xx-pcmcia pxa2xx-pcmcia: EARLY resume
sharpsl-pm sharpsl-pm: EARLY resume
serial8250 serial8250: EARLY resume
platform pxa27x-udc: resume
platform pxa2xx-uart.0: resume
platform pxa2xx-uart.1: resume
platform pxa2xx-uart.2: resume
platform pxa2xx-i2s: resume
platform sa1100-rtc: resume
platform pxa-rtc: resume
pxa27x-ssp pxa27x-ssp.0: resume
pxa27x-ssp pxa27x-ssp.1: resume
pxa27x-ssp pxa27x-ssp.2: resume
platform pxa27x-pwm.0: resume
platform pxa27x-pwm.1: resume
pxa2xx-spi pxa2xx-spi.2: resume
sharp-scoop sharp-scoop.0: resume
matrix-keypad matrix-keypad: resume
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 113 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339f7 ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 187 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339f8 ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 130 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339f9 ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 132 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339fa ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 134 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339fb ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0x138()
Unbalanced IRQ 135 wake disable
Modules linked in:
[<c00248f8>] (unwind_backtrace+0x0/0xe4) from [<c003520c>] (warn_slowpath_common+0x4c/0x80)
[<c003520c>] (warn_slowpath_common+0x4c/0x80) from [<c003527c>] (warn_slowpath_fmt+0x28/0x38)
[<c003527c>] (warn_slowpath_fmt+0x28/0x38) from [<c0060b88>] (set_irq_wake+0x7c/0x138)
[<c0060b88>] (set_irq_wake+0x7c/0x138) from [<c01d0484>] (matrix_keypad_resume+0x6c/0x8c)
[<c01d0484>] (matrix_keypad_resume+0x6c/0x8c) from [<c0190d3c>] (platform_pm_resume+0x30/0x54)
[<c0190d3c>] (platform_pm_resume+0x30/0x54) from [<c019302c>] (pm_op+0x6c/0x8c)
[<c019302c>] (pm_op+0x6c/0x8c) from [<c0193af4>] (dpm_resume_end+0xf0/0x47c)
[<c0193af4>] (dpm_resume_end+0xf0/0x47c) from [<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc)
[<c005d980>] (suspend_devices_and_enter+0x8c/0x1dc) from [<c005dbb8>] (enter_state+0xe8/0x120)
[<c005dbb8>] (enter_state+0xe8/0x120) from [<c005d2bc>] (state_store+0x90/0xc4)
[<c005d2bc>] (state_store+0x90/0xc4) from [<c01459bc>] (kobj_attr_store+0x1c/0x24)
[<c01459bc>] (kobj_attr_store+0x1c/0x24) from [<c00d80d8>] (sysfs_write_file+0x104/0x18c)
[<c00d80d8>] (sysfs_write_file+0x104/0x18c) from [<c008ffe8>] (vfs_write+0xb0/0x164)
[<c008ffe8>] (vfs_write+0xb0/0x164) from [<c009016c>] (sys_write+0x40/0x70)
[<c009016c>] (sys_write+0x40/0x70) from [<c001fec0>] (ret_fast_syscall+0x0/0x28)
---[ end trace e1f70a99626339fc ]---
leds-gpio leds-gpio: resume
sharpsl-nand sharpsl-nand: resume
platform physmap-flash: resume
pxa2xx-mci pxa2xx-mci.0: resume
platform pxa27x-ohci: resume
platform pxa2xx-ir: resume
pxa2xx-fb pxa2xx-fb: resume
pxa2xx-i2c pxa2xx-i2c.0: resume
sharp-scoop sharp-scoop.1: resume
ads7846 spi2.0: legacy resume
corgi-lcd spi2.1: legacy resume
max1111 spi2.2: legacy resume
i2c i2c-0: legacy resume
platform regulatory.0: resume
pxa2xx-pcmcia pxa2xx-pcmcia: resume
sharpsl-pm sharpsl-pm: resume
backlight corgi_bl: legacy class resume
serial8250 serial8250: resume
mtd mtd0: legacy class resume
mtd mtd0ro: legacy class resume
mtd mtd1: legacy class resume
mtd mtd1ro: legacy class resume
mtd mtd2: legacy class resume
mtd mtd2ro: legacy class resume
input input0: type resume
input input1: type resume
leds spitz:amber:charge: legacy class resume
leds spitz:green:hddactivity: legacy class resume
ide-cs 1.0: legacy resume
ide-gd 0.0: legacy resume
serial8250 serial8250: completing resume
sharpsl-pm sharpsl-pm: completing resume
pxa2xx-pcmcia pxa2xx-pcmcia: completing resume
platform regulatory.0: completing resume
sharp-scoop sharp-scoop.1: completing resume
pxa2xx-i2c pxa2xx-i2c.0: completing resume
pxa2xx-fb pxa2xx-fb: completing resume
platform pxa2xx-ir: completing resume
platform pxa27x-ohci: completing resume
pxa2xx-mci pxa2xx-mci.0: completing resume
platform physmap-flash: completing resume
sharpsl-nand sharpsl-nand: completing resume
leds-gpio leds-gpio: completing resume
matrix-keypad matrix-keypad: completing resume
sharp-scoop sharp-scoop.0: completing resume
pxa2xx-spi pxa2xx-spi.2: completing resume
platform pxa27x-pwm.1: completing resume
platform pxa27x-pwm.0: completing resume
pxa27x-ssp pxa27x-ssp.2: completing resume
pxa27x-ssp pxa27x-ssp.1: completing resume
pxa27x-ssp pxa27x-ssp.0: completing resume
platform pxa-rtc: completing resume
platform sa1100-rtc: completing resume
platform pxa2xx-i2s: completing resume
platform pxa2xx-uart.2: completing resume
platform pxa2xx-uart.1: completing resume
platform pxa2xx-uart.0: completing resume
platform pxa27x-udc: completing resume
PM: Finishing wakeup.
Restarting tasks ... done.
hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error }
hda: status error: error=0x04 { DriveStatusError }
hda: possibly failed opcode: 0xc5
hda: no DRQ after issuing MULTWRITE
ide0: reset: success
sharpsl-pm sharpsl-pm: Error: AC check failed.
sharpsl-pm sharpsl-pm: Charging Error!
sharpsl-pm sharpsl-pm: Error: AC check failed.
sharpsl-pm sharpsl-pm: Charging Error!
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi Pavel,
On Wed, Sep 30, 2009 at 10:07:46PM +0200, Pavel Machek wrote:
> Hi!
>
> It complains about unbalanced irq 113 wake disable. That one belongs
> to matrix-keypad...
I guess some of enable_irq_wake()s fail on your box. Do you see it if
you apply the patch below?
Thanks.
--
Dmitry
Input: matrix-keypad - report errors from enable_irq_wake()
From: Dmitry Torokhov <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
---
drivers/input/keyboard/matrix_keypad.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 91cfe51..488171c 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -218,14 +218,29 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
+ int err;
matrix_keypad_stop(keypad->input_dev);
- if (device_may_wakeup(&pdev->dev))
- for (i = 0; i < pdata->num_row_gpios; i++)
- enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
+ if (device_may_wakeup(&pdev->dev)) {
+ for (i = 0; i < pdata->num_row_gpios; i++) {
+ err = enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
+ if (err) {
+ dev_err(&pdev->dev,
+ "Failed to setup GPIO %d as "
+ "wakeup source, err: %d\n",
+ pdata->row_gpios[i], err);
+ goto err_out;
+ }
+ }
+ }
return 0;
+
+ err_out:
+ while (--i >= 0)
+ disable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
+ return err;
}
static int matrix_keypad_resume(struct platform_device *pdev)
Hi!
On Mon 2009-10-05 22:06:50, Dmitry Torokhov wrote:
> On Wed, Sep 30, 2009 at 10:07:46PM +0200, Pavel Machek wrote:
> >
> > It complains about unbalanced irq 113 wake disable. That one belongs
> > to matrix-keypad...
>
> I guess some of enable_irq_wake()s fail on your box. Do you see it if
> you apply the patch below?
I'll do short test. But... if you are right, your patch will just make
your machine refuse to suspend... right?
Ungood.
Actually, it seems to break suspend (returns -EINVAL while refusing
to suspend), warnings are still there, and keyboard is dead after
failed suspend... double plus ungood.
Aha, so warning is solved: the one in the log is from gpio_buttons.
(I wonder if the 'unbalanced irq_wake' warning is useful... who added it?)
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Tue, Oct 06, 2009 at 09:58:17AM +0200, Pavel Machek wrote:
> Hi!
>
> On Mon 2009-10-05 22:06:50, Dmitry Torokhov wrote:
> > On Wed, Sep 30, 2009 at 10:07:46PM +0200, Pavel Machek wrote:
> > >
> > > It complains about unbalanced irq 113 wake disable. That one belongs
> > > to matrix-keypad...
> >
> > I guess some of enable_irq_wake()s fail on your box. Do you see it if
> > you apply the patch below?
>
> I'll do short test. But... if you are right, your patch will just make
> your machine refuse to suspend... right?
>
> Ungood.
It was just a debug patch.
>
> Actually, it seems to break suspend (returns -EINVAL while refusing
> to suspend), warnings are still there, and keyboard is dead after
> failed suspend... double plus ungood.
>
> Aha, so warning is solved: the one in the log is from gpio_buttons.
>
OK, so it looks like your box refuses to set up one of the GPIOs as a
wakeup source... Hmm, either your box is wrong ;) or matrix_keypad
driver needs to maintain a separate list of wakeup GPIOs.
--
Dmitry
On Wed, Oct 7, 2009 at 12:36 PM, Dmitry Torokhov
<[email protected]> wrote:
> On Tue, Oct 06, 2009 at 09:58:17AM +0200, Pavel Machek wrote:
>> Hi!
>>
>> On Mon 2009-10-05 22:06:50, Dmitry Torokhov wrote:
>> > On Wed, Sep 30, 2009 at 10:07:46PM +0200, Pavel Machek wrote:
>> > >
>> > > It complains about unbalanced irq 113 wake disable. That one belongs
>> > > to matrix-keypad...
>> >
>> > I guess some of enable_irq_wake()s fail on your box. Do you see it if
>> > you apply the patch below?
>>
>> I'll do short test. But... if you are right, your patch will just make
>> your machine refuse to suspend... right?
>>
>> Ungood.
>
> It was just a debug patch.
>
>>
>> Actually, it seems to break suspend (returns -EINVAL while refusing
>> to suspend), warnings are still there, and keyboard is dead after
>> failed suspend... double plus ungood.
>>
>> Aha, so warning is solved: the one in the log is from gpio_buttons.
>>
>
> OK, so it looks like your box refuses to set up one of the GPIOs as a
> wakeup source... Hmm, either your box is wrong ;) or matrix_keypad
> driver needs to maintain a separate list of wakeup GPIOs.
>
This is due to the nature of PXA processor, where not every GPIO can
be configured as a wakeup source. Mmm.... we can either return a
pseudo value indicating setting wakeup on that GPIO is OK (which
doesn't sound like a good idea), or we can just ignore the failure of
enable_irq_wake() in matrix_keypad?
On Wed, Oct 07, 2009 at 10:42:08PM +0800, Eric Miao wrote:
> On Wed, Oct 7, 2009 at 12:36 PM, Dmitry Torokhov
> <[email protected]> wrote:
> > On Tue, Oct 06, 2009 at 09:58:17AM +0200, Pavel Machek wrote:
> >> Hi!
> >>
> >> On Mon 2009-10-05 22:06:50, Dmitry Torokhov wrote:
> >> > On Wed, Sep 30, 2009 at 10:07:46PM +0200, Pavel Machek wrote:
> >> > >
> >> > > It complains about unbalanced irq 113 wake disable. That one belongs
> >> > > to matrix-keypad...
> >> >
> >> > I guess some of enable_irq_wake()s fail on your box. Do you see it if
> >> > you apply the patch below?
> >>
> >> I'll do short test. But... if you are right, your patch will just make
> >> your machine refuse to suspend... right?
> >>
> >> Ungood.
> >
> > It was just a debug patch.
> >
> >>
> >> Actually, it seems to break suspend (returns ?-EINVAL while refusing
> >> to suspend), warnings are still there, and keyboard is dead after
> >> failed suspend... double plus ungood.
> >>
> >> Aha, so warning is solved: the one in the log is from gpio_buttons.
> >>
> >
> > OK, so it looks like your box refuses to set up one of the GPIOs as a
> > wakeup source... Hmm, either your box is wrong ;) or matrix_keypad
> > driver needs to maintain a separate list of wakeup GPIOs.
> >
>
> This is due to the nature of PXA processor, where not every GPIO can
> be configured as a wakeup source. Mmm.... we can either return a
> pseudo value indicating setting wakeup on that GPIO is OK (which
> doesn't sound like a good idea), or we can just ignore the failure of
> enable_irq_wake() in matrix_keypad?
We ignore the failure right now in the mainline but that causes stack
traces on resume as we trying to disable not enabled wakeup GPIOs. That
was original Pavel's complaint.
--
Dmitry
> > > OK, so it looks like your box refuses to set up one of the GPIOs as a
> > > wakeup source... Hmm, either your box is wrong ;) or matrix_keypad
> > > driver needs to maintain a separate list of wakeup GPIOs.
> > >
> >
> > This is due to the nature of PXA processor, where not every GPIO can
> > be configured as a wakeup source. Mmm.... we can either return a
> > pseudo value indicating setting wakeup on that GPIO is OK (which
> > doesn't sound like a good idea), or we can just ignore the failure of
> > enable_irq_wake() in matrix_keypad?
>
> We ignore the failure right now in the mainline but that causes stack
> traces on resume as we trying to disable not enabled wakeup GPIOs. That
> was original Pavel's complaint.
Yep...
I'd say that BUG() simply should not trigger if wakeup can not be
enabled/disabled for particular source...?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Wed, Oct 07, 2009 at 11:12:26PM +0200, Pavel Machek wrote:
>
> > > > OK, so it looks like your box refuses to set up one of the GPIOs as a
> > > > wakeup source... Hmm, either your box is wrong ;) or matrix_keypad
> > > > driver needs to maintain a separate list of wakeup GPIOs.
> > > >
> > >
> > > This is due to the nature of PXA processor, where not every GPIO can
> > > be configured as a wakeup source. Mmm.... we can either return a
> > > pseudo value indicating setting wakeup on that GPIO is OK (which
> > > doesn't sound like a good idea), or we can just ignore the failure of
> > > enable_irq_wake() in matrix_keypad?
> >
> > We ignore the failure right now in the mainline but that causes stack
> > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > was original Pavel's complaint.
>
> Yep...
>
> I'd say that BUG() simply should not trigger if wakeup can not be
> enabled/disabled for particular source...?
Pavel,
Could you please try the patch below and let me know if it fixes the
problem for you?
Thanks.
--
Dmitry
Input: matrix-keypad - handle cases when GPIOs can't be wakeup sources
From: Dmitry Torokhov <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
---
drivers/input/keyboard/matrix_keypad.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 91cfe51..a1152ba 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -29,11 +29,13 @@ struct matrix_keypad {
unsigned short *keycodes;
unsigned int row_shift;
+ DECLARE_BITMAP(disabled_gpios, MATRIX_MAX_ROWS);
+
uint32_t last_key_state[MATRIX_MAX_COLS];
struct delayed_work work;
+ spinlock_t lock;
bool scan_pending;
bool stopped;
- spinlock_t lock;
};
/*
@@ -221,9 +223,16 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
matrix_keypad_stop(keypad->input_dev);
- if (device_may_wakeup(&pdev->dev))
- for (i = 0; i < pdata->num_row_gpios; i++)
- enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
+ if (device_may_wakeup(&pdev->dev)) {
+ for (i = 0; i < pdata->num_row_gpios; i++) {
+ if (!test_bit(i, keypad->disabled_gpios)) {
+ unsigned int gpio = pdata->row_gpios[i];
+
+ if (enable_irq_wake(gpio_to_irq(gpio)) == 0)
+ __set_bit(i, keypad->disabled_gpios);
+ }
+ }
+ }
return 0;
}
@@ -234,9 +243,15 @@ static int matrix_keypad_resume(struct platform_device *pdev)
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
- if (device_may_wakeup(&pdev->dev))
- for (i = 0; i < pdata->num_row_gpios; i++)
- disable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
+ if (device_may_wakeup(&pdev->dev)) {
+ for (i = 0; i < pdata->num_row_gpios; i++) {
+ if (test_and_clear_bit(i, keypad->disabled_gpios)) {
+ unsigned int gpio = pdata->row_gpios[i];
+
+ disable_irq_wake(gpio_to_irq(gpio));
+ }
+ }
+ }
matrix_keypad_start(keypad->input_dev);
Hi!
> > > We ignore the failure right now in the mainline but that causes stack
> > > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > > was original Pavel's complaint.
> >
> > Yep...
> >
> > I'd say that BUG() simply should not trigger if wakeup can not be
> > enabled/disabled for particular source...?
>
> Pavel,
>
> Could you please try the patch below and let me know if it fixes the
> problem for you?
(sorry for long delay).
With 33-rc1+your patch, warnings are no longer there.
I still have one on irq191, but that's gpio button driver.
But please, hold the patch for few more days. I may have cleaner/nicer
solution. It seems that zaurus is doing something very stupid in low layers.
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Sat 2010-01-02 16:27:24, Pavel Machek wrote:
> On Sat 2010-01-02 14:56:09, Pavel Machek wrote:
> > Hi!
> >
> > > > > We ignore the failure right now in the mainline but that causes stack
> > > > > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > > > > was original Pavel's complaint.
> > > >
> > > > Yep...
> > > >
> > > > I'd say that BUG() simply should not trigger if wakeup can not be
> > > > enabled/disabled for particular source...?
> > >
> > > Pavel,
> > >
> > > Could you please try the patch below and let me know if it fixes the
> > > problem for you?
> >
> > (sorry for long delay).
> >
> > With 33-rc1+your patch, warnings are no longer there.
> >
> > I still have one on irq191, but that's gpio button driver.
> >
> > But please, hold the patch for few more days. I may have cleaner/nicer
> > solution. It seems that zaurus is doing something very stupid in low
> > layers.
>
> I'm thinking that maybe something like this should do the trick.
And it does, simplyfing pxa-specific code. More testing would be nice,
but I guess simplifying pxa is preferable to adding workarounds in
input.
Signed-off-by: Pavel Machek <[email protected]>
> --- ./arch/arm.ofic/mach-pxa/mfp-pxa2xx.c 2009-09-10 00:13:59.000000000 +0200
> +++ ./arch/arm/mach-pxa/mfp-pxa2xx.c 2009-12-29 03:16:40.000000000 +0100
> @@ -34,7 +34,6 @@
> struct gpio_desc {
> unsigned valid : 1;
> unsigned can_wakeup : 1;
> - unsigned keypad_gpio : 1;
> unsigned dir_inverted : 1;
> unsigned int mask; /* bit mask in PWER or PKWR */
> unsigned int mux_mask; /* bit mask of muxed gpio bits, 0 if no mux */
> @@ -178,9 +177,6 @@
> if (!d->valid)
> return -EINVAL;
>
> - if (d->keypad_gpio)
> - return -EINVAL;
> -
> mux_taken = (PWER & d->mux_mask) & (~d->mask);
> if (on && mux_taken)
> return -EBUSY;
> @@ -231,32 +227,6 @@
> #endif /* CONFIG_PXA25x */
>
> #ifdef CONFIG_PXA27x
> -static int pxa27x_pkwr_gpio[] = {
> - 13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
> - 95, 96, 97, 98, 99, 100, 101, 102
> -};
> -
> -int keypad_set_wake(unsigned int on)
> -{
> - unsigned int i, gpio, mask = 0;
> -
> - if (!on) {
> - PKWR = 0;
> - return 0;
> - }
> -
> - for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
> -
> - gpio = pxa27x_pkwr_gpio[i];
> -
> - if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP)
> - mask |= gpio_desc[gpio].mask;
> - }
> -
> - PKWR = mask;
> - return 0;
> -}
> -
> #define PWER_WEMUX2_GPIO38 (1 << 16)
> #define PWER_WEMUX2_GPIO53 (2 << 16)
> #define PWER_WEMUX2_GPIO40 (3 << 16)
> @@ -273,6 +243,12 @@
> gpio_desc[(gpio)].mux_mask = PWER_ ## mux ## _MASK; \
> } while (0)
>
> +
> +static int pxa27x_pkwr_gpio[] = {
> + 13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
> + 95, 96, 97, 98, 99, 100, 101, 102
> +};
> +
> static void __init pxa27x_mfp_init(void)
> {
> int i, gpio;
> @@ -291,7 +267,6 @@
> for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
> gpio = pxa27x_pkwr_gpio[i];
> gpio_desc[gpio].can_wakeup = 1;
> - gpio_desc[gpio].keypad_gpio = 1;
> gpio_desc[gpio].mask = 1 << i;
> }
>
> --- ./arch/arm.ofic/mach-pxa/pxa27x.c 2009-09-10 00:13:59.000000000 +0200
> +++ ./arch/arm/mach-pxa/pxa27x.c 2009-12-29 03:13:00.000000000 +0100
> @@ -323,9 +323,6 @@
> if (gpio >= 0 && gpio < 128)
> return gpio_set_wake(gpio, on);
>
> - if (irq == IRQ_KEYPAD)
> - return keypad_set_wake(on);
> -
> switch (irq) {
> case IRQ_RTCAlrm:
> mask = PWER_RTC;
>
>
>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Sat 2010-01-02 14:56:09, Pavel Machek wrote:
> Hi!
>
> > > > We ignore the failure right now in the mainline but that causes stack
> > > > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > > > was original Pavel's complaint.
> > >
> > > Yep...
> > >
> > > I'd say that BUG() simply should not trigger if wakeup can not be
> > > enabled/disabled for particular source...?
> >
> > Pavel,
> >
> > Could you please try the patch below and let me know if it fixes the
> > problem for you?
>
> (sorry for long delay).
>
> With 33-rc1+your patch, warnings are no longer there.
>
> I still have one on irq191, but that's gpio button driver.
>
> But please, hold the patch for few more days. I may have cleaner/nicer
> solution. It seems that zaurus is doing something very stupid in low
> layers.
I'm thinking that maybe something like this should do the trick.
--- ./arch/arm.ofic/mach-pxa/mfp-pxa2xx.c 2009-09-10 00:13:59.000000000 +0200
+++ ./arch/arm/mach-pxa/mfp-pxa2xx.c 2009-12-29 03:16:40.000000000 +0100
@@ -34,7 +34,6 @@
struct gpio_desc {
unsigned valid : 1;
unsigned can_wakeup : 1;
- unsigned keypad_gpio : 1;
unsigned dir_inverted : 1;
unsigned int mask; /* bit mask in PWER or PKWR */
unsigned int mux_mask; /* bit mask of muxed gpio bits, 0 if no mux */
@@ -178,9 +177,6 @@
if (!d->valid)
return -EINVAL;
- if (d->keypad_gpio)
- return -EINVAL;
-
mux_taken = (PWER & d->mux_mask) & (~d->mask);
if (on && mux_taken)
return -EBUSY;
@@ -231,32 +227,6 @@
#endif /* CONFIG_PXA25x */
#ifdef CONFIG_PXA27x
-static int pxa27x_pkwr_gpio[] = {
- 13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102
-};
-
-int keypad_set_wake(unsigned int on)
-{
- unsigned int i, gpio, mask = 0;
-
- if (!on) {
- PKWR = 0;
- return 0;
- }
-
- for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
-
- gpio = pxa27x_pkwr_gpio[i];
-
- if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP)
- mask |= gpio_desc[gpio].mask;
- }
-
- PKWR = mask;
- return 0;
-}
-
#define PWER_WEMUX2_GPIO38 (1 << 16)
#define PWER_WEMUX2_GPIO53 (2 << 16)
#define PWER_WEMUX2_GPIO40 (3 << 16)
@@ -273,6 +243,12 @@
gpio_desc[(gpio)].mux_mask = PWER_ ## mux ## _MASK; \
} while (0)
+
+static int pxa27x_pkwr_gpio[] = {
+ 13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102
+};
+
static void __init pxa27x_mfp_init(void)
{
int i, gpio;
@@ -291,7 +267,6 @@
for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
gpio = pxa27x_pkwr_gpio[i];
gpio_desc[gpio].can_wakeup = 1;
- gpio_desc[gpio].keypad_gpio = 1;
gpio_desc[gpio].mask = 1 << i;
}
--- ./arch/arm.ofic/mach-pxa/pxa27x.c 2009-09-10 00:13:59.000000000 +0200
+++ ./arch/arm/mach-pxa/pxa27x.c 2009-12-29 03:13:00.000000000 +0100
@@ -323,9 +323,6 @@
if (gpio >= 0 && gpio < 128)
return gpio_set_wake(gpio, on);
- if (irq == IRQ_KEYPAD)
- return keypad_set_wake(on);
-
switch (irq) {
case IRQ_RTCAlrm:
mask = PWER_RTC;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Sat, Jan 02, 2010 at 02:56:09PM +0100, Pavel Machek wrote:
> Hi!
>
> > > > We ignore the failure right now in the mainline but that causes stack
> > > > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > > > was original Pavel's complaint.
> > >
> > > Yep...
> > >
> > > I'd say that BUG() simply should not trigger if wakeup can not be
> > > enabled/disabled for particular source...?
> >
> > Pavel,
> >
> > Could you please try the patch below and let me know if it fixes the
> > problem for you?
>
> (sorry for long delay).
>
> With 33-rc1+your patch, warnings are no longer there.
>
Thank you for testing.
> I still have one on irq191, but that's gpio button driver.
>
> But please, hold the patch for few more days. I may have cleaner/nicer
> solution. It seems that zaurus is doing something very stupid in low layers.
Sorry, it is already upstream. However I do think that the change is
needed. As long as set_irq_wake() may return an error the driver should
handle such error. Especially matrix_keypad that operates with large
number of GPIOs but has only one knob for enabling wakeup.
--
Dmitry
On Sat 2010-01-02 23:57:33, Dmitry Torokhov wrote:
> On Sat, Jan 02, 2010 at 02:56:09PM +0100, Pavel Machek wrote:
> > Hi!
> >
> > > > > We ignore the failure right now in the mainline but that causes stack
> > > > > traces on resume as we trying to disable not enabled wakeup GPIOs. That
> > > > > was original Pavel's complaint.
> > > >
> > > > Yep...
> > > >
> > > > I'd say that BUG() simply should not trigger if wakeup can not be
> > > > enabled/disabled for particular source...?
> > >
> > > Pavel,
> > >
> > > Could you please try the patch below and let me know if it fixes the
> > > problem for you?
> >
> > (sorry for long delay).
> >
> > With 33-rc1+your patch, warnings are no longer there.
> >
>
> Thank you for testing.
>
> > I still have one on irq191, but that's gpio button driver.
> >
> > But please, hold the patch for few more days. I may have cleaner/nicer
> > solution. It seems that zaurus is doing something very stupid in low layers.
>
> Sorry, it is already upstream. However I do think that the change is
> needed. As long as set_irq_wake() may return an error the driver should
> handle such error. Especially matrix_keypad that operates with large
> number of GPIOs but has only one knob for enabling wakeup.
Ok, no problem. I still get problems with gpio-button driver, but
there wakeup is per-button so... I'll just fix the wakeup handling on
zaurus.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html