Skip to content

[Stress test]: fail to boot firmware after unloading and reloading SOF modules 55 times on BYT-nocodec #676

Closed

Description

@Jiangxinx

Summary:
Fail to boot firmware after unloading and reloading SOF modules 55 times on BYT-nocodec.
sof-logger is empty. sof-logger -t log is attached below.

dmesg:

[  150.707038] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[  150.707417] sof-audio-acpi 80860F28:01: ipc tx: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.707567] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.707641] sof-audio-acpi 80860F28:01: ipc tx: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.707786] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.707854] sof-audio-acpi 80860F28:01: ipc tx: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.707999] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.708049] sof-audio-acpi 80860F28:01: ipc tx: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.708197] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x50020000: GLB_COMP_MSG: GET_VALUE
[  150.708229] sof-audio-acpi 80860F28:01: ipc rx: 0x90020000: GLB_TRACE_MSG
[  150.708252] sof-audio-acpi 80860F28:01: ipc rx done: 0x90020000: GLB_TRACE_MSG
[  150.717893] sof-audio-acpi 80860F28:01: pcm: trigger stream 0 dir 1 cmd 1
[  150.717922] sof-audio-acpi 80860F28:01: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
[  150.721784] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.721823] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.721891] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.721913] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.721960] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.721982] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722023] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722043] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722079] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722099] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722133] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722153] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722188] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722207] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722256] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.722276] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 0 DAI position 0
[  150.787226] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.787285] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a4c
[  150.787288] sof-audio-acpi 80860F28:01: posn : host 0x3f00 dai 0x3d80 wall 0x1803f6
[  150.787291] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.801934] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0008: GLB_STREAM_MSG: POSITION
[  150.801993] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a00
[  150.801996] sof-audio-acpi 80860F28:01: posn : host 0x3f00 dai 0x3f00 wall 0x1893ed
[  150.801999] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0008: GLB_STREAM_MSG: POSITION
[  150.871260] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.871319] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a4c
[  150.871322] sof-audio-acpi 80860F28:01: posn : host 0x7e00 dai 0x7c80 wall 0x309ff4
[  150.871326] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.883177] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 8064 DAI position 7968
[  150.883231] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 8064 DAI position 7968
[  150.883254] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 8064 DAI position 7968
[  150.885967] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0008: GLB_STREAM_MSG: POSITION
[  150.886025] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a00
[  150.886029] sof-audio-acpi 80860F28:01: posn : host 0x7e00 dai 0x7e00 wall 0x312fed
[  150.886032] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0008: GLB_STREAM_MSG: POSITION
[  150.955324] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.955388] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a4c
[  150.955395] sof-audio-acpi 80860F28:01: posn : host 0xbd00 dai 0xbb80 wall 0x493bf5
[  150.955402] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0001: GLB_STREAM_MSG: POSITION
[  150.970144] sof-audio-acpi 80860F28:01: ipc rx: 0x600a0008: GLB_STREAM_MSG: POSITION
[  150.970209] sof-audio-acpi 80860F28:01: posn mailbox: posn offset is 0x144a00
[  150.970217] sof-audio-acpi 80860F28:01: posn : host 0xbd00 dai 0xbd00 wall 0x49cbed
[  150.970226] sof-audio-acpi 80860F28:01: ipc rx done: 0x600a0008: GLB_STREAM_MSG: POSITION
[  151.019597] sof-audio-acpi 80860F28:01: error: ipc timed out for 0x60040000 size 0xc
[  151.019796] sof-audio-acpi 80860F28:01: error: unexpected fault 0x600a0008 trace 0x60040000
[  151.019803] sof-audio-acpi 80860F28:01: error: waking up any trace sleepers
[  151.019816]  Passthrough: ASoC: trigger FE failed -110
[  151.019829] sof-audio-acpi 80860F28:01: pcm: trigger stream 0 dir 1 cmd 0
[  151.019855] sof-audio-acpi 80860F28:01: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[  151.020249] sof-audio-acpi 80860F28:01: ipc tx succeeded: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[  151.021121] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 12096 DAI position 12000
[  151.021170] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 12096 DAI position 12000
[  151.021308] sof-audio-acpi 80860F28:01: PCM: stream 0 dir 0 DMA position 12096 DAI position 12000

Test steps:

  1. sudo ./sof_bootloop.sh 100

Test env:
sof master: 82d29e0
kernel sof-dev: ee19d24
tplg: sof-byt-nocodec.tplg

Log:
boot_fail.log
logger.log

Activity

  1. added
    bugSomething isn't working
    BYTApplies to Baytrail platform
    on Feb 26, 2019
  2. juimonen commented on Feb 26, 2019

    @juimonen

    As I read the logs (and tested with my own minnow) we lose 1 component connect ipc message for timeout. At least for me the dsp or kernel doesn't crash, for some reason the message is not ever read in dsp (or by dsp) and kernel times out, but boot continues normally.

  3. juimonen commented on Feb 26, 2019

    @juimonen

    So for some reason the transfer is jammed, I get the jam in different place than the attached log, but anyway mechanism seems to be the same. You see in the logger huge delta in the timestamps when nothing is happening in the DSP -> we get timeout in driver side -> after erro processing we can again send and dsp is responding.

  4. juimonen commented on Feb 26, 2019

    @juimonen

    @plbossart @ranj063 any idea about this thing in byt? I saw you had some recent commits to ipc/doorbell.

  5. plbossart commented on Feb 26, 2019

    @plbossart
    Member

    @juimonen it's been an issue with BYT since I came back at the end of October, and no one seems to care but you and me... I have never been able to get the same reliability as Up2 for the module load/unload test, and even for regular playback I routinely get these IPC timeouts.

  6. wenqingfu commented on Feb 26, 2019

    @wenqingfu

    no one seems to care but you and me...

    not entirely true. @juimonen and @wenqingfu knew what happened. let's actively work on Minnow Board platform related bug from now on, and don't let Up2 fall like it. There are even some double-digit number issues still standing while our latest issue/PR number is close to 700 at the moment. cannot live with this anymore.

    I bet $5 it's a driver code bug in IPC.

  7. juimonen commented on Feb 28, 2019

    @juimonen

    so always when the timeout happens, dsp is sending some message to host before acking the message host had just sent. So the flow is 1) host->sends (wait for dsp ack) 2) dsp receives and processes 3) dsp sends different message than ack to host (like trace or stream position). 4) host never receives interrupt for the message it sent.
    So somehow the dsp sending message to host when host is waiting for ack loses the interrupt.

  8. plbossart commented on Feb 28, 2019

    @plbossart
    Member

    Thanks @juimonen. This could be a case of a deadlock, with both sides waiting for an ack. Wondering if this is tied to the lock protection of the IPC bits that seems a bit flaky.

  9. xiulipan commented on Mar 1, 2019

    @xiulipan

    @juimonen @plbossart

    So the flow is 1) host->sends (wait for dsp ack) 2) dsp receives and processes 3) dsp sends different message than ack to host (like trace or stream position). 4) host never receives interrupt for the message it sent.

    This sound like similar to me for some IPC timeout issues on APL that have been fixed. Maybe the BYT part have some different IPC regs.

    @juimonen For APL bug, we can try to increase the reproduce rate by enable TRACEV.

    @RanderWang @keyonjie What do you think?

  10. juimonen commented on Mar 1, 2019

    @juimonen

    Don't know if this helps, but here's the trace from fw and host side (my comments included). I don't
    know if the trace messages are in exact execution order. It seems that this a case of simultaneous send from both sides...

    FW:

    WFX
    schedule()
    WFE
    dw-dma: 0 channel work
    dw-dma: 0 channel 0 block end
    WFX
    ipc: msg tx -> 0x90020000 /* we send a trace message to host /
    schedule()
    WFE
    ipc: irq isr 0x2 /
    we receive the core enable message /
    _schedule_task()
    schedule()
    scheduler_run()
    schedule_edf()
    schedule_task_running()
    ipc: pm core mask 0x1 -> enable
    schedule_task_complete() /
    this should trigger interrupt in host, but it is not happening /
    WFX
    schedule()
    WFE
    ipc: irq isr 0x1 /
    we receive ack from host to trace msg send in the beginning */
    ipc: not rx -> 0x90020000
    WFX
    schedule()

    DRIVER:

    ipc tx: 0x40070000: GLB_PM_MSG: CORE_ENABLE /* send message to dsp and start wait for ack /
    ipc rx: 0x90020000: GLB_TRACE_MSG /
    we receive a lot of trace messages /
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    ipc rx: 0x90020000: GLB_TRACE_MSG
    ipc rx done: 0x90020000: GLB_TRACE_MSG
    error: ipc timed out for 0x40070000 size 0xc /
    never get the ack to tx, so we timeout and error */
    error: unexpected fault 0x90020000 trace 0x40070000
    error: waking up any trace sleepers
    error: core enable ipc failure
    error: DSP failed to add widget id 0 type 32 name : PIPELINE.2.SSP2.IN stream SSP2.IN reply 0
    ASoC: failed to load widget PIPELINE.2.SSP2.IN
    error: tplg component load failed -110

  11. RanderWang commented on Mar 4, 2019

    @RanderWang

    @juimonen @plbossart

    So the flow is 1) host->sends (wait for dsp ack) 2) dsp receives and processes 3) dsp sends different message than ack to host (like trace or stream position). 4) host never receives interrupt for the message it sent.

    This sound like similar to me for some IPC timeout issues on APL that have been fixed. Maybe the BYT part have some different IPC regs.

    @juimonen For APL bug, we can try to increase the reproduce rate by enable TRACEV.

    @RanderWang @keyonjie What do you think?

    which bug and the root reason ?

  12. Jiangxinx commented on Mar 4, 2019

    @Jiangxinx
    Author

    Passed on the daily test.

    Test steps:

    1.sudo ./sof_bootloop.sh 100

    Env:
    sof master: 24e241b
    kernel sof-dev: cf5978a
    tplg: sof-byt-nocodec.tplg

  13. juimonen commented on Mar 7, 2019

    @juimonen

    @wenqingfu I've been trying to debug this many days with not too much luck. @keyonjie spotted a issue of not properly masking and overwriting some send registers, but that didn't help. At this point I would really wait for @lyakh #695 and test with that one.

    The problem is very reproducible and relates to simultaneous send from fw and driver. It is either a deadlock or wrong interrupt clearance.

  14. lyakh commented on Mar 7, 2019

    @lyakh
    Collaborator

    ipc: msg tx -> 0x90020000 /* we send a trace message to host /

    isn't this a recursive endless IPC flood? In the IPC-sending routine we print a trace, which is sent via IPC, which prints a trace, which is sent via IPC?...

  15. juimonen commented on Mar 7, 2019

    @juimonen

    @lyakh not totally sure why this has many messages , but I've been able to reproduce this many times with just 1 msg to both directions. I think the byt/minnow is much slower than other platforms, so it is very visible here. I think I got it much rarer when I reduce the logging...

  16. lyakh commented on Mar 7, 2019

    @lyakh
    Collaborator

    I think it is rather important to find out whether we really have recursive tracing here. @lgirdwood is there anything that prevents such recursion?

  17. juimonen commented on Mar 11, 2019

    @juimonen

    #695 seems to fix this. I've run the bootloop script already twice without errors...

  18. plbossart commented on Mar 11, 2019

    @plbossart
    Member

    #695 seems to fix this. I've run the bootloop script already twice without errors...

    that's impressive, i've never been able to run that script to completion, IPC errors always happened after 50-80 cycles of unload/reload.

    What we need to check now is it #695 doesn't impact concurrency. It may solve serialization or missed messages, but we want to make sure there isn't a regression when we try multiple streams precisely because of a strong serialization.

  19. lyakh commented on Mar 11, 2019

    @lyakh
    Collaborator

    @plbossart FWIW I ran parallel capture and playback with that series on UP² with nocodec, but by all means it should be tested further, also on real hardware.

  20. plbossart commented on Mar 15, 2019

    @plbossart
    Member

    @Jiangxinx is this bug still current or can it be closed?

  21. Jiangxinx commented on Mar 18, 2019

    @Jiangxinx
    Author

    Passed on daily test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BYTApplies to Baytrail platformbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions