-
Notifications
You must be signed in to change notification settings - Fork 140
[RFC]ASoC: SOF: acpi: enable PM for ACPI platforms #1295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b68959 to
ee56304
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments below.
sound/soc/sof/pcm.c
Outdated
| * prevent the device from entering runtime suspend. | ||
| * Some boards such as the Minnowboard do not support PM. | ||
| * Increment the usage count so as to prevent the device | ||
| * from entering runtime suspend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For MinnowBoards, isn't it suspend-resume that's broken for audio?
if you use rtcwake -m mem -s 3, would audio work when you resume?
If not, then pm_runtime doesn't help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart if I remember correctly, on the minnowboards, not holding the ref count to prevent runtime PM somehow ends up in the DSP getting powered off. I might have to test this again though.
4a4c456 to
ca34874
Compare
|
Looks like firmware was not loaded again after suspend/resume cycle |
9b612fe to
d4f71b9
Compare
|
Changes pass suspend/resume on cht (Cyan) :) |
|
for github |
This patch adds the platform-specific PM callbacks for the BYT/CHT ACPI platforms. Since the Minnowboards do not support PM, the SOF device is prevented from entering runtime suspend by incrementing the ref count after the topology is loaded. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested changes below to make the code even better
| if (!runtime_suspend && !sof_ops(sdev)->suspend) | ||
| return 0; | ||
|
|
||
| if (runtime_suspend && !sof_ops(sdev)->runtime_suspend) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a separate patch, no?
| #if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) | ||
| /* set driver data in the quirk table */ | ||
| for (i = 0; i < ARRAY_SIZE(minnowbard_quirk_table); i++) | ||
| minnowbard_quirk_table[i].driver_data = dev; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit ugly, no? You could just check the quirk, which sets a variable and then you test said variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you can also use the sof-acpi-debug kernel parameter to override the DMI and also disable PM!
|
|
||
| /* PM */ | ||
| .suspend = byt_suspend, | ||
| .resume = byt_resume, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the same routine for basic PM and runtime PM?
|
@plbossart @cujomalainey im ooo today due to the power cut. Will address comments tomorrow |
| * Increment the usage count so as to prevent the device | ||
| * from entering runtime suspend. | ||
| */ | ||
| pm_runtime_get_noresume(dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw what happens if instead of taking a fake reference you just don't enable pm_runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart this is what I want to do ideally. But the one test that fails with this change is the ipc_flood_test(). When this test runs, we call pm_runtime_get_sync() to resume the DSP if it is suspended and this throws an error is runtime_pm is not enabled.
So if I add a check to see if runtime PM is enabled before calling get_sync(), then it would solve the problem. And of course, every other place we add a pm_runtime_get_sync() would need to the same too. What do you think?
|
The quirks crap out on my Asus T100 TA |
|
@ranj063 you need to apply this to your quirk table diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c
index 9eae05aebeca..ab948c1b12b6 100644
--- a/sound/soc/sof/sof-acpi-dev.c
+++ b/sound/soc/sof/sof-acpi-dev.c
@@ -149,6 +149,7 @@ static struct dmi_system_id minnowbard_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Turbot"),
},
},
+ {}
};
#endif |
|
It's a complete fail on Asus T100 TA. with this one patch, I get an IPC error So my guess is that for an ACPI device, you must be using some ACPI power helpers when entering D3, or the setup is not correct. |
|
on the positive side of things, the legacy baytrail driver (byt-rt5640), not even the Atom/SST stuff, seems to support S3 suspend/resume while doing audio playback, so there's light at the end of the tunnel. |
@plbossart this looks like the DSP is in D3 and is not resumed when playback is started. Could you please send me the whole dmesg log after you close and open the lid? |
|
@ranj063 should this work on byt-mb? what's the procedure to test it, I would try it out... |
|
closing. will be replaced soon |
|
@ranj063 can you link the new PR here once it is pushed? |
|
@cujomalainey this is the new PR #1523 but it is still WIP as there're some fw changes needed to go with it |
This patch adds the platform-specific PM callbacks for
the BYT/CHT ACPI platforms. Since the Minnowboards
do not support PM, the SOF device is prevented from
entering runtime suspend by incrementing the ref count
after the topology is loaded.
This doesnt compile yet. Looking for comments.