2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 02:34:01 +08:00
linux-next/arch/arm/mach-omap1
Aaro Koskinen 07fd296d3a ARM: OMAP1: fix USB configuration use-after-release
All boards, except Amstrad E3, mark USB config with __initdata.

As a result, when you compile USB into modules, they will try to refer
already released platform data and the behaviour is undefined. For example
on Nokia 770, I get the following kernel panic when modprobing ohci-hcd:

[    3.462158] Unable to handle kernel paging request at virtual address e7fddef0
[    3.477050] pgd = c3434000
[    3.487365] [e7fddef0] *pgd=00000000
[    3.498535] Internal error: Oops: 80000005 [#1] ARM
[    3.510955] Modules linked in: ohci_hcd(+)
[    3.522705] CPU: 0    Not tainted  (3.7.0-770_tiny+ #5)
[    3.535552] PC is at 0xe7fddef0
[    3.546508] LR is at ohci_omap_init+0x5c/0x144 [ohci_hcd]
[    3.560272] pc : [<e7fddef0>]    lr : [<bf003140>]    psr: a0000013
[    3.560272] sp : c344bdb0  ip : c344bce0  fp : c344bdcc
[    3.589782] r10: 00000001  r9 : 00000000  r8 : 00000000
[    3.604553] r7 : 00000026  r6 : 000000de  r5 : c0227300  r4 : c342d620
[    3.621032] r3 : e7fddef0  r2 : c048b880  r1 : 00000000  r0 : 0000000a
[    3.637786] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[    3.655822] Control: 0005317f  Table: 13434000  DAC: 00000015
[    3.672790] Process modprobe (pid: 425, stack limit = 0xc344a1b8)
[    3.690643] Stack: (0xc344bdb0 to 0xc344c000)
[    3.707031] bda0:                                     bf0030e4 c342d620 00000000 c049e62c
[    3.727905] bdc0: c344be04 c344bdd0 c0150ff0 bf0030f4 bf001b88 00000000 c048a4ac c345b020
[    3.748870] bde0: c342d620 00000000 c048a468 bf003968 00000001 bf006000 c344be34 c344be08
[    3.769836] be00: bf001bf0 c0150e48 00000000 c344be18 c00b9bfc c048a478 c048a4ac bf0037f8
[    3.790985] be20: c012ca04 c000e024 c344be44 c344be38 c012d968 bf001a84 c344be64 c344be48
[    3.812164] be40: c012c8ac c012d95c 00000000 c048a478 c048a4ac bf0037f8 c344be84 c344be68
[    3.833740] be60: c012ca74 c012c80c 20000013 00000000 c344be88 bf0037f8 c344beac c344be88
[    3.855468] be80: c012b038 c012ca14 c38093cc c383ee10 bf0037f8 c35be5a0 c049d5e8 00000000
[    3.877166] bea0: c344bebc c344beb0 c012c40c c012aff4 c344beec c344bec0 c012bfc0 c012c3fc
[    3.898834] bec0: bf00378c 00000000 c344beec bf0037f8 00067f39 00000000 00005c44 c000e024
[    3.920837] bee0: c344bf14 c344bef0 c012cd54 c012befc c04ce080 00067f39 00000000 00005c44
[    3.943023] bf00: c000e024 bf006000 c344bf24 c344bf18 c012db14 c012ccc0 c344bf3c c344bf28
[    3.965423] bf20: bf00604c c012dad8 c344a000 bf003834 c344bf7c c344bf40 c00087ac bf006010
[    3.987976] bf40: 0000000f bf003834 00067f39 00000000 00005c44 bf003834 00067f39 00000000
[    4.010711] bf60: 00005c44 c000e024 c344a000 00000000 c344bfa4 c344bf80 c004c35c c0008720
[    4.033569] bf80: c344bfac c344bf90 01422192 01427ea0 00000000 00000080 00000000 c344bfa8
[    4.056518] bfa0: c000dec0 c004c2f0 01422192 01427ea0 01427ea0 00005c44 00067f39 00000000
[    4.079406] bfc0: 01422192 01427ea0 00000000 00000080 b6e11008 014221aa be941fcc b6e1e008
[    4.102569] bfe0: b6ef6300 be941758 0000e93c b6ef6310 60000010 01427ea0 00000000 00000000
[    4.125946] Backtrace:
[    4.143463] [<bf0030e4>] (ohci_omap_init+0x0/0x144 [ohci_hcd]) from [<c0150ff0>] (usb_add_hcd+0x1b8/0x61c)
[    4.183898]  r6:c049e62c r5:00000000 r4:c342d620 r3:bf0030e4
[    4.205596] [<c0150e38>] (usb_add_hcd+0x0/0x61c) from [<bf001bf0>] (ohci_hcd_omap_drv_probe+0x17c/0x224 [ohci_hcd])
[    4.248138] [<bf001a74>] (ohci_hcd_omap_drv_probe+0x0/0x224 [ohci_hcd]) from [<c012d968>] (platform_drv_probe+0x1c/0x20)
[    4.292144]  r8:c000e024 r7:c012ca04 r6:bf0037f8 r5:c048a4ac r4:c048a478
[    4.316192] [<c012d94c>] (platform_drv_probe+0x0/0x20) from [<c012c8ac>] (driver_probe_device+0xb0/0x208)
[    4.360168] [<c012c7fc>] (driver_probe_device+0x0/0x208) from [<c012ca74>] (__driver_attach+0x70/0x94)
[    4.405548]  r6:bf0037f8 r5:c048a4ac r4:c048a478 r3:00000000
[    4.429809] [<c012ca04>] (__driver_attach+0x0/0x94) from [<c012b038>] (bus_for_each_dev+0x54/0x90)
[    4.475708]  r6:bf0037f8 r5:c344be88 r4:00000000 r3:20000013
[    4.500366] [<c012afe4>] (bus_for_each_dev+0x0/0x90) from [<c012c40c>] (driver_attach+0x20/0x28)
[    4.528442]  r7:00000000 r6:c049d5e8 r5:c35be5a0 r4:bf0037f8
[    4.553466] [<c012c3ec>] (driver_attach+0x0/0x28) from [<c012bfc0>] (bus_add_driver+0xd4/0x228)
[    4.581878] [<c012beec>] (bus_add_driver+0x0/0x228) from [<c012cd54>] (driver_register+0xa4/0x134)
[    4.629730]  r8:c000e024 r7:00005c44 r6:00000000 r5:00067f39 r4:bf0037f8
[    4.656738] [<c012ccb0>] (driver_register+0x0/0x134) from [<c012db14>] (platform_driver_register+0x4c/0x60)
[    4.706542] [<c012dac8>] (platform_driver_register+0x0/0x60) from [<bf00604c>] (ohci_hcd_mod_init+0x4c/0x8c [ohci_hcd])
[    4.757843] [<bf006000>] (ohci_hcd_mod_init+0x0/0x8c [ohci_hcd]) from [<c00087ac>] (do_one_initcall+0x9c/0x174)
[    4.808990]  r4:bf003834 r3:c344a000
[    4.832641] [<c0008710>] (do_one_initcall+0x0/0x174) from [<c004c35c>] (sys_init_module+0x7c/0x194)
[    4.881530] [<c004c2e0>] (sys_init_module+0x0/0x194) from [<c000dec0>] (ret_fast_syscall+0x0/0x2c)
[    4.930664]  r7:00000080 r6:00000000 r5:01427ea0 r4:01422192
[    4.956481] Code: bad PC value
[    4.978729] ---[ end trace 58280240f08342c4 ]---
[    5.002258] Kernel panic - not syncing: Fatal exception

Fix this by taking a copy of the data. Also mark Amstrad E3's data with
__initdata to save some memory with multi-board kernels.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2013-01-03 11:31:40 -08:00
..
include/mach ARM: OMAP: Remove NEED_MACH_GPIO_H 2012-11-02 12:00:36 -07:00
ams-delta-fiq-handler.S ARM: OMAP1: Move board-ams-delta.h from plat to mach 2012-09-20 15:02:19 -07:00
ams-delta-fiq.c ARM: OMAP1: Move board-ams-delta.h from plat to mach 2012-09-20 15:02:19 -07:00
board-ams-delta.c ARM: OMAP1: fix USB configuration use-after-release 2013-01-03 11:31:40 -08:00
board-fsample.c ARM: arm-soc: Board updates for 3.8 2012-12-12 12:14:06 -08:00
board-generic.c ARM: OMAP1: Remove omap_reserve() callback for all omap1 boards 2012-10-18 16:22:21 -07:00
board-h2-mmc.c ARM: OMAP: Split plat/mmc.h into local headers and platform_data 2012-10-15 12:09:43 -07:00
board-h2.c ARM: arm-soc: power management and clock changes 2012-12-13 10:58:20 -08:00
board-h2.h
board-h3-mmc.c ARM: OMAP: Split plat/mmc.h into local headers and platform_data 2012-10-15 12:09:43 -07:00
board-h3.c ARM: arm-soc: power management and clock changes 2012-12-13 10:58:20 -08:00
board-h3.h
board-htcherald.c ARM: OMAP1: Remove omap_reserve() callback for all omap1 boards 2012-10-18 16:22:21 -07:00
board-innovator.c ARM: OMAP: Fix relative includes for fpga.h 2012-10-31 15:37:14 -07:00
board-nand.c ARM: OMAP1: board files: deduplicate and clean some NAND-related code 2012-04-13 06:34:31 -06:00
board-nokia770.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2012-12-18 12:46:37 -08:00
board-osk.c ARM: OMAP1: Remove omap_reserve() callback for all omap1 boards 2012-10-18 16:22:21 -07:00
board-palmte.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
board-palmtt.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
board-palmz71.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
board-perseus2.c ARM: arm-soc: Board updates for 3.8 2012-12-12 12:14:06 -08:00
board-sx1-mmc.c ARM: OMAP: Split plat/mmc.h into local headers and platform_data 2012-10-15 12:09:43 -07:00
board-sx1.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
board-voiceblue.c ARM: OMAP1: Remove omap_reserve() callback for all omap1 boards 2012-10-18 16:22:21 -07:00
clock_data.c ARM: OMAP: Split sram.h to local headers and minimal shared header 2012-10-31 10:14:13 -07:00
clock.c ARM: OMAP: Split sram.h to local headers and minimal shared header 2012-10-31 10:14:13 -07:00
clock.h ARM: OMAP: clock: split plat/clkdev_omap.h into OMAP1/2 files 2012-10-18 16:23:30 -07:00
common.h omap prcm changes via Paul Walmsley <paul@pwsan.com>: 2012-11-30 08:40:31 -08:00
devices.c omap prcm changes via Paul Walmsley <paul@pwsan.com>: 2012-11-30 08:40:31 -08:00
dma.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
dma.h ARM: OMAP1: DMA: Moving OMAP1 DMA channel definitions to mach-omap1 2012-10-15 14:01:01 -07:00
fb.c ARM: OMAP: Split fb.c to remove last remaining cpu_is_omap usage 2012-12-17 10:50:40 -08:00
flash.c ARM: OMAP1: Move plat/tc.h to mach/tc.h for omap1 2012-10-17 11:36:40 -07:00
fpga.c ARM: OMAP: Fix relative includes for fpga.h 2012-10-31 15:37:14 -07:00
fpga.h ARM: OMAP: Fix relative includes for fpga.h 2012-10-31 15:37:14 -07:00
gpio7xx.c ARM: OMAP: Remove NEED_MACH_GPIO_H 2012-11-02 12:00:36 -07:00
gpio15xx.c ARM: OMAP: Remove NEED_MACH_GPIO_H 2012-11-02 12:00:36 -07:00
gpio16xx.c ARM: OMAP: Remove NEED_MACH_GPIO_H 2012-11-02 12:00:36 -07:00
i2c.c ARM: OMAP: Fix relative includes for shared i2c.h file 2012-10-31 15:37:13 -07:00
id.c ARM: OMAP: Split plat/cpu.h into local soc.h for mach-omap1 and mach-omap2 2012-10-18 16:23:46 -07:00
io.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
iomap.h ARM: OMAP1: Remove relative includes 2012-10-31 15:37:14 -07:00
irq.c ARM: OMAP: Split plat/cpu.h into local soc.h for mach-omap1 and mach-omap2 2012-10-18 16:23:46 -07:00
Kconfig ARM: config: sort select statements alphanumerically 2012-10-13 17:11:28 +01:00
lcd_dma.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
mailbox.c arm: fix implicit module.h users by adding it to arch/arm as required. 2011-10-31 19:30:50 -04:00
Makefile ARM: OMAP: Split fb.c to remove last remaining cpu_is_omap usage 2012-12-17 10:50:40 -08:00
Makefile.boot ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mcbsp.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
mmc.h ARM: OMAP: Split plat/mmc.h into local headers and platform_data 2012-10-15 12:09:43 -07:00
mux.c ARM: OMAP1: Make plat/mux.h omap1 only 2012-09-20 14:54:57 -07:00
ocpi.c ARM: OMAP1: OCPI: move to mach-omap1/ 2012-04-13 06:34:27 -06:00
opp_data.c ARM: OMAP: clock: split plat/clkdev_omap.h into OMAP1/2 files 2012-10-18 16:23:30 -07:00
opp.h ARM: OMAP1: Move dpll1 rates selection from config to runtime 2011-12-08 18:02:23 -08:00
pm_bus.c ARM: OMAP1: fix build breakage introduced by commit 25c7d49ed4 2012-10-26 13:19:06 -06:00
pm.c ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h 2012-11-30 08:41:50 -08:00
pm.h ARM: 6649/1: omap: use fncpy to copy the PM code functions to SRAM 2011-02-04 14:26:08 +00:00
reset.c ARM: OMAP2+: PRCM: remove obsolete prcm.[ch] 2012-11-08 15:09:26 -07:00
serial.c ARM: OMAP: Make plat/fpga.h local to arch/arm/plat-omap 2012-10-17 11:36:37 -07:00
sleep.S ARM: OMAP1: Remove relative includes 2012-10-31 15:37:14 -07:00
soc.h ARM: OMAP1: Remove relative includes 2012-10-31 15:37:14 -07:00
sram-init.c ARM: OMAP: Move omap1 specific code to local sram.c 2012-10-31 10:14:14 -07:00
sram.h ARM: OMAP: Split sram.h to local headers and minimal shared header 2012-10-31 10:14:13 -07:00
sram.S ARM: OMAP: Remove remaining includes for mach/io.h 2012-03-06 21:34:38 -06:00
time.c ARM: mach-omap1: retire custom LED code 2012-08-01 11:22:13 +08:00
timer32k.c ARM: OMAP: Remove unnecessary inclusion of dmtimer.h 2012-11-16 10:35:08 -06:00
timer.c ARM: OMAP: Add platform data header for DMTIMERs 2012-11-16 10:35:08 -06:00
usb.c ARM: OMAP1: fix USB configuration use-after-release 2013-01-03 11:31:40 -08:00