[Gen9, Gen10 General] Quallenauge:
I would like to give a status update on the 3.4 kernel project.

The ducati remoteproc issue is partly solved. I turns out, that no race condition with the rpmsg drivers but the mailbox initialization after suspend/resume was the cause.

In short, on suspend, the mailbox handle is freed. (If no mailbox handle is active, the mailbox device can be shutdown to save energy).

On resume, a new mailbox handle is acquired, but this isn't functional :( .

The workaround is to hold the handle on suspend (see here omap_remoteproc.c#L468).

But I really want to know, why we can't give that handle back. The rpmsg does the same, and there (.../plat-omap/omap_rpmsg.c#L272) it seems to work.

Current (important) issue is the battery drain, I can't get the L4_PER power domain to enter the sleep mode. It seems that an active UART3 is causing that behavior, but I don't initialize them :eek: Maybe it is some wrong set mux configuration?

I don't have experience how to solve that :( Maybe someone else?

That's the output when the device is on battery and wakeup after I pressed the PowerButton:

[ 837.674102] PM: suspend of devices complete after 241.607 msecs
[ 837.674896] PM: late suspend of devices complete after 0.762 msecs
[ 837.676300] omap_device: omapdss_dpi: omap_device not built
[ 837.677032] PM: noirq suspend of devices complete after 2.075 msecs
[ 837.677062] Disabling non-boot CPUs ...
[ 837.679016] CPU1: shutdown
[ 837.680877] Resume timer @65535.000Secs(2147450880 ticks @ 32768 Hz)
<--- Suspended
----> Wakeup
[ 837.680908] PD_CORE curr=ON prev=ON logic=ON
[ 837.680908] PD_L4_PER curr=ON prev=ON logic=ON
[ 837.680908] [B]UART3 mode=ENABLED idlest=ON[/B] <-- Why the hell is this UART3 on and can't enter the the RET/OFF state?
[ 837.680908] Powerdomain (core_pwrdm) didn't enter target state OSWR (achieved=ON current=ON saved=ON)
[ 837.680908] Powerdomain (l4per_pwrdm) didn't enter target state OSWR (achieved=ON current=ON saved=OSWR)
[ 837.680908] Could not enter target state in pm_suspend
[ 837.680908] At Resume: IRQ 39(TWL6030-PIH)(OMAP-IRQ=7) Pending! Wakeup Enable: CPU0=no,CPU1=no
[ 837.680908] At Resume: IRQ 40(unknown)(OMAP-IRQ=8) Pending! Wakeup Enable: CPU0=no,CPU1=no
[ 837.680908] At Resume pending I/O pad: Reg - 0x4A1001EC, CONTROL_PADCONF_WAKEUPEVENT_5[13]
[ 837.680908] Suspended for 1713.722 seconds
[ 837.681335] wakeup wake lock: alarm
[ 837.681579] Enabling non-boot CPUs ...
[ 837.699279] CPU1: Booted secondary processor
[ 837.699371] CPU1: Unknown IPI message 0x1
[ 837.700408] CPU1 is up

Another bunch of output at this time (after wakeup):

root@android:/sys/kernel/debug/pm_debug # cat count
mpu_pwrdm (ON),OFF:0,RET:6,INA:0,ON:7,RET-LOGIC-OFF:6,RET-MEMBANK1-OFF:6,RET-MEMBANK2-OFF:0
cefuse_pwrdm (OFF),OFF:2,RET:0,INA:0,ON:1,RET-LOGIC-OFF:1
always_on_core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0
l4per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0
l3init_pwrdm (ON),OFF:0,RET:124,INA:0,ON:125,RET-LOGIC-OFF:124,RET-MEMBANK1-OFF:124
cam_pwrdm (OFF),OFF:4,RET:0,INA:0,ON:3,RET-LOGIC-OFF:3,RET-MEMBANK1-OFF:3
ivahd_pwrdm (OFF),OFF:7,RET:0,INA:0,ON:6,RET-LOGIC-OFF:6,RET-MEMBANK1-OFF:6,RET-MEMBANK2-OFF:6,RET-MEMBANK3-OFF:6,RET-MEMBANK4-OFF:6
cpu1_pwrdm (ON),OFF:6,RET:0,INA:0,ON:7,RET-LOGIC-OFF:6,RET-MEMBANK1-OFF:6
cpu0_pwrdm (ON),OFF:6,RET:0,INA:0,ON:7,RET-LOGIC-OFF:6,RET-MEMBANK1-OFF:6
tesla_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0
dss_pwrdm (ON),OFF:10,RET:0,INA:0,ON:10,RET-LOGIC-OFF:9,RET-MEMBANK1-OFF:9
abe_pwrdm (ON),OFF:8,RET:0,INA:0,ON:8,RET-LOGIC-OFF:7,RET-MEMBANK1-OFF:7,RET-MEMBANK2-OFF:7
gfx_pwrdm (OFF),OFF:3032,RET:0,INA:0,ON:3031,RET-LOGIC-OFF:3031,RET-MEMBANK1-OFF:3031
core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0,RET-MEMBANK4-OFF:0,RET-MEMBANK5-OFF:0
DEVICE-OFF:0
root@android:/sys/kernel/debug/pm_debug # cat enable_off_mode
0
root@android:/sys/kernel/debug/pm_debug # cat time
mpu_pwrdm (ON),OFF:0,RET:837408264159,INA:0,ON:0
cefuse_pwrdm (OFF),OFF:0,RET:0,INA:0,ON:760375976
always_on_core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:0
l4per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:0
l3init_pwrdm (ON),OFF:0,RET:839205200184,INA:0,ON:125405151377
cam_pwrdm (OFF),OFF:129569671630,RET:0,INA:0,ON:5093963623
ivahd_pwrdm (OFF),OFF:143420898436,RET:0,INA:0,ON:3354003907
cpu1_pwrdm (ON),OFF:837425933836,RET:0,INA:0,ON:0
cpu0_pwrdm (ON),OFF:837408172606,RET:0,INA:0,ON:0
tesla_pwrdm (ON),OFF:0,RET:0,INA:0,ON:0
dss_pwrdm (ON),OFF:38283813476,RET:0,INA:0,ON:801565582275
abe_pwrdm (ON),OFF:17723510742,RET:0,INA:0,ON:820126831054
gfx_pwrdm (OFF),OFF:1010457305904,RET:0,INA:0,ON:46512420657
core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:0
root@android:/sys/kernel/debug/pm_debug # cat usecount
vdd:wakeup: 1
powerdomain:wkup_pwrdm: 1
clockdomain:l4_wkup_clkdm: 1
gpio1: enabled
timer1: enabled
ck:bandgap_ts_fclk: 1
ck:timer1_fck: 1
ck:gpio1_ick: 1
vdd:core: 3
powerdomain:l4per_pwrdm: 1
clockdomain:l4_per_clkdm: 2
gpio2: enabled
gpio3: enabled
gpio4: enabled
gpio6: enabled
uart1: enabled
uart3: enabled
ck:uart3_fck: 1
ck:uart1_fck: 1
ck:gpio6_ick: 1
ck:gpio4_ick: 1
ck:gpio3_ick: 1
ck:gpio2_ick: 1
powerdomain:dss_pwrdm: 1
clockdomain:l3_dss_clkdm: 1
dss_core: enabled
dss_dispc: enabled
dss_dsi2: enabled
ck:dss_dss_clk: 3
ck:dss_sys_clk: 1
powerdomain:core_pwrdm: 2
vdd:iva: 2
powerdomain:ivahd_pwrdm: 1
powerdomain:abe_pwrdm: 1
clockdomain:abe_clkdm: 1
timer8: enabled
ck:timer8_fck: 1
vdd:mpu: 1
powerdomain:mpu_pwrdm: 2
root@android:/sys/kernel/debug/pm_debug # cat wakeup_timer_milliseconds
0
root@android:/sys/kernel/debug/pm_debug # cat wakeup_timer_seconds
65535

On the current state the power drain is around 2,5%/1h. I wan't more ;)

Next issue to solve is the microphone input. I get the omap driver working for audio output by simply go around the device detection and force them to blaze tablet (Oh I missed to checkin that file :o, but look around here: device/ti/common-open/audio/audio_hw.c. I have to look further to the kernel logs.... (This is the same for the stock kernel - so this is a general challenge :highfive: ).

Also I have some errors, when I disconnect the usb cable from the device. Maybe I have to review the twl6030 code again (and again (and again(and again))).

[ 837.661285] PVR: PVRSRVDriverSuspend(pDevice=ed4f8600)
[ 837.661346] PVR: SysSystemPrePowerState: Entering state D3
[ 837.661376] PVR: Uninstalling device LISR on IRQ 53 with cookie eca9b680
[ 837.661437] PVR: DisableSystemClocks: Disabling System Clocks
[ 837.671051] ------------[ cut here ]------------
[ 837.671112] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113 l3_interrupt_handler+0xd8/0x198()
[ 837.671142] L3 custom error: MASTER:MPU TARGET:L4 PER2
[ 837.671173] Modules linked in: wlcore_sdio(O) pvrsrvkm_sgx540_120(O) btwilink(O) tty_hci bnep(O) hci_uart(O) hidp(O) rfcomm(O) bluetooth(O) wl12xx(O) wlcore(O) mac80211(O) cfg80211(O) compat(O) tr16c0_i2c cypress_tma340
[ 837.671325] Backtrace:
[ 837.671386] [<c00187c4>] (dump_backtrace+0x0/0x138) from [<c06b1cb8>] (dump_stack+0x18/0x1c)
[ 837.671417] r6:c003ec0c r5:00000009 r4:eb4e5b48 r3:00000000
[ 837.671508] [<c06b1ca0>] (dump_stack+0x0/0x1c) from [<c004ea24>] (warn_slowpath_common+0x5c/0x74)
[ 837.671539] [<c004e9c8>] (warn_slowpath_common+0x0/0x74) from [<c004eae0>] (warn_slowpath_fmt+0x38/0x40)
[ 837.671569] r8:00000026 r7:c0a238f4 r6:80080003 r5:c00081c0 r4:f00f8b00
[ 837.671600] r3:00000009
[ 837.671661] [<c004eaa8>] (warn_slowpath_fmt+0x0/0x40) from [<c003ec0c>] (l3_interrupt_handler+0xd8/0x198)
[ 837.671661] r3:c09a61a8 r2:c083fd60
[ 837.671722] [<c003eb34>] (l3_interrupt_handler+0x0/0x198) from [<c00b7f4c>] (handle_irq_event_percpu+0xc8/0x310)
[ 837.671783] [<c00b7e84>] (handle_irq_event_percpu+0x0/0x310) from [<c00b81d8>] (handle_irq_event+0x44/0x64)
[ 837.671813] [<c00b8194>] (handle_irq_event+0x0/0x64) from [<c00bb194>] (handle_fasteoi_irq+0xb0/0x138)
[ 837.671844] r6:c0976190 r5:c00081c0 r4:c0976140 r3:00000000
[ 837.671905] [<c00bb0e4>] (handle_fasteoi_irq+0x0/0x138) from [<c00b7724>] (generic_handle_irq+0x28/0x38)
[ 837.671936] r6:c0970538 r5:c0998d38 r4:0000002a r3:c00bb0e4
[ 837.671997] [<c00b76fc>] (generic_handle_irq+0x0/0x38) from [<c0014d74>] (handle_IRQ+0x68/0xdc)
[ 837.672027] r4:c00081c0 r3:00000272
[ 837.672058] [<c0014d0c>] (handle_IRQ+0x0/0xdc) from [<c0008518>] (gic_handle_irq+0x38/0x78)
[ 837.672119] [<c00084e0>] (gic_handle_irq+0x0/0x78) from [<c06bea40>] (__irq_svc+0x40/0x70)
[ 837.672149] Exception stack(0xeb4e5c98 to 0xeb4e5ce0)
[ 837.672180] 5c80: c09c2410 600f0113
[ 837.672210] 5ca0: 00000002 00000000 c09c23c0 c09c2410 600f0113 c031d70c ed4c6208 ed4c6270
[ 837.672241] 5cc0: 00000000 eb4e5cec eb4e5cf0 eb4e5ce0 c002b7d4 c06bded8 600f0113 ffffffff
[ 837.672271] r6:ffffffff r5:600f0113 r4:c06bded8 r3:c002b7d4
[ 837.672332] [<c06bdeb4>] (_raw_spin_unlock_irqrestore+0x0/0x50) from [<c002b7d4>] (omap_hwmod_disable_wakeup+0x78/0x134)
[ 837.672393] [<c002b75c>] (omap_hwmod_disable_wakeup+0x0/0x134) from [<c0026da4>] (omap_uart_enable_wakeup+0x34/0x40)
[ 837.672424] r6:ed4e1140 r5:ed4c6208 r4:ed6f5410
[ 837.672485] [<c0026d70>] (omap_uart_enable_wakeup+0x0/0x40) from [<c02f3efc>] (serial_omap_suspend+0x8c/0xb0)
[ 837.672546] [<c02f3e70>] (serial_omap_suspend+0x0/0xb0) from [<c031d740>] (platform_pm_suspend+0x34/0x5c)
[ 837.672576] r6:ed4c623c r5:00000000 r4:00000000 r3:c02f3e70
[ 837.672637] [<c031d70c>] (platform_pm_suspend+0x0/0x5c) from [<c0322a90>] (dpm_run_callback.isra.4+0x34/0x74)
[ 837.672698] [<c0322a5c>] (dpm_run_callback.isra.4+0x0/0x74) from [<c0323684>] (__device_suspend+0x188/0x2d8)
[ 837.672729] r8:c0c97c3c r7:00000002 r6:ed4c623c r5:c00081c0 r4:ed4c6208
[ 837.672790] [<c03234fc>] (__device_suspend+0x0/0x2d8) from [<c0324210>] (dpm_suspend+0xac/0x2b0)
[ 837.672790] r7:c09df780 r6:c00081c0 r5:c0a08a78 r4:ed4c6208
[ 837.672851] [<c0324164>] (dpm_suspend+0x0/0x2b0) from [<c0324700>] (dpm_suspend_start+0x6c/0x78)
[ 837.672912] [<c0324694>] (dpm_suspend_start+0x0/0x78) from [<c0092f88>] (suspend_devices_and_enter+0xa8/0x3e4)
[ 837.672943] r5:00000003 r4:00000000
[ 837.673004] [<c0092ee0>] (suspend_devices_and_enter+0x0/0x3e4) from [<c00934d8>] (pm_suspend+0x214/0x248)
[ 837.673034] [<c00932c4>] (pm_suspend+0x0/0x248) from [<c00947bc>] (suspend+0x80/0x218)
[ 837.673065] r8:c00081c0 r7:ed450000 r6:c0c3f280 r5:000021de r4:c00081c0
[ 837.673095] r3:c09a84f0
[ 837.673156] [<c009473c>] (suspend+0x0/0x218) from [<c006b240>] (process_one_work+0x148/0x4e4)
[ 837.673187] r6:c0c3f280 r5:eb4e4000 r4:ec414380
[ 837.673217] [<c006b0f8>] (process_one_work+0x0/0x4e4) from [<c006b958>] (worker_thread+0x16c/0x384)
[ 837.673278] [<c006b7ec>] (worker_thread+0x0/0x384) from [<c0070380>] (kthread+0x98/0xa4)
[ 837.673339] [<c00702e8>] (kthread+0x0/0xa4) from [<c0053118>] (do_exit+0x0/0x804)
[ 837.673370] r6:c0053118 r5:c00702e8 r4:ea9bbec4
[ 837.673400] Board Information:
[ 837.673400] Revision : 0005
[ 837.673431] Serial	: 0000000000000000
[ 837.673431] SoC Information:
[ 837.673431] CPU	: OMAP4460
[ 837.673461] Rev	: ES1.1
[ 837.673461] Type	: GP
[ 837.673461] Production ID: 8002B94E-000200F0
[ 837.673461] Die ID	: 3EA80002-00000001-0A3D0CEE-1000901B
[ 837.673492]
[ 837.673492] ---[ end trace 4f1acd1948c07986 ]---

Another issue to solve is the external SDCard. No detection for now.

So that's all for now. In general, the android system feels smooth with this kernel (maybe it's my illusion). Benchmark results are really the same with the stock kernel (as mostly expected - because the 3.0 kernel isn't bad).

So then...attached is a boot log (only kernel messages, not from adb).