Skip to content

Fix IPC timeout issue on APL&CNL - #28

Merged
plbossart merged 8 commits into
thesofproject:topic/sof-devfrom
RanderWang:ipx_fix
Jul 11, 2018
Merged

plbossart merged 8 commits into
thesofproject:topic/sof-devfrom
RanderWang:ipx_fix

Conversation

@RanderWang

Copy link
Copy Markdown

I fix merge conflict issue on latest code

Rander Wang added 3 commits July 6, 2018 17:35
The IPC algorithm depends on the status of snd_sof_ipc_reply.
The failed case is processed different with success one

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
There are two direction now in cmd_done, one is reply of host to DSP,
another is reply of DSP to host.The origin cmd_done is for reply of
host to DSP.

Cmd_done should be called after host has processed the reply msg
from dsp. This function is for some platforms to do extra steps to
make the following ipc msgs sent safely. Now the direction supported
by cmd_done would be host reply to dsp or dsp reply to host.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Refine the implementation of is_dsp_ready on APL&CNL
BUSY bit means dsp is ready, DONE bit means host has
processed the reply msg. The next ipc msg should check
both bits to make sure both dsp and host is ready

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

ghost 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.

Please fix multi-line comment issues.
Also please explain what you do with the results from snd_sof_ipc_reply(). It looks like you are executing the test cases only when there is an error, not sure if this is really what you intended - or the comments are not self-explanatory

Comment thread sound/soc/sof/intel/hda-ipc.c Outdated

ghost Jul 9, 2018

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.

nit-pick: fix multi-line comments

Comment thread sound/soc/sof/intel/hda-ipc.c Outdated

ghost Jul 9, 2018

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.

comment style here as well

Comment thread sound/soc/sof/intel/hda-ipc.c Outdated

ghost Jul 9, 2018

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.

snd_soc_ipc_reply returns 0 or -EINVAL, the 1 isn't incorrect but misleading. Change to -EINVAL for consistency?

ghost Jul 10, 2018 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will change it to -EINVAL

Comment thread sound/soc/sof/intel/hda-ipc.c Outdated

ghost Jul 9, 2018

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.

is this what you want to do when the reply is -EINVAL?

ghost Jul 10, 2018 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, if the return value is 0, the cmd_done would be called at the end of msg processing function.
But if is -EINVAL, no msg processing function would be called, so it could be called at here to make interrupt status correct in dsp

Comment thread sound/soc/sof/intel/cnl.c Outdated

ghost Jul 9, 2018

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.

multiline-comments

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i will refine it

Comment thread sound/soc/sof/intel/cnl.c Outdated

ghost Jul 9, 2018

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.

same comment as for APL, this is done when the snd_soc_ipc_reply returns -EINVAL, is this intentional?

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, it is for unknown msgs

Comment thread sound/soc/sof/intel/cnl.c Outdated

ghost Jul 9, 2018

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.

multi-line comments

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will refine it

Comment thread sound/soc/sof/intel/hsw.c Outdated

ghost Jul 9, 2018

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.

multi-line comments

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will refine it

Comment thread sound/soc/sof/intel/hsw.c Outdated

ghost Jul 9, 2018

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.

multi-line comments

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will refine it

Comment thread sound/soc/sof/intel/byt.c Outdated

ghost Jul 9, 2018

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.

multi-line comments

ghost Jul 10, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will refine it

@RanderWang

ghost commented Jul 10, 2018

Copy link
Copy Markdown
Author

I update my patches. Why I change snd_sof_ipc_reply(), just have a look at following section.

When host receive reply messages from dsp, the done bit should be set. Before my change, it is set in IRQ function. Now I move it to cmd_done function which is called at end of message processing function. In some cases, unknown message is gotten in IRQ function and no message processing function is called for this message. So done bit can't be set in cmd_done function, and it could only be set in IRQ function

Rander Wang added 5 commits July 10, 2018 14:29
Set DONE bit in cmd_done function which processes msgs,
rather than doing it in IRQ function. But if a msg is not
in the rx list, it can only be done at IRQ function

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Set DONE bit in cmd_done function if direction is DSP_REPLY
rather than doing it in IRQ function. But if a msg is not
in the rx list, it can only be done at IRQ function

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
(1) Set DONE bit in cmd_done function which processes msgs,
rather than doing it in IRQ function. But if a msg is not
in the rx list, it can only be done at IRQ function

(2) Check DONE bit in hsw_is_ready function

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
(1) Set DONE bit in cmd_done function which processes msgs,
rather than doing it in IRQ function. But if a msg is not
in the rx list, it can only be done at IRQ function

(2) Check DONE bit in bdw_is_ready function

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
(1) Set DONE bit in cmd_done function which processes msgs,
rather than doing it in IRQ function. But if a msg is not
in the rx list, it can only be done at IRQ function

(2) Check DONE bit in byt_is_ready function

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>

ghost 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.

Sorry, I still don't get why in the APL case you ignore the ROM messages and in CNL you don't?

I am referring to this code in hda-ipc.c:
if (msg != 0x1004000)
reply = snd_sof_ipc_reply(sdev, msg);

which isn't present for CNL

@RanderWang

ghost commented Jul 11, 2018

Copy link
Copy Markdown
Author

The code if(msg != 0x1004000) is added by Keyon. Because at boot up time, ROM send a reply msg to host, but host cant found it , so a error msg would be in dmesg. Customer complaint about error msg on APL . So Keyon did this on APL.

@RanderWang

ghost commented Jul 11, 2018

Copy link
Copy Markdown
Author

For ROM messages on CNL & APL, both would call cmd_done in IRQ function. For ROM messages on
CNL, the snd_sof_ipc_reply would return -EINVL, the cmd_done would be called. On APL, For ROM messages 0x1004000, cmd_done would called for reply = -EINVL, and other ROM msgs work as on CNL. So no difference.

@plbossart

ghost commented Jul 11, 2018

Copy link
Copy Markdown
Member

@RanderWang I did not understand your explanations at all... I was asking why there is a difference between two platforms that are mostly identical, and you didn't give me the root cause.

Anyway, I will merge this since it's been dragging for a long-time and I am tired of this thread, but be prepared for a revert if this introduces problems.

@plbossart
plbossart merged commit a3a39f2 into thesofproject:topic/sof-dev Jul 11, 2018
@RanderWang
RanderWang deleted the ipx_fix branch July 24, 2018 05:35
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.

2 participants