Skip to content

Bug pause - #2364

Merged
lgirdwood merged 1 commit into
thesofproject:masterfrom
ktrzcinx:bug-pause
Mar 6, 2020
Merged

lgirdwood merged 1 commit into
thesofproject:masterfrom
ktrzcinx:bug-pause

Conversation

@ktrzcinx

@ktrzcinx ktrzcinx commented Feb 11, 2020 •

Copy link
Copy Markdown
Member

#2203

dw_dma: Remove redundant write pointer increment

Function dw_dma_increment_pointer is called in each
dw_dma_copy and moves write pointer by number of passed
bytes a priori. Its why this function shouldn't be called
after dma stops before whole transmission ends.
It leads to misalignment in data stored in any queue between
source buffer and output, with data written to this interface
and glitch when first data after release command come.

dw_dma: Shorten DW_DMA_TIMEOUT value below 1 ms

Timeout values above 1ms (task period) shouldn't happen.
In such a situation system agent is likely to panic
because of time drift, what shouldn't happen in such
a situation.

dw_dma: Suspend DMA channel in stop function

Suspend flag should be set regardless of draining mode to stop
draining data from source buffer.

ssp: Keep SSP connected with DMA in pause state

When there is not enough time to wait for FIFO empty and we care about
data continuous - like in pause state - then SSP should be kept connected
with DMA in pause state. Such a solution is less error prone.
After this change, glitches after pause/resume sequence disappear.

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find.

Comment thread src/drivers/dw/dma.c Resolved
Comment thread src/drivers/intel/cavs/ssp.c Resolved
@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

@fredoh9 do we have a DUT issue with BSW_CYN_MAX98090 ? Same tests are passing on BYT.
@ktrzcinx can you check internal CI

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like serious/well-structured work, but it would be useful if there was a cover letter or something that indicates what you are trying to fix. What is the issue with pause really? Is this a problem exposed by low-level tests, or something that can happen in a driver/linux environment.

Also I am not clear on how well the PAUSE is supported. To the best of my knowledge we didn't enable a number of hardware capabilities, e.g. to restore DMA context after resume.

Thanks!

Comment thread src/include/sof/drivers/dw-dma.h Resolved
Comment thread src/include/sof/drivers/ssp.h Resolved
@ktrzcinx

Copy link
Copy Markdown
Member Author

Also I am not clear on how well the PAUSE is supported

@plbossart me too but from firmware side STOP and PAUSE are separate commands. I've checked my solution with low-level tests only.

@ktrzcinx can you check internal CI

As I see there is introduced one issue, I'm going to fix it.

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan @tlauda @slawblauciak seeing this on several PRs now on APL

kernel: [  559.964590] sof-audio-pci 0000:00:0e.0: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
kernel: [  559.964596] sof-audio-pci 0000:00:0e.0: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
kernel: [  560.469206] sof-audio-pci 0000:00:0e.0: error: ipc timed out for 0x80010000 size 120

Do we have a issue # for this on bug scrub ?

@xiulipan

Copy link
Copy Markdown
Contributor

@lgirdwood We also find IPC timeout issue on APL/TGL now. @ranj063 @fredoh9 @ClarexZhou thesofproject/linux#1783 #2348
please help to root cause or bisect the issue

@ktrzcinx ktrzcinx changed the title [RFC] Bug pause Bug pause Feb 13, 2020
@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan @zrombel has ran some tests and does not see this at his end on latest master. Could be a DUT issue since it always seems to be APL nocdec.
@ktrzcinx the BSW failures are NOT ipc timeouts and need to be addressed (IPC returns an error code - no FW crash)

@tlauda

tlauda commented Feb 13, 2020

Copy link
Copy Markdown
Contributor

@lgirdwood @zrombel I think we need more testing regarding IPC timeout. In this PR #2367 it failed on two separate APL platforms and both times on DAI config for SSP5. It looks very suspicious. Also DMIC DAI config timeout disappeared with some random changes in the FW, so I suspect some kind of memory issue.

@ktrzcinx
ktrzcinx force-pushed the bug-pause branch 3 times, most recently from be47dea to 0df7b6f Compare February 13, 2020 13:32
Comment thread src/drivers/imx/sai.c Resolved
@ktrzcinx
ktrzcinx force-pushed the bug-pause branch 3 times, most recently from 5e2358d to dbe26c5 Compare February 14, 2020 07:53
@slawblauciak

Copy link
Copy Markdown
Collaborator

@lgirdwood I don't think we do

@ktrzcinx

Copy link
Copy Markdown
Member Author

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

@ktrzcinx any idea why TestPtpComplexStreamOperations24000Hz24b32b4ch would fail ?
@xiulipan @fredoh9 what's the ETA for restoring BDW on last working kernel ?

@xiulipan

Copy link
Copy Markdown
Contributor

@lgirdwood From suggestion of @wenqingfu, we will keep the BDW status to track when the BDW will recovery. For SOF PR that need to check BDW status, we can do some manually check. Is that OK for you?

@ktrzcinx
ktrzcinx force-pushed the bug-pause branch 2 times, most recently from fca6b96 to 2447e7f Compare February 25, 2020 08:59
@ktrzcinx

Copy link
Copy Markdown
Member Author

@ktrzcinx any idea why TestPtpComplexStreamOperations24000Hz24b32b4ch would fail ?

@lgirdwood after rerun (without code change), TestKdSsp16000Hz16b16b2ch failed and TestPtpComplexStreamOperations24000Hz24b32b4ch pass, so I guess it's some CI issue.

@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

Running CI again for BDW test. Internal CI will need bisected.

@ktrzcinx
ktrzcinx force-pushed the bug-pause branch 2 times, most recently from 4022181 to 30ba115 Compare February 28, 2020 10:29
@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@juimonen juimonen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the commit message, there's quite a lot of typos etc.

  1. continuous -> continuity?
  2. "Such a solution is less error prone.", remove this sentence altogether
  3. in paused state and after channel stop state should be preprare, to be
    conistent with sof-docs -> typos and grammar

@ktrzcinx
ktrzcinx force-pushed the bug-pause branch 2 times, most recently from 89056d2 to 2838df2 Compare March 2, 2020 13:45
@lgirdwood

Copy link
Copy Markdown
Member

@plbossart @keyonjie I'm assuming the PM failures on BDW are known/WIP and wont block this merging ?

@keyonjie

keyonjie commented Mar 3, 2020

Copy link
Copy Markdown
Contributor

@plbossart @keyonjie I'm assuming the PM failures on BDW are known/WIP and wont block this merging ?

I remember @ranj063 was working on BYT/CHT/BDW PM implementation but looks not integrated yet? But I am not sure if we will hit error or the driver will just not do power cycle and everything looks fine when system suspending triggered on BDW? @plbossart @ranj063 do you know the latest status about this?

@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

Let me retry, I did see this pass yesterday so it could be the DUT or a recent kernel update.

When there is not enough time to wait for FIFO empty and we care about
data continuity - like in pause state - then SSP should be kept connected
with DMA in pause state.
Stop function has been updated to take action also on channels in
COMP_STATE_PAUSED state. After receiving COMP_TRIGGER_STOP,
component state should be set to COMP_STATE_PREPARE,
what is consistent with sof-docs.
Introduced changes have positive impact on glitches after
pause/resume sequence.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
@lgirdwood
lgirdwood merged commit 6cd8acc into thesofproject:master Mar 6, 2020
@ktrzcinx
ktrzcinx deleted the bug-pause branch March 10, 2020 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.