Skip to content

ASoC: SOF: Intel: hda: refine resume with init chip - #1020

Merged
ranj063 merged 3 commits into
thesofproject:topic/sof-devfrom
zhuyingjiang:topic/sof-dev-refine-suspend-with-init-chip
Jul 2, 2019
Merged

ranj063 merged 3 commits into
thesofproject:topic/sof-devfrom
zhuyingjiang:topic/sof-dev-refine-suspend-with-init-chip

Conversation

@zhuyingjiang

Copy link
Copy Markdown

Unify resume code by using SOF common function hda_dsp_ctrl_init_chip() which can handle both HDA and
non-HDA cases.

@plbossart

Copy link
Copy Markdown
Member

I don't have time to look into this so will have to rely on others to approve.

@ranj063

ranj063 commented Jun 10, 2019

Copy link
Copy Markdown
Collaborator

@zhuyingjiang while the overall flow looks OK, can you please check why you need to clear WAKESTS twice in hda_dsp_ctrl_init_chip() for the HDA case?

Also, clearing WAKESTS should use snd_sof_dsp_write, update_bits() will not really clear it.

@kv2019i kv2019i left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code looks good, but again a few notes to the commit message. See also Ranjani's note on WAKESTS clearing.

Commit message for first -- minor change to make it easier to read.

Set the HDA stream position buffer during init chip. The position buffer
needs to be set in both HDA codec and nocodec cases. Use the SOF
defined function and move it to common code.

Commit message for the second -- here the explanation goes in a weird
order. I think it's better to start with the "unify resume code" to explain why
you are doing this and then add detail about the implementation. Otherwise
it's a bit hard to follow if you start with details and then reveal at the end
why you did it.

Unify resume code by using SOF common function hda_dsp_ctrl_init_chip()
which can handle both HDA and non-HDA cases. Move code to reset
stream-to-link mapping into hda_dsp_ctrl_init_chip.

Also in both, you can word-wrap to 74 columns.

@plbossart

Copy link
Copy Markdown
Member

@zhuyingjiang also please resolve conflicts

@zhuyingjiang

Copy link
Copy Markdown
Author

Also, clearing WAKESTS should use snd_sof_dsp_write, update_bits() will not really clear it.

@ranj063 As I checked, here should use snd_sof_dsp_write, I will update it.

@zhuyingjiang

Copy link
Copy Markdown
Author

Code looks good, but again a few notes to the commit message. See also Ranjani's note on WAKESTS clearing.

Commit message for first -- minor change to make it easier to read.

Set the HDA stream position buffer during init chip. The position buffer
needs to be set in both HDA codec and nocodec cases. Use the SOF
defined function and move it to common code.

Commit message for the second -- here the explanation goes in a weird
order. I think it's better to start with the "unify resume code" to explain why
you are doing this and then add detail about the implementation. Otherwise
it's a bit hard to follow if you start with details and then reveal at the end
why you did it.

Unify resume code by using SOF common function hda_dsp_ctrl_init_chip()
which can handle both HDA and non-HDA cases. Move code to reset
stream-to-link mapping into hda_dsp_ctrl_init_chip.

Also in both, you can word-wrap to 74 columns.

Thanks @kv2019i Will update it after some other check.

@zhuyingjiang
zhuyingjiang force-pushed the topic/sof-dev-refine-suspend-with-init-chip branch from 7a5c98a to f89585b Compare June 13, 2019 08:46
@zhuyingjiang

Copy link
Copy Markdown
Author

@plbossart @kv2019i @ranj063 Updated.

@zhuyingjiang
zhuyingjiang requested a review from kv2019i June 13, 2019 08:48
ranj063
ranj063 previously approved these changes Jun 13, 2019

@ranj063 ranj063 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks!

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, commits look good!

@RanderWang , @lyakh and @ranj063 : just to double check, is is safe to not do WAKESTS clearing before controller reset? The old code was wrong (it should not use update bits), but given we had many issues with the headset/wake detection, I want to be extra careful here.

@ranj063

ranj063 commented Jun 13, 2019

Copy link
Copy Markdown
Collaborator

Thanks, commits look good!

@RanderWang , @lyakh and @ranj063 : just to double check, is is safe to not do WAKESTS clearing before controller reset? The old code was wrong (it should not use update bits), but given we had many issues with the headset/wake detection, I want to be extra careful here.

@kv2019i I have a feeling this should be fine. With WAKEEN , we could be resuming because of a codec status change which is recorded before the controller is reset. But let me test this PR today just to make sure

@zhuyingjiang

Copy link
Copy Markdown
Author

Thanks, commits look good!

@RanderWang , @lyakh and @ranj063 : just to double check, is is safe to not do WAKESTS clearing before controller reset? The old code was wrong (it should not use update bits), but given we had many issues with the headset/wake detection, I want to be extra careful here.

@kv2019i I have already test this on WHL RVP. It is OK.
The register write steps are kept the same as other drivers, there clear is called multi-times in different functions.
Here we combine them in one function. and As WAKESTS resides in the Primary well, only one clear is OK for now.

@zhuyingjiang
zhuyingjiang requested review from kv2019i and ranj063 June 14, 2019 02:29
@kv2019i

kv2019i commented Jun 14, 2019

Copy link
Copy Markdown
Collaborator

@zhuyingjiang

@kv2019i I have already test this on WHL RVP. It is OK.

Ok great, thanks for confirming. Then this looks good to go.

kv2019i
kv2019i previously approved these changes Jun 14, 2019
@ranj063

ranj063 commented Jun 14, 2019

Copy link
Copy Markdown
Collaborator

@zhuyingjiang can you please update your branch ?

@zhuyingjiang

Copy link
Copy Markdown
Author

@zhuyingjiang can you please update your branch ?

@ranj063 Sorry I don't get what you mean by "update branch", the target branch is not sof-dev? or there still need some more modification?

@ranj063

ranj063 commented Jun 19, 2019

Copy link
Copy Markdown
Collaborator

@zhuyingjiang can you please update your branch ?

@ranj063 Sorry I don't get what you mean by "update branch", the target branch is not sof-dev? or there still need some more modification?

@zhuyingjiang the status shows that the branch is out-of-date with the base branch. So I cant merge it as is

@zhuyingjiang
zhuyingjiang dismissed stale reviews from kv2019i and ranj063 via eadac33 June 20, 2019 02:40
@zhuyingjiang
zhuyingjiang dismissed stale reviews from ranj063 and RanderWang via cca4d1f June 27, 2019 02:26
@zhuyingjiang
zhuyingjiang force-pushed the topic/sof-dev-refine-suspend-with-init-chip branch from f89585b to cca4d1f Compare June 27, 2019 02:26
@zhuyingjiang

Copy link
Copy Markdown
Author

@zhuyingjiang can you please rebase and resubmit. It still shows that the branch is out of date

@ranj063 @RanderWang @keyonjie Rebased.

kv2019i
kv2019i previously approved these changes Jun 27, 2019
@wenqingfu wenqingfu mentioned this pull request Jun 27, 2019
7 of 15 tasks
@zhuyingjiang

Copy link
Copy Markdown
Author

@lyakh

ranj063
ranj063 previously approved these changes Jun 27, 2019
@zhuyingjiang

Copy link
Copy Markdown
Author

@lyakh Your requested changes need to be addressed to merge the PR. Please review for me, thanks!

@zhuyingjiang
zhuyingjiang dismissed stale reviews from ranj063 and kv2019i via 18fd15d July 1, 2019 09:08
@zhuyingjiang
zhuyingjiang force-pushed the topic/sof-dev-refine-suspend-with-init-chip branch from 5699e48 to 18fd15d Compare July 1, 2019 09:08
@zhuyingjiang

Copy link
Copy Markdown
Author

@lyakh removed that initialization.

@ranj063

ranj063 commented Jul 2, 2019

Copy link
Copy Markdown
Collaborator

@zhuyingjiang sorry I've just merged the upstream changes. So could you please rebase and resubmit?

@zhuyingjiang

Copy link
Copy Markdown
Author

@zhuyingjiang sorry I've just merged the upstream changes. So could you please rebase and resubmit?

OK.

Set the HDA stream position buffer during init chip. The position buffer
needs to be set in both HDA codec and nocodec cases. Using SOF defined
function and move it to common code.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Unify resume code by using SOF common function hda_dsp_ctrl_init_chip()
which can handle both HDA and non-HDA cases. Move code to reset
stream-to-link mapping into hda_dsp_ctrl_init_chip().

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Remove the first clear WAKESTS, only one clear is needed during init
chip.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
@zhuyingjiang
zhuyingjiang force-pushed the topic/sof-dev-refine-suspend-with-init-chip branch from 18fd15d to 5ac2176 Compare July 2, 2019 02:41
@zhuyingjiang

Copy link
Copy Markdown
Author

@ranj063 @lyakh Rebased.

@lyakh lyakh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

formally looks fine to me.

@ranj063
ranj063 merged commit 6ec3295 into thesofproject:topic/sof-dev Jul 2, 2019
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.

7 participants