android_kernel_motorola_sm6225/drivers/i2c/busses
Maxime Bizon 3269bb63eb i2c-mv64xxx: Fix random oops at boot
I have a Marvell board which has the same i2c hw block than mv64xxx, so
I'm trying to use i2c-mv64xxx driver.

But I get the following random oops at boot:

Unable to handle kernel NULL pointer dereference at virtual address 00000002
Backtrace: 
[<c0397e4c>] (mv64xxx_i2c_intr+0x0/0x2b8) from [<c02879c4>] (__do_irq+0x4c/0x8c)
[<c0287978>] (__do_irq+0x0/0x8c) from [<c0287c0c>] (do_level_IRQ+0x68/0xc0)
 r8 = C0501E08  r7 = 00000005  r6 = C0501E08  r5 = 00000005
 r4 = C048BB78 
[<c0287ba4>] (do_level_IRQ+0x0/0xc0) from [<c02885f8>] (asm_do_IRQ+0x50/0x134)
 r6 = C0449C78  r5 = F1020000  r4 = FFFFFFFF 
[<c02885a8>] (asm_do_IRQ+0x0/0x134) from [<c02869c4>] (__irq_svc+0x24/0x100)
 r8 = C1CAC400  r7 = 00000005  r6 = 00000002  r5 = F1020000
 r4 = FFFFFFFF 
[<c0287efc>] (setup_irq+0x0/0x124) from [<c02880d0>] (request_irq+0xb0/0xd0)
 r7 = C041B2AC  r6 = C0397E4C  r5 = 00000000  r4 = 00000005
[<c0288020>] (request_irq+0x0/0xd0) from [<c03985f4>] (mv64xxx_i2c_probe+0x148/0x244)
[<c03984ac>] (mv64xxx_i2c_probe+0x0/0x244) from [<c038bedc>] (platform_drv_probe+0x20/0x24)


The oops is caused by a spurious interrupt that occurs when request_irq
is called. mv64xxx_i2c_fsm() tries to read drv_data->msg, which is NULL.

I noticed that hardware init is done after requesting irq. Thus any
pending irq from previous hardware usage may cause this.

The following patch fixes it:


Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-01-05 17:54:05 +01:00
..
i2c-ali15x3.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-ali1535.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-ali1563.c hwmon: Update Rudolf Marek's e-mail address 2006-12-12 18:18:30 +01:00
i2c-amd756-s4882.c [PATCH] I2C: i2c-amd756-s4882: Improve static mutex initialization 2006-03-23 14:21:54 -08:00
i2c-amd756.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-amd8111.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-at91.c i2c: New Atmel AT91 bus driver 2006-12-10 21:21:30 +01:00
i2c-au1550.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-au1550.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
i2c-elektor.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-hydra.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-i801.c i2c: Enable PEC on more i2c-i801 devices 2006-12-10 21:21:33 +01:00
i2c-i810.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-ibm_iic.c i2c: Add request/release_mem_region to i2c-ibm_iic bus driver 2006-12-10 21:21:29 +01:00
i2c-ibm_iic.h fix file specification in comments 2006-10-03 23:01:26 +02:00
i2c-iop3xx.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
i2c-iop3xx.h [PATCH] i2c-iop3xx: Avoid addressing self 2006-07-12 15:43:06 -07:00
i2c-isa.c hwmon: Let w83781d and lm78 load again 2006-10-18 13:03:09 -07:00
i2c-ixp4xx.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-ixp2000.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-mpc.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
i2c-mv64xxx.c i2c-mv64xxx: Fix random oops at boot 2007-01-05 17:54:05 +01:00
i2c-nforce2.c i2c: Cleanups to the i2c-nforce2 bus driver 2006-12-10 21:21:29 +01:00
i2c-ocores.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
i2c-omap.c i2c: Fix OMAP clock prescaler to match the comment 2006-12-10 21:21:34 +01:00
i2c-parport-light.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-parport.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-parport.h [PATCH] i2c-parport: Make type parameter mandatory 2006-04-14 11:18:34 -07:00
i2c-pca-isa.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-piix4.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-pnx.c i2c-pnx: Fix interrupt handler, get rid of EARLY config option 2007-01-04 13:07:03 +01:00
i2c-powermac.c [POWERPC] Fix i2c-powermac platform device usage 2006-10-10 13:56:13 +10:00
i2c-prosavage.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-pxa.c [ARM] Remove EEPROM slave emulation from i2c-pxa driver. 2006-11-30 12:24:45 +00:00
i2c-rpx.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
i2c-s3c2410.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
i2c-savage4.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-sibyte.c [PATCH] i2c-sibyte: Fix modular build breakage 2006-09-29 09:34:17 -07:00
i2c-sis96x.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-sis630.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-sis5595.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-stub.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-versatile.c i2c: New ARM Versatile/Realview bus driver 2006-12-10 21:21:32 +01:00
i2c-via.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
i2c-viapro.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c-voodoo3.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00
Kconfig i2c-pnx: Fix interrupt handler, get rid of EARLY config option 2007-01-04 13:07:03 +01:00
Makefile i2c: New ARM Versatile/Realview bus driver 2006-12-10 21:21:32 +01:00
scx200_acb.c [PATCH] scx200_acb: handle PCI errors 2006-11-20 09:42:05 -08:00
scx200_i2c.c i2c: Discard the i2c algo del_bus wrappers 2006-12-10 21:21:33 +01:00