ASoC: Intel: common: work-around for incorrect ACPI HID for CML boards#1565
ASoC: Intel: common: work-around for incorrect ACPI HID for CML boards#1565plbossart merged 1 commit intothesofproject:topic/sof-devfrom aiChaoSONG:topic/sof-dev
Conversation
|
@aiChaoSONG I think the correct fix for this problem is to use the appropriately quitk_data instead of switching the order to make sure that you have the required codecs based on the board |
|
@ranj063 the quitk_data is used for the same machine driver only, isn't it? here we are using 3 total different machine driver. |
makes sense. @aiChaoSONG please follow this style to fix the issue with machine_quirk + quirk_data. |
|
@aiChaoSONG please consider something like this(or you can remove the existed acpi one in the snd_soc_acpi_mach.id of the array, and no need to use quirk if there is no extra codec added): |
|
|
||
| static struct snd_soc_acpi_codecs da7219_spk_codecs = { | ||
| .num_codecs = 2, | ||
| .codecs = {"10EC5682", "MX98357A"} |
There was a problem hiding this comment.
@aiChaoSONG where is the da7219 is the codecs list?
There was a problem hiding this comment.
Oh, forgive me, da7219 is the codecs list, and the '10EC5682' here should be 'DLGS7219'. will fix this in next push
|
|
||
| static struct snd_soc_acpi_codecs rt1011_spk_codecs = { | ||
| .num_codecs = 3, | ||
| .codecs = {"10EC1011", "10EC5682", "MX98357A"} |
There was a problem hiding this comment.
and is this correct? Does this mean the ACPI match will fail if all 3 codecs arent present?
There was a problem hiding this comment.
if any one of the listed codecs not present, the match will fail, and continue to match the next item in mach table.
There was a problem hiding this comment.
@aiChaoSONG yes I understand that. My question was whether this is an actual board config for CML?
There was a problem hiding this comment.
@aiChaoSONG the cml_rt1011_rt5682 machine driver doesnt seem to handle the MX98357A. Are you sure this is the driver to use with this config?
There was a problem hiding this comment.
@ranj063 the sof_rt5682 driver can handle two conditions: only rt5682 and rt5682 + max98357a, and the cml_rt1011_rt5682 driver uses the handler under sof_rt5682.
There was a problem hiding this comment.
@plbossart As I understand from your text, we keep two items both with .id=10EC5682, and codec MX98357A in quirk_data of the first board, and 10EC1011 in the other. Do I get you right?
Codec list of board 2 is a super set of board 1, that means where board 1 can match, Board 2 matches, too.
Solution d): Let me push coreboot team to fix their issue, and eliminate MX98357A in board 2.
There was a problem hiding this comment.
Solution from Pierre will work , just that we need to swap the order
use .id=10EC5682 for both, and add a machine quirk with 10EC1011 for the first and MX98357a for the second.
To Answer @plbossart further,
CML device #1 : match RT1011 and RT5682
CML device #2: match max98357a and RT5682
If we use #2 as 1st entry, device #1 also pick that because
In Coreboot, Device #2 is used as base config and max98357a and RT5682 added.
Device #1 adds a override to add RT1011. Now since max98367a is not an i2c device, it continue to be present in ACPI.
Hence device #1 ACPI contains max98357a . ( This is what @aiChaoSONG reported and i'll check with Coreboot if possible)
If we have the order as below it can solve for all, let me know if you are ok
1st entry : RT5682 ( quirk of RT1011)
2nd entry: RT5682 (quirt of MAX98357a)
3rd entry: RT5682 ( no quirk - for sof_rt5682)
4th entry: da7219 (quirk of MAX98357a)
let me know if the match works for all with this.
There was a problem hiding this comment.
@sathyap-chrome The order matters even with Pierre's solution, right? I am fine with this, but Pierre is the one who makes the final decision. @plbossart Are you fine with this?
There was a problem hiding this comment.
yes, this is what I had in mind.
1st entry : RT5682 ( quirk of RT1011)
2nd entry: RT5682 (quirt of MAX98357a)
3rd entry: RT5682 ( no quirk - for sof_rt5682)
4th entry: da7219 (quirk of MAX98357a)
I am not sure why I wrote the order does not matter, it does indeed. the point was to use the speaker amplifier that's really present on the board to remove the ambiguity.
We'd of course need a comment to state that the order does matter and why, so that future generations don't break this by accident.
There was a problem hiding this comment.
@plbossart repushed, and tested on board with max98357a and boad with rt1011, correct driver is loaded on both boards, please review again.
|
I am not touching this PR until I have a clear picture of all CML platforms listed, each with the ACPI IDs expected. |
|
plbossart
left a comment
There was a problem hiding this comment.
minor nit-picks to make the explanations more self-explanatory.
I am not a native English speaker but I'd recommend avoiding sentences with 'there is' and follow the 'subject-verb-complement' pattern in an active form.
Thanks!
| /* | ||
| * The order of the three items with .id = "10EC5682" matters | ||
| * here, because the ACPI ID of max98357a is wrongly present | ||
| * in the board with rt1011 speaker codec. |
There was a problem hiding this comment.
because the DSDT tables expose an ACPI HID for the MAX98357A speaker amplifier which is not populated on the board.
| @@ -9,45 +9,52 @@ | |||
| #include <sound/soc-acpi.h> | |||
| #include <sound/soc-acpi-intel-match.h> | |||
|
|
|||
There was a problem hiding this comment.
the commit message can be improved a bit:
ASoC: Intel: common: work-around incorrect ACPI HID for CML boards
On CML boards with the RT5682 headset codec and RT1011 speaker amplifier, the platform firmware exposes three ACPI HIDs (10EC5682, 10EC1011 and MX98357A). The last HID is a mistake in DSDT tables, which causes the wrong machine driver to be loaded.
This patch changes the key used to identify boards and changes the order of entries in the table to load the correct machine driver. The order does matter and should not be modified to work-around this firmware issue.
There was a problem hiding this comment.
@plbossart thank you, Pierre, commit message from you is better, and will avoid the personal sytle of "there is" in later PRs.
On CML boards with the RT5682 headset codec and RT1011 speaker amplifier, the platform firmware exposes three ACPI HIDs (10EC5682, 10EC1011 and MX98357A). The last HID is a mistake in DSDT tables, which causes the wrong machine driver to be loaded. This patch changes the key used to identify boards and changes the order of entries in the table to load the correct machine driver. The order does matter and should not be modified to work-around this firmware issue. Signed-off-by: Amery Song <chao.song@intel.com> Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
|
I'd like additional reviewers from the Chrome team, @sathyap-chrome @sathya-nujella |
ranj063
left a comment
There was a problem hiding this comment.
LGTM but a minor nit-pick. work-around or workaround is a noun. so it should the commit title should be "ASoC: Intel: common: work-around for incorrect ACPI HID for CML boards"
|
Changes look good. Thanks!
|
The commit title is already "ASoC: Intel: common: work-around for incorrect ACPI HID for CML boards", just a github PR title change, Thanks, Ranjani |
[ Upstream commit 7175e13 ] I experience issues when putting a lkbsb on the stack and have sb_lvbptr field to a dangled pointer while not using DLM_LKF_VALBLK. It will crash with the following kernel message, the dangled pointer is here 0xdeadbeef as example: [ 102.749317] BUG: unable to handle page fault for address: 00000000deadbeef [ 102.749320] #PF: supervisor read access in kernel mode [ 102.749323] #PF: error_code(0x0000) - not-present page [ 102.749325] PGD 0 P4D 0 [ 102.749332] Oops: 0000 [thesofproject#1] PREEMPT SMP PTI [ 102.749336] CPU: 0 PID: 1567 Comm: lock_torture_wr Tainted: G W 5.19.0-rc3+ thesofproject#1565 [ 102.749343] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.16.0-2.module+el8.7.0+15506+033991b0 04/01/2014 [ 102.749344] RIP: 0010:memcpy_erms+0x6/0x10 [ 102.749353] Code: cc cc cc cc eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe [ 102.749355] RSP: 0018:ffff97a58145fd08 EFLAGS: 00010202 [ 102.749358] RAX: ffff901778b77070 RBX: 0000000000000000 RCX: 0000000000000040 [ 102.749360] RDX: 0000000000000040 RSI: 00000000deadbeef RDI: ffff901778b77070 [ 102.749362] RBP: ffff97a58145fd10 R08: ffff901760b67a70 R09: 0000000000000001 [ 102.749364] R10: ffff9017008e2cb8 R11: 0000000000000001 R12: ffff901760b67a70 [ 102.749366] R13: ffff901760b78f00 R14: 0000000000000003 R15: 0000000000000001 [ 102.749368] FS: 0000000000000000(0000) GS:ffff901876e00000(0000) knlGS:0000000000000000 [ 102.749372] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 102.749374] CR2: 00000000deadbeef CR3: 000000017c49a004 CR4: 0000000000770ef0 [ 102.749376] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 102.749378] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 102.749379] PKRU: 55555554 [ 102.749381] Call Trace: [ 102.749382] <TASK> [ 102.749383] ? send_args+0xb2/0xd0 [ 102.749389] send_common+0xb7/0xd0 [ 102.749395] _unlock_lock+0x2c/0x90 [ 102.749400] unlock_lock.isra.56+0x62/0xa0 [ 102.749405] dlm_unlock+0x21e/0x330 [ 102.749411] ? lock_torture_stats+0x80/0x80 [dlm_locktorture] [ 102.749416] torture_unlock+0x5a/0x90 [dlm_locktorture] [ 102.749419] ? preempt_count_sub+0xba/0x100 [ 102.749427] lock_torture_writer+0xbd/0x150 [dlm_locktorture] [ 102.786186] kthread+0x10a/0x130 [ 102.786581] ? kthread_complete_and_exit+0x20/0x20 [ 102.787156] ret_from_fork+0x22/0x30 [ 102.787588] </TASK> [ 102.787855] Modules linked in: dlm_locktorture torture rpcsec_gss_krb5 intel_rapl_msr intel_rapl_common kvm_intel iTCO_wdt iTCO_vendor_support kvm vmw_vsock_virtio_transport qxl irqbypass vmw_vsock_virtio_transport_common drm_ttm_helper crc32_pclmul joydev crc32c_intel ttm vsock virtio_scsi virtio_balloon snd_pcm drm_kms_helper virtio_console snd_timer snd drm soundcore syscopyarea i2c_i801 sysfillrect sysimgblt i2c_smbus pcspkr fb_sys_fops lpc_ich serio_raw [ 102.792536] CR2: 00000000deadbeef [ 102.792930] ---[ end trace 0000000000000000 ]--- This patch fixes the issue by checking also on DLM_LKF_VALBLK on exflags is set when copying the lvbptr array instead of if it's just null which fixes for me the issue. I think this patch can fix other dlm users as well, depending how they handle the init, freeing memory handling of sb_lvbptr and don't set DLM_LKF_VALBLK for some dlm_lock() calls. It might a there could be a hidden issue all the time. However with checking on DLM_LKF_VALBLK the user always need to provide a sb_lvbptr non-null value. There might be more intelligent handling between per ls lvblen, DLM_LKF_VALBLK and non-null to report the user the way how DLM API is used is wrong but can be added for later, this will only fix the current behaviour. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
On CML platforms with rt1011 and rt5682 codecs, there are three acpi IDs: MX98357A, 10EC1011 and 10EC5682. Previously, MX98357A will be firstly matched, and sof_rt5682 codec driver will be wrongly loaded. Due to no proper speaker codec driver loaded, the speaker on such platforms doesn't work.
Therefore, this patch add machine_quirk for each item in cml acpi mach table, with machine_quirk and quirk_data, a fully codecs match will be performed, and thus ensure correct codec drivers to be loaded.