From: Greg Kroah-Hartman Date: Wed, 28 Mar 2012 22:50:05 +0000 (-0700) Subject: 3.2-stable patches X-Git-Tag: v3.0.27~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b34da272913cc30bd72215d8fd0691f6c43ca3e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.2-stable patches added patches: gpio-davinci-fix-enabling-unbanked-gpio-irqs.patch gpio-davinci-fix-oops-on-unbanked-gpio-irq-request.patch gpio-omap-fix-_set_gpio_irqenable-implementation.patch mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch udf-fix-deadlock-in-udf_release_file.patch --- diff --git a/queue-3.2/gpio-davinci-fix-enabling-unbanked-gpio-irqs.patch b/queue-3.2/gpio-davinci-fix-enabling-unbanked-gpio-irqs.patch new file mode 100644 index 00000000000..d034d846ed2 --- /dev/null +++ b/queue-3.2/gpio-davinci-fix-enabling-unbanked-gpio-irqs.patch @@ -0,0 +1,63 @@ +From 81b279d80a63628e580c71a31d30a8c3b3047ad4 Mon Sep 17 00:00:00 2001 +From: Sekhar Nori +Date: Sun, 11 Mar 2012 18:16:12 +0530 +Subject: gpio/davinci: fix enabling unbanked GPIO IRQs + +From: Sekhar Nori + +commit 81b279d80a63628e580c71a31d30a8c3b3047ad4 upstream. + +Unbanked GPIO IRQ handling code made a copy of just +the irq_chip structure for GPIO IRQ lines which caused +problems after the generic IRQ chip conversion because +there was no valid irq_chip_type structure with the +right "regs" populated. irq_gc_mask_set_bit() was +therefore accessing random addresses. + +Fix it by making a copy of irq_chip_type structure +instead. This will ensure sane register offsets. + +Reported-by: Jon Povey +Tested-by: Jon Povey +Signed-off-by: Sekhar Nori +Signed-off-by: Grant Likely +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-davinci.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/gpio/gpio-davinci.c ++++ b/drivers/gpio/gpio-davinci.c +@@ -386,7 +386,7 @@ static int __init davinci_gpio_irq_setup + * IRQ mux conflicts; gpio_irq_type_unbanked() is only for GPIOs. + */ + if (soc_info->gpio_unbanked) { +- static struct irq_chip gpio_irqchip_unbanked; ++ static struct irq_chip_type gpio_unbanked; + + /* pass "bank 0" GPIO IRQs to AINTC */ + chips[0].chip.to_irq = gpio_to_irq_unbanked; +@@ -394,9 +394,10 @@ static int __init davinci_gpio_irq_setup + + /* AINTC handles mask/unmask; GPIO handles triggering */ + irq = bank_irq; +- gpio_irqchip_unbanked = *irq_get_chip(irq); +- gpio_irqchip_unbanked.name = "GPIO-AINTC"; +- gpio_irqchip_unbanked.irq_set_type = gpio_irq_type_unbanked; ++ gpio_unbanked = *container_of(irq_get_chip(irq), ++ struct irq_chip_type, chip); ++ gpio_unbanked.chip.name = "GPIO-AINTC"; ++ gpio_unbanked.chip.irq_set_type = gpio_irq_type_unbanked; + + /* default trigger: both edges */ + g = gpio2regs(0); +@@ -405,7 +406,7 @@ static int __init davinci_gpio_irq_setup + + /* set the direct IRQs up to use that irqchip */ + for (gpio = 0; gpio < soc_info->gpio_unbanked; gpio++, irq++) { +- irq_set_chip(irq, &gpio_irqchip_unbanked); ++ irq_set_chip(irq, &gpio_unbanked.chip); + irq_set_handler_data(irq, &chips[gpio / 32]); + irq_set_status_flags(irq, IRQ_TYPE_EDGE_BOTH); + } diff --git a/queue-3.2/gpio-davinci-fix-oops-on-unbanked-gpio-irq-request.patch b/queue-3.2/gpio-davinci-fix-oops-on-unbanked-gpio-irq-request.patch new file mode 100644 index 00000000000..6f80b0a0261 --- /dev/null +++ b/queue-3.2/gpio-davinci-fix-oops-on-unbanked-gpio-irq-request.patch @@ -0,0 +1,150 @@ +From ab2dde9924dd1ddb791fa8b14aa52e1df681e20c Mon Sep 17 00:00:00 2001 +From: Sekhar Nori +Date: Sun, 11 Mar 2012 18:16:11 +0530 +Subject: gpio/davinci: fix oops on unbanked gpio irq request + +From: Sekhar Nori + +commit ab2dde9924dd1ddb791fa8b14aa52e1df681e20c upstream. + +Unbanked GPIO irq setup code was overwriting chip_data leading +to the following oops on request_irq() + +Unable to handle kernel paging request at virtual address febfffff +pgd = c22dc000 +[febfffff] *pgd=00000000 +Internal error: Oops: 801 [#1] PREEMPT +Modules linked in: mcu(+) edmak irqk cmemk +CPU: 0 Not tainted (3.0.0-rc7+ #93) +PC is at irq_gc_mask_set_bit+0x68/0x7c +LR is at vprintk+0x22c/0x484 +pc : [] lr : [] psr: 60000093 +sp : c33e3ba0 ip : c33e3af0 fp : c33e3bc4 +r10: c04555bc r9 : c33d4340 r8 : 60000013 +r7 : 0000002d r6 : c04555bc r5 : fec67010 r4 : 00000000 +r3 : c04734c8 r2 : fec00000 r1 : ffffffff r0 : 00000026 +Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user +Control: 0005317f Table: 822dc000 DAC: 00000015 +Process modprobe (pid: 526, stack limit = 0xc33e2270) +Stack: (0xc33e3ba0 to 0xc33e4000) +3ba0: 00000000 c007d3d4 c33e3bcc c04555bc c04555bc c33d4340 c33e3bdc c33e3bc8 +3bc0: c007f5f8 c0080bb4 00000000 c04555bc c33e3bf4 c33e3be0 c007f654 c007f5c0 +3be0: 00000000 c04555bc c33e3c24 c33e3bf8 c007e6e8 c007f618 c01f2284 c0350af8 +3c00: c0405214 bf016c98 00000001 00000000 c33dc008 0000002d c33e3c54 c33e3c28 +3c20: c007e888 c007e408 00000001 c23ef880 c33dc000 00000000 c33dc080 c25caa00 +3c40: c0487498 bf017078 c33e3c94 c33e3c58 bf016b44 c007e7d4 bf017078 c33dc008 +3c60: c25caa08 c33dc008 c33e3c84 bf017484 c25caa00 c25caa00 c01f5f48 c25caa08 +3c80: c0496d60 bf017484 c33e3ca4 c33e3c98 c022a698 bf01692c c33e3cd4 c33e3ca8 +3ca0: c01f5d88 c022a688 00000000 bf017484 c25caa00 c25caa00 c01f5f48 c25caa08 +3cc0: c0496d60 00000000 c33e3cec c33e3cd8 c01f5f8c c01f5d10 00000000 c33e3cf0 +3ce0: c33e3d14 c33e3cf0 c01f5210 c01f5f58 c303cb48 c25ecf94 c25caa00 c25caa00 +3d00: c25caa34 c33e3dd8 c33e3d34 c33e3d18 c01f6044 c01f51b8 c0496d3c c25caa00 +3d20: c044e918 c33e3dd8 c33e3d44 c33e3d38 c01f4ff4 c01f5fcc c33e3d94 c33e3d48 +3d40: c01f3d10 c01f4fd8 00000000 c044e918 00000000 00000000 c01f52c0 c034d570 +3d60: c33e3d84 c33e3d70 c022bf84 c25caa00 00000000 c044e918 c33e3dd8 c25c2e00 +3d80: c0496d60 bf01763c c33e3db4 c33e3d98 c022b1a0 c01f384c c25caa00 c33e3dd8 +3da0: 00000000 c33e3dd8 c33e3dd4 c33e3db8 c022b27c c022b0e8 00000000 bf01763c +3dc0: c0451c80 c33e3dd8 c33e3e34 c33e3dd8 bf016f60 c022b210 5f75636d 746e6f63 +3de0: 006c6f72 00000000 00000000 00000000 00000000 00000000 00000000 bf0174bc +3e00: 00000000 00989680 00000000 00000020 c0451c80 c0451c80 bf0174dc c01f5eb0 +3e20: c33f0f00 bf0174dc c33e3e44 c33e3e38 c01f72f4 bf016e2c c33e3e74 c33e3e48 +3e40: c01f5d88 c01f72e4 00000000 c0451c80 c0451cb4 bf0174dc c01f5eb0 c33f0f00 +3e60: c0473100 00000000 c33e3e94 c33e3e78 c01f5f44 c01f5d10 00000000 c33e3e98 +3e80: bf0174dc c01f5eb0 c33e3ebc c33e3e98 c01f5534 c01f5ec0 c303c038 c3061c30 +3ea0: 00003cd8 00098258 bf0174dc c0462ac8 c33e3ecc c33e3ec0 c01f5bec c01f54dc +3ec0: c33e3efc c33e3ed0 c01f4d30 c01f5bdc bf0173a0 c33e2000 00003cd8 00098258 +3ee0: bf0174dc c33e2000 c00301a4 bf019000 c33e3f1c c33e3f00 c01f6588 c01f4c8c +3f00: 00003cd8 00098258 00000000 c33e2000 c33e3f2c c33e3f20 c01f777c c01f6524 +3f20: c33e3f3c c33e3f30 bf019014 c01f7740 c33e3f7c c33e3f40 c002f3ec bf019010 +3f40: 00000000 00003cd8 00098258 bf017518 00000000 00003cd8 00098258 bf017518 +3f60: 00000000 c00301a4 c33e2000 00000000 c33e3fa4 c33e3f80 c007b934 c002f3c4 +3f80: c00b307c c00b2f48 00003cd8 00000000 00000003 00000080 00000000 c33e3fa8 +3fa0: c0030020 c007b8b8 00003cd8 00000000 00098288 00003cd8 00098258 00098240 +3fc0: 00003cd8 00000000 00000003 00000080 00098008 00098028 00098288 00000001 +3fe0: be892998 be892988 00013d7c 40178740 60000010 00098288 09089041 00200845 +Backtrace: +[] (irq_gc_mask_set_bit+0x0/0x7c) from [] (irq_enable+0x48/0x58) + r6:c33d4340 r5:c04555bc r4:c04555bc +[] (irq_enable+0x0/0x58) from [] (irq_startup+0x4c/0x54) + r5:c04555bc r4:00000000 +[] (irq_startup+0x0/0x54) from [] (__setup_irq+0x2f0/0x3cc) + r5:c04555bc r4:00000000 +[] (__setup_irq+0x0/0x3cc) from [] (request_threaded_irq+0xc4/0x110) + r8:0000002d r7:c33dc008 r6:00000000 r5:00000001 r4:bf016c98 +[] (request_threaded_irq+0x0/0x110) from [] (mcu_spi_probe+0x228/0x37c [mcu]) +[] (mcu_spi_probe+0x0/0x37c [mcu]) from [] (spi_drv_probe+0x20/0x24) +[] (spi_drv_probe+0x0/0x24) from [] (driver_probe_device+0x88/0x1b0) +[] (driver_probe_device+0x0/0x1b0) from [] (__device_attach+0x44/0x48) +[] (__device_attach+0x0/0x48) from [] (bus_for_each_drv+0x68/0x94) + r5:c33e3cf0 r4:00000000 +[] (bus_for_each_drv+0x0/0x94) from [] (device_attach+0x88/0xa0) + r7:c33e3dd8 r6:c25caa34 r5:c25caa00 r4:c25caa00 +[] (device_attach+0x0/0xa0) from [] (bus_probe_device+0x2c/0x4c) + r7:c33e3dd8 r6:c044e918 r5:c25caa00 r4:c0496d3c +[] (bus_probe_device+0x0/0x4c) from [] (device_add+0x4d4/0x648) +[] (device_add+0x0/0x648) from [] (spi_add_device+0xc8/0x128) +[] (spi_add_device+0x0/0x128) from [] (spi_new_device+0x7c/0xb4) + r7:c33e3dd8 r6:00000000 r5:c33e3dd8 r4:c25caa00 +[] (spi_new_device+0x0/0xb4) from [] (mcu_probe+0x144/0x224 [mcu]) + r7:c33e3dd8 r6:c0451c80 r5:bf01763c r4:00000000 +[] (mcu_probe+0x0/0x224 [mcu]) from [] (platform_drv_probe+0x20/0x24) +[] (platform_drv_probe+0x0/0x24) from [] (driver_probe_device+0x88/0x1b0) +[] (driver_probe_device+0x0/0x1b0) from [] (__driver_attach+0x94/0x98) +[] (__driver_attach+0x0/0x98) from [] (bus_for_each_dev+0x68/0x94) + r7:c01f5eb0 r6:bf0174dc r5:c33e3e98 r4:00000000 +[] (bus_for_each_dev+0x0/0x94) from [] (driver_attach+0x20/0x28) + r7:c0462ac8 r6:bf0174dc r5:00098258 r4:00003cd8 +[] (driver_attach+0x0/0x28) from [] (bus_add_driver+0xb4/0x258) +[] (bus_add_driver+0x0/0x258) from [] (driver_register+0x74/0x158) +[] (driver_register+0x0/0x158) from [] (platform_driver_register+0x4c/0x60) + r7:c33e2000 r6:00000000 r5:00098258 r4:00003cd8 +[] (platform_driver_register+0x0/0x60) from [] (mcu_init+0x14/0x20 [mcu]) +[] (mcu_init+0x0/0x20 [mcu]) from [] (do_one_initcall+0x38/0x170) +[] (do_one_initcall+0x0/0x170) from [] (sys_init_module+0x8c/0x1a4) +[] (sys_init_module+0x0/0x1a4) from [] (ret_fast_syscall+0x0/0x2c) + r7:00000080 r6:00000003 r5:00000000 r4:00003cd8 +Code: e1844003 e585400c e596300c e5932064 (e7814002) + +Fix the issue. + +Reported-by: Jon Povey +Signed-off-by: Sekhar Nori +Signed-off-by: Grant Likely +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-davinci.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/gpio/gpio-davinci.c ++++ b/drivers/gpio/gpio-davinci.c +@@ -313,10 +313,16 @@ static int gpio_to_irq_unbanked(struct g + return -ENODEV; + } + +-static int gpio_irq_type_unbanked(struct irq_data *d, unsigned trigger) ++static int gpio_irq_type_unbanked(struct irq_data *data, unsigned trigger) + { +- struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); +- u32 mask = (u32) irq_data_get_irq_handler_data(d); ++ struct davinci_gpio_controller *d; ++ struct davinci_gpio_regs __iomem *g; ++ struct davinci_soc_info *soc_info = &davinci_soc_info; ++ u32 mask; ++ ++ d = (struct davinci_gpio_controller *)data->handler_data; ++ g = (struct davinci_gpio_regs __iomem *)d->regs; ++ mask = __gpio_mask(data->irq - soc_info->gpio_irq); + + if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) + return -EINVAL; +@@ -400,8 +406,7 @@ static int __init davinci_gpio_irq_setup + /* set the direct IRQs up to use that irqchip */ + for (gpio = 0; gpio < soc_info->gpio_unbanked; gpio++, irq++) { + irq_set_chip(irq, &gpio_irqchip_unbanked); +- irq_set_handler_data(irq, (void *)__gpio_mask(gpio)); +- irq_set_chip_data(irq, (__force void *)g); ++ irq_set_handler_data(irq, &chips[gpio / 32]); + irq_set_status_flags(irq, IRQ_TYPE_EDGE_BOTH); + } + diff --git a/queue-3.2/gpio-omap-fix-_set_gpio_irqenable-implementation.patch b/queue-3.2/gpio-omap-fix-_set_gpio_irqenable-implementation.patch new file mode 100644 index 00000000000..70c935686ab --- /dev/null +++ b/queue-3.2/gpio-omap-fix-_set_gpio_irqenable-implementation.patch @@ -0,0 +1,39 @@ +From 8276536cec38bc6bde30d0aa67716f22b9b9705a Mon Sep 17 00:00:00 2001 +From: Tarun Kanti DebBarma +Date: Fri, 25 Nov 2011 15:27:37 +0530 +Subject: gpio/omap: fix _set_gpio_irqenable implementation + +From: Tarun Kanti DebBarma + +commit 8276536cec38bc6bde30d0aa67716f22b9b9705a upstream. + +This function should be capable of both enabling and disabling interrupts +based upon the *enable* parameter. Right now the function only enables +the interrupt and *enable* is not used at all. So add the interrupt +disable capability also using the parameter. + +Signed-off-by: Tarun Kanti DebBarma +Reviewed-by: Santosh Shilimkar +Acked-by: Felipe Balbi +Reviewed-by: Kevin Hilman +Signed-off-by: Kevin Hilman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-omap.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-omap.c ++++ b/drivers/gpio/gpio-omap.c +@@ -508,7 +508,10 @@ static void _disable_gpio_irqbank(struct + + static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable) + { +- _enable_gpio_irqbank(bank, GPIO_BIT(bank, gpio)); ++ if (enable) ++ _enable_gpio_irqbank(bank, GPIO_BIT(bank, gpio)); ++ else ++ _disable_gpio_irqbank(bank, GPIO_BIT(bank, gpio)); + } + + /* diff --git a/queue-3.2/mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch b/queue-3.2/mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch new file mode 100644 index 00000000000..209a8348b75 --- /dev/null +++ b/queue-3.2/mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch @@ -0,0 +1,43 @@ +From d2cb87c23e8514ca49c85adc5924999927bb9494 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Mon, 20 Feb 2012 21:32:32 +0000 +Subject: mfd: Test for jack detection when deciding if wm8994 should suspend + +From: Mark Brown + +commit d2cb87c23e8514ca49c85adc5924999927bb9494 upstream. + +The jack detection on WM1811 is often required during system suspend, add +it as another check when deciding if we should suspend. + +Signed-off-by: Mark Brown +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/wm8994-core.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/mfd/wm8994-core.c ++++ b/drivers/mfd/wm8994-core.c +@@ -252,6 +252,20 @@ static int wm8994_suspend(struct device + break; + } + ++ switch (wm8994->type) { ++ case WM1811: ++ ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2); ++ if (ret < 0) { ++ dev_err(dev, "Failed to read jackdet: %d\n", ret); ++ } else if (ret & WM1811_JACKDET_MODE_MASK) { ++ dev_dbg(dev, "CODEC still active, ignoring suspend\n"); ++ return 0; ++ } ++ break; ++ default: ++ break; ++ } ++ + /* Disable LDO pulldowns while the device is suspended if we + * don't know that something will be driving them. */ + if (!wm8994->ldo_ena_always_driven) diff --git a/queue-3.2/series b/queue-3.2/series index fb4a7997be4..0699b6a0e89 100644 --- a/queue-3.2/series +++ b/queue-3.2/series @@ -115,3 +115,8 @@ ext4-fix-race-between-sync-and-completed-io-work.patch ext4-check-for-zero-length-extent.patch vfs-fix-d_ancestor-case-in-d_materialize_unique.patch arm-tegra-select-required-cpu-and-l2-errata-options.patch +udf-fix-deadlock-in-udf_release_file.patch +gpio-omap-fix-_set_gpio_irqenable-implementation.patch +gpio-davinci-fix-oops-on-unbanked-gpio-irq-request.patch +gpio-davinci-fix-enabling-unbanked-gpio-irqs.patch +mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch diff --git a/queue-3.2/udf-fix-deadlock-in-udf_release_file.patch b/queue-3.2/udf-fix-deadlock-in-udf_release_file.patch new file mode 100644 index 00000000000..97fe17e7fbc --- /dev/null +++ b/queue-3.2/udf-fix-deadlock-in-udf_release_file.patch @@ -0,0 +1,38 @@ +From a0391a3ae91d301c0e59368531a4de5f0b122bcf Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 20 Feb 2012 17:49:56 +0100 +Subject: udf: Fix deadlock in udf_release_file() + +From: Jan Kara + +commit a0391a3ae91d301c0e59368531a4de5f0b122bcf upstream. + +udf_release_file() can be called from munmap() path with mmap_sem held. Thus +we cannot take i_mutex there because that ranks above mmap_sem. Luckily, +i_mutex is not needed in udf_release_file() anymore since protection by +i_data_sem is enough to protect from races with write and truncate. + +Reported-by: Al Viro +Reviewed-by: Namjae Jeon +Signed-off-by: Jan Kara +Signed-off-by: Greg Kroah-Hartman + +--- + fs/udf/file.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/fs/udf/file.c ++++ b/fs/udf/file.c +@@ -201,12 +201,10 @@ out: + static int udf_release_file(struct inode *inode, struct file *filp) + { + if (filp->f_mode & FMODE_WRITE) { +- mutex_lock(&inode->i_mutex); + down_write(&UDF_I(inode)->i_data_sem); + udf_discard_prealloc(inode); + udf_truncate_tail_extent(inode); + up_write(&UDF_I(inode)->i_data_sem); +- mutex_unlock(&inode->i_mutex); + } + return 0; + }