There does seem to be a kernel crash if c64.ko is loaded after unloading dspbridge (bridgedriver.ko) though
Yea I noticed that when I tried dspbridge last week. Looks like a power management issue, i.e. the DSP probably cannot be powered on after dspbridge has been used and that's why the registers are not available and an access to them causes the non-linefetch error.
[64126.819885] c64::dsp_poweroff: IVA2_PRM_PWSTST=0x00000000 => DSP is OFF
[64126.821472] c64: exit OK.
[64150.421020] bridgedriver: module is from the staging directory, the quality is unknown, you have been warned.
[64150.507934] proc_load: Processor Loaded /lib/dsp/baseimage.dof
[64150.510955] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfb038034
[64150.511077] Internal error: : 1028 [#1]
[64150.511138] Modules linked in: bridgedriver(C+) mailbox_mach mailbox wl1251_sdio wl1251 aufs squashfs xz_dec aes_generic bluetooth mac80211 cfg80211 ecb omaplfb(O) pvrsrvkm(O) zram(C) snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ipv6 fuse ads7846 hwmon [last unloaded: c64]
[64150.513183] CPU: 0 Tainted: G C O (3.2.45 #895)
[64150.513336] PC is at omap_dm_timer_start+0x48/0xb8
[64150.513427] LR is at 0xfb038034
[64150.513488] pc : [<c0036368>] lr : [<fb038034>] psr: 20000013
[64150.513488] sp : d7bcdad8 ip : 00000001 fp : db92db80
[64150.513702] r10: d7ac3000 r9 : 00000001 r8 : 00000001
[64150.513854] r7 : 00000001 r6 : 00000001 r5 : 00000003 r4 : db8f4600
[64150.513916] r3 : c05872fc r2 : 00000000 r1 : 00000000 r0 : 00000000
[64150.514068] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[64150.514160] Control: 10c5387d Table: 97b1c019 DAC: 55555555
[64150.514282] Process modprobe (pid: 2974, stack limit = 0xd7bcc238)
[64150.514434] Stack: (0xd7bcdad8 to 0xd7bce000)
[64150.514495] dac0: 00000005 bf266a40
[64150.514648] dae0: 00000002 bf24b000 00000000 00000090 daecac00 00000001 bf262458 bf249d94
[64150.514739] db00: 00000090 daecaf64 daecac00 00000000 d7bcdb44 bf249378 00000000 d7bcdb3c
[64150.514892] db20: 00000001 00000001 daecaf80 dc8f0000 bf266cdc dc8f0004 00000001 00000000
[64150.515014] db40: c00cebf0 00000000 00000000 00000011 00003843 00000090 00000010 303d4449
[64150.515167] db60: c0592400 11000000 00000000 00000000 d0c43e80 00000001 00000000 db92db80
[64150.515258] db80: 00003843 0000001c 00000032 bf258b94 d7bcdbb5 d0d70300 20255c00 da7ce000
[64150.515380] dba0: d0c43e80 d7bcdbb5 d0d70300 bf2594bc 000080d0 696c2f00 73642f62 61622f70
[64150.515533] dbc0: 6d696573 2e656761 00666f64 00000000 00000000 00000000 00000000 00000000
[64150.515625] dbe0: 00000000 80080008 00000000 00000000 00000000 00000000 00000000 db802300
[64150.515777] dc00: d7bcdc60 c00c7d04 c05d8dc4 d955ee00 d955ee00 bf24b760 d7bcdc40 bf250c10
[64150.515899] dc20: d955ee00 bf24b7a8 bf24b760 d955ee64 bf24b7f0 bf24ba08 00000032 d955ee54
[64150.516052] dc40: bf24b7e8 bf24b7e8 00000000 00000000 00000000 c007c801 00000000 00000000
[64150.516143] dc60: 00000000 00000000 00000000 bf24b6d8 bf24b760 bf24b7a8 bf24b828 bf24b7f0
[64150.516296] dc80: dc400000 d0db0840 00000032 c00c7d04 bf24b7f0 00000000 d0db0840 d7bcdcd8
[64150.516418] dca0: bf266808 bf251cd4 c05d8dc4 d955ee00 d0db0400 d7bcdbb5 00000000 000046b8
[64150.516571] dcc0: 00000000 d0d70300 bf266c64 d0db0440 bf266808 bf24f3f4 da7ce808 00d70300
[64150.516662] dce0: d7bcde10 d7bcde10 00000000 bf25adbc 4f495400 3150414d 00303135 00000000
[64150.516784] dd00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.516937] dd20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517028] dd40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517181] dd60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517303] dd80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517456] dda0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517547] ddc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[64150.517669] dde0: 00000000 00000000 00000000 00000000 da7ce808 d0db0480 d0db0400 d0c42488
[64150.517822] de00: d0db0440 bf2620f4 00000000 db92f808 db92f810 00000000 db92f808 c05e1f3c
[64150.517974] de20: db92f83c bf266838 bf26d000 c027eadc c027eac4 c027d6f0 db92f808 bf266838
[64150.518035] de40: db92f83c 00000000 bf26d000 c027d88c bf266838 c027d800 00000000 c027c7d8
[64150.518188] de60: db805938 db92de30 bf266838 c05a6b10 d0c43900 c027d0c0 bf264c6c d0d48000
[64150.518341] de80: d7ac3540 bf266838 bf2668d4 d7bcc000 00000000 bf26d000 00003843 0000001c
[64150.518432] dea0: 00000032 c027ddac 00000000 c05b5180 bf2668d4 d7bcc000 00000000 bf26d000
[64150.518554] dec0: 0000001c c000866c d7b7bf40 00000000 0000003b d7b7bf40 00000000 bf26691c
[64150.518707] dee0: bf26691c bf2668d4 00000001 d0db0140 00000001 0000001c 00000032 c006d55c
[64150.518859] df00: bf2668e0 0003b000 00000000 bf266a08 d7bcc000 e0e3cb8c e0e3cac4 00000003
[64150.518951] df20: d0c43680 e0e1a000 0003a31b e0e408a0 e0e4068c e0e50ad8 d7b30800 00023ce8
[64150.519073] df40: 00026a78 00000000 00000000 00000030 00000031 00000025 00000029 0000001f
[64150.519226] df60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c050c944
[64150.519378] df80: 51e15080 00009720 00000000 00000000 00000080 c0013e28 d7bcc000 00000000
[64150.519439] dfa0: 00000000 c0013c80 00009720 00000000 40207000 0003a31b 00016100 00016100
[64150.519592] dfc0: 00009720 00000000 00000000 00000080 00000000 000160a4 00016098 00000000
[64150.519744] dfe0: 000160f0 bef1d964 0000b180 401a3264 60000010 40207000 ebfff17b e5951000
[64150.519927] [<c0036368>] (omap_dm_timer_start+0x48/0xb8) from [<bf24b000>] (dsp_clk_enable+0xb8/0x120 [bridgedriver])
[64150.520172] [<bf24b000>] (dsp_clk_enable+0xb8/0x120 [bridgedriver]) from [<bf249d94>] (dsp_peripheral_clk_ctrl+0xf4/0x168 [bridgedriver])
[64150.520355] [<bf249d94>] (dsp_peripheral_clk_ctrl+0xf4/0x168 [bridgedriver]) from [<bf249378>] (bridge_brd_start+0x2cc/0x4e8 [bridgedriver])
[64150.520629] [<bf249378>] (bridge_brd_start+0x2cc/0x4e8 [bridgedriver]) from [<bf258b94>] (proc_start+0x90/0x118 [bridgedriver])
[64150.520843] [<bf258b94>] (proc_start+0x90/0x118 [bridgedriver]) from [<bf2594bc>] (proc_auto_start+0x1c0/0x204 [bridgedriver])
[64150.521057] [<bf2594bc>] (proc_auto_start+0x1c0/0x204 [bridgedriver]) from [<bf24f3f4>] (api_init_complete2+0x8c/0xa8 [bridgedriver])
[64150.521270] [<bf24f3f4>] (api_init_complete2+0x8c/0xa8 [bridgedriver]) from [<bf25adbc>] (dsp_init+0xec/0x100 [bridgedriver])
[64150.521484] [<bf25adbc>] (dsp_init+0xec/0x100 [bridgedriver]) from [<bf2620f4>] (omap34_xx_bridge_probe+0x194/0x2f4 [bridgedriver])
[64150.521667] [<bf2620f4>] (omap34_xx_bridge_probe+0x194/0x2f4 [bridgedriver]) from [<c027eadc>] (platform_drv_probe+0x18/0x1c)
[64150.521820] [<c027eadc>] (platform_drv_probe+0x18/0x1c) from [<c027d6f0>] (driver_probe_device+0x9c/0x1ac)
[64150.521972] [<c027d6f0>] (driver_probe_device+0x9c/0x1ac) from [<c027d88c>] (__driver_attach+0x8c/0x90)
[64150.522064] [<c027d88c>] (__driver_attach+0x8c/0x90) from [<c027c7d8>] (bus_for_each_dev+0x64/0x88)
[64150.522216] [<c027c7d8>] (bus_for_each_dev+0x64/0x88) from [<c027d0c0>] (bus_add_driver+0x1ec/0x2ac)
[64150.522369] [<c027d0c0>] (bus_add_driver+0x1ec/0x2ac) from [<c027ddac>] (driver_register+0x78/0x17c)
[64150.522491] [<c027ddac>] (driver_register+0x78/0x17c) from [<c000866c>] (do_one_initcall+0x34/0x174)
[64150.522644] [<c000866c>] (do_one_initcall+0x34/0x174) from [<c006d55c>] (sys_init_module+0xe0/0x1b80)
[64150.522796] [<c006d55c>] (sys_init_module+0xe0/0x1b80) from [<c0013c80>] (ret_fast_syscall+0x0/0x30)
[64150.522888] Code: e5845044 e3a00000 e8bd8038 e594e028 (e59ec000)
[64150.523040] ------------[ cut here ]------------
[64150.523132] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:161 omap3_l3_app_irq+0xe8/0x134()
[64150.523284] In-band Error seen by MPU at address 0
[64150.523345] Modules linked in: bridgedriver(C+) mailbox_mach mailbox wl1251_sdio wl1251 aufs squashfs xz_dec aes_generic bluetooth mac80211 cfg80211 ecb omaplfb(O) pvrsrvkm(O) zram(C) snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ipv6 fuse ads7846 hwmon [last unloaded: c64]
[64150.525390] [<c001a6a0>] (unwind_backtrace+0x0/0xf8) from [<c003f21c>] (warn_slowpath_common+0x54/0x64)
[64150.525543] [<c003f21c>] (warn_slowpath_common+0x54/0x64) from [<c003f2c0>] (warn_slowpath_fmt+0x30/0x40)
[64150.525634] [<c003f2c0>] (warn_slowpath_fmt+0x30/0x40) from [<c002eb70>] (omap3_l3_app_irq+0xe8/0x134)
[64150.525787] [<c002eb70>] (omap3_l3_app_irq+0xe8/0x134) from [<c007b6c0>] (handle_irq_event_percpu+0x54/0x194)
[64150.525939] [<c007b6c0>] (handle_irq_event_percpu+0x54/0x194) from [<c007b828>] (handle_irq_event+0x28/0x38)
[64150.526092] [<c007b828>] (handle_irq_event+0x28/0x38) from [<c007d544>] (handle_level_irq+0x84/0x108)
[64150.526245] [<c007d544>] (handle_level_irq+0x84/0x108) from [<c007afc4>] (generic_handle_irq+0x30/0x40)
[64150.526397] [<c007afc4>] (generic_handle_irq+0x30/0x40) from [<c0014b54>] (handle_IRQ+0x38/0x84)
[64150.526489] [<c0014b54>] (handle_IRQ+0x38/0x84) from [<c0013834>] (__irq_svc+0x34/0x78)
[64150.526611] [<c0013834>] (__irq_svc+0x34/0x78) from [<c003f2d0>] (oops_exit+0x0/0x18)
[64150.526763] [<c003f2d0>] (oops_exit+0x0/0x18) from [<0000000b>] (0xb)
[64150.526855] ---[ end trace 2cd474fbe5489dfb ]---
[64150.527069] ---[ end trace 2cd474fbe5489dfc ]---
As you can see, dspbridge crashes in a similar way when it is started after c64.ko has been unloaded (
external abort on non-linefetch (0x1028) at 0xfb038034), see the log above. No idea why it's doing that and I have never seen a crash like that with c64_tools alone (
(un-)loaded the module dozens of times w/o rebooting)
ok I have the OS package which can at least load core image and run fractal demo. There is still that problem with libc64.so.1, so I added temporary hack for that. I also miss my inc_libc64_mini.h
Nice. I'll add a workaround today for the seemingly broken linker on my dev host, then you can build a properly versioned .so on yours. And you'll get your "mini" include helper
It's nice that power management is fully working (it's often major PITA to do on OMAP3), I can keep c64.ko loaded and fully suspend the system and resume without problems (what can't be always said about dspbridge). Plus just having c64.ko loaded doesn't seem to use any power.
Implementing the PM / power off was not as easy as I hoped, indeed. The HW only shuts down if all dependencies are met and the TRM did not mention the details. Well, it's working for two weeks now and I have not seen any issues with it.