Skip to content
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

[SDW] rt711-sdca: timeout on INT1 and INT2 mask write #2627

Closed
plbossart opened this issue Dec 11, 2020 · 3 comments
Closed

[SDW] rt711-sdca: timeout on INT1 and INT2 mask write #2627

plbossart opened this issue Dec 11, 2020 · 3 comments
Labels
bug Something isn't working SDW Applies to SoundWire bus for codec connection TGL Applies to Tiger Lake platform

Comments

@plbossart
Copy link
Member

Intel internal test 1122 shows the following errors w/ rt711-sdca. There's obviously something wrong with SDCA interrupts.

[ 8446.911146] kernel: intel-sdw intel-sdw.0: IO transfer timed out, cmd 3 device 1 addr 5c len 1
[ 8446.911160] kernel: soundwire sdw-master-0: trf on Slave 1 failed:-110 write addr 5c count 0
[ 8447.414240] kernel: intel-sdw intel-sdw.0: IO transfer timed out, cmd 3 device 1 addr 5d len 1
[ 8447.414256] kernel: soundwire sdw-master-0: trf on Slave 1 failed:-110 write addr 5d count 0

#2622 suggests a first pass to revisit on SDCA interrupt handling.

@bardliao
Copy link
Collaborator

I can easily see the issue with the test_sdca_int.txt script

@bardliao
Copy link
Collaborator

The issue happens if regmap_cache_only is N when soc component is removed.
The call trace is:

[   77.309990]  regmap_write+0x39/0x60
[   77.309994]  rt711_sdca_jack_init+0x1b1/0x1f0 [snd_soc_rt711_sdca]
[   77.309996]  rt711_sdca_set_jack_detect+0x44/0x50 [snd_soc_rt711_sdca]
[   77.310003]  snd_soc_component_set_jack+0x22/0x40 [snd_soc_core]
[   77.310007]  soc_remove_component+0x1b/0x80 [snd_soc_core]
[   77.310011]  soc_cleanup_card_resources+0xae/0x250 [snd_soc_core]
[   77.310016]  snd_soc_unbind_card+0x65/0xe0 [snd_soc_core]
[   77.310020]  snd_soc_unregister_card+0x1f/0x60 [snd_soc_core]

The problem is that rt711_sdca_jack_init is called when sdw bus is suspended and we should not try to access sdw register at that moment.
#2629 has same root cause, too. The reason why #2627 has higher reproduce rate is that we set regcache_cache_only(rt711->regmap, false); in rt711_sdca_update_status.
Adding a snd_soc_component callback function and set cache only there should fix the issue.
I will cook a PR for that and @shumingfan will refine rt711-sdca codec driver for the usage of regmap.

@mengdonglin
Copy link
Collaborator

Fixed by PR #2640 and merged. No reproduced in recent daily test. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDW Applies to SoundWire bus for codec connection TGL Applies to Tiger Lake platform
Projects
None yet
Development

No branches or pull requests

3 participants