Skip to content

Conversation

@plbossart
Copy link
Member

Adding all fixes in one PR to help with testing. This works fine for me on Cyan Chromebook and RT5640 device.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ranj063 Does this ever trigger? I see that the return value of this function is never checked, so this patch's only (potential) run-time effect is if the error message disappears. But isn't it really an error? Shouldn't we at least warn?

Copy link
Member Author

Choose a reason for hiding this comment

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

I saw this error a couple of times, though less often after applying @keyonjie 's idea of only enabling the DONE interrupt when sending a command.

@eballetbo
Copy link

After picking these patches, this PR seems to fix all the issues we saw.

Tested-by: Enric Balletbo i Serra enric.balletbo@collabora.com

Thanks, @plbossart for work on this.

ranj063 and others added 8 commits May 26, 2020 09:30
Add the PM callbacks for BYT/CHT platforms.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add new case when set_power_state() is not supported, e.g. for Intel
Baytrail/Cherrytrail legacy platforms.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Low-power playback was never enabled on Baytrail devices, remove what
looks like copy/paste from other machine drivers which were never
submitted upstream.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add required .pm_ops to support suspend/resume on baytrail/cherrytrail
machines.

This .pm_ops is conditionally-added to avoid impacting the legacy
driver where power management is handled differently.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We currently ignore the reply messages from the DSP
when they are not expected but call it out as an error.
Change the error message to a debug message.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add remove op that disables interrupts and reset the DSP
for BYT and CHT platforms.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The DSP may send the same interrupt multiple times before it's handled
in the interrupt thread. Rather than masking it in the thread, mask it
in the handler directly.

This patch also removes useless checks that cannot happen, and masks
that are set don't need to be re-tested.

BugLink: thesofproject#1492
Suggested-by: Keyon Jie <yang.jie@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
On probe and reset, we should not touch the SHIM_IMRD register since
it is configured by firmware.

The driver only configures SHIM_IMRX with the BUSY interrupt enabled
by default and DONE interrupt disabled. When sending an IPC message,
the DONE interrupt is enabled until the DSP response is provided.

This sequence hardens the IPC communication and avoid
interrupt-related issues when adding/removing modules or during system
suspend-resume transitions.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart plbossart force-pushed the fix/bytcht-suspend-resume-module-reload branch from 35871c0 to 351f531 Compare May 26, 2020 14:36
@plbossart
Copy link
Member Author

After picking these patches, this PR seems to fix all the issues we saw.

Tested-by: Enric Balletbo i Serra enric.balletbo@collabora.com

Thanks, @plbossart for work on this.

Thanks @eballetbo for testing, added your tag in commit messages

Copy link
Collaborator

@ranj063 ranj063 left a comment

Choose a reason for hiding this comment

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

@plbossart LGTM. Thanks for pulling everything together!

@cujomalainey
Copy link

cujomalainey commented May 26, 2020

I left my Cyan in the office so I can't test easily :( but I am looking forward to trying this code out.

@plbossart
Copy link
Member Author

I am going to merge this, I'd like all Baytrail to be handled in the next kernel cycle.

@plbossart plbossart merged commit 866e4d5 into thesofproject:topic/sof-dev May 26, 2020
@youling257
Copy link

test patches, sometimes no sound on Bay trail.
[ 332.048218] sof-audio-acpi 80860F28:00: error: ipc timed out for 0x60050000 size 12
[ 332.048280] sof-audio-acpi 80860F28:00: error: unexpected fault 0x600a0001 trace 0x00000000
[ 332.048287] sof-audio-acpi 80860F28:00: error: ipc host -> DSP: pending no complete no raw 0x8000000000000000
[ 332.048290] sof-audio-acpi 80860F28:00: error: mask host: pending no complete no raw 0x0
[ 332.048294] sof-audio-acpi 80860F28:00: error: ipc DSP -> host: pending no complete yes raw 0x600a0001
[ 332.048297] sof-audio-acpi 80860F28:00: error: mask DSP: pending no complete no raw 0x0
[ 332.048304] Low Latency: ASoC: trigger FE cmd: 0 failed: -110
[ 332.552324] sof-audio-acpi 80860F28:00: error: ipc timed out for 0x60030000 size 12
[ 332.552387] sof-audio-acpi 80860F28:00: error: unexpected fault 0x600a0001 trace 0x00000000
[ 332.552393] sof-audio-acpi 80860F28:00: error: ipc host -> DSP: pending no complete no raw 0x8000000000000000
[ 332.552397] sof-audio-acpi 80860F28:00: error: mask host: pending no complete no raw 0x0
[ 332.552400] sof-audio-acpi 80860F28:00: error: ipc DSP -> host: pending no complete yes raw 0x600a0001
[ 332.552403] sof-audio-acpi 80860F28:00: error: mask DSP: pending no complete no raw 0x0

@plbossart
Copy link
Member Author

@eballetbo side question on Cyan: do you see "Headphone Jack" and "Headset Mic Jack" controls on your device ('amixer controls' will give you the list)? I did an upgrade to Ubuntu 20.04 and of course the jack detection doesn't work, not sure if I am missing something (ACPI or .config setup)? Thanks!

I added UCM support but that stupid jack is not functional for some reason.

@youling257
Copy link

@eballetbo side question on Cyan: do you see "Headphone Jack" and "Headset Mic Jack" controls on your device ('amixer controls' will give you the list)? I did an upgrade to Ubuntu 20.04 and of course the jack detection doesn't work, not sure if I am missing something (ACPI or .config setup)? Thanks!

I added UCM support but that stupid jack is not functional for some reason.
sof-bytcht-rt5640: reuse legacy settings, Just test if controls for the legacy driver are available

what's the mean of "legacy driver are available"?

( 30.692| 0.006) I: [pulseaudio] (alsa-lib)main.c: error: failed to import hw:0 use case configuration -2
( 30.693| 0.000) I: [pulseaudio] (alsa-lib)main.c: error: failed to import sof-bytcr-rt5640 use case configuration -2
( 30.693| 0.000) I: [pulseaudio] alsa-ucm.c: UCM not available for card sof-bytcr-rt5640

@youling257
Copy link

@plbossart how to make ucm2 work with sofbytcrrt5640?

@plbossart
Copy link
Member Author

@plbossart how to make ucm2 work with sofbytcrrt5640?

You need the latest alsa-lib, alsa-ucm-conf and the latest topic/sof-dev kernel branch (all code submitted upstream)

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