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] IO timeout when stopping clock after S2idle suspend/resume #1609

Closed
plbossart opened this issue Dec 9, 2019 · 5 comments
Closed

[SDW] IO timeout when stopping clock after S2idle suspend/resume #1609

plbossart opened this issue Dec 9, 2019 · 5 comments
Labels
bug Something isn't working CML Applies to Comet Lake platform SDW Applies to SoundWire bus for codec connection suspend resume Issues related to suspend resume (e.g. rtcwake)

Comments

@plbossart
Copy link
Member

plbossart commented Dec 9, 2019

code: PR #1586 and configuration with no amplifier on link-2

options snd-sof-intel-hda-common sdw_clock_stop_quirks=0x8

modprobe snd-sof-pci

wait for the DSP to be suspended

rtcwake -m mem -s 3

The dmesg log shows an IO timeout when stopping the clock the second time, but when looking at the logs the clock stop command is retried and will succeed when re-issued by do_transfer()

This makes me think the state is not properly restored when doing a system resume after a clock stop done in pm_runtime suspend

master-2 traces
[   18.739518] intel-sdw sdw-master-2: intel_suspend_runtime start
[   18.739527] intel-sdw sdw-master-2: sdw_cdns_clock_stop: start
[   18.739534] intel-sdw sdw-master-2: sdw_cdns_clock_stop: slave attached 0
[   18.739738] intel-sdw sdw-master-2: Msg ignored for Slave 15
[   18.739741] intel-sdw sdw-master-2: ClockStopNow Broadcast msg ignored -61
[   18.739745] intel-sdw sdw-master-2: sdw_cdns_clock_stop: end
[   18.739754] intel-sdw sdw-master-2: intel_suspend_runtime done
[   27.807913] intel-sdw sdw-master-2: intel_suspend start
[   27.807916] intel-sdw sdw-master-2: intel_suspend: pm_runtime status: suspended
[   32.466649] intel-sdw sdw-master-2: intel_resume start
[   32.466649] intel-sdw sdw-master-2: intel_resume: pm_runtime status was suspended, forcing active
[   32.467293] intel-sdw sdw-master-2: intel_resume done
[   35.477551] intel-sdw sdw-master-2: intel_suspend_runtime start
[   35.477568] intel-sdw sdw-master-2: sdw_cdns_clock_stop: start
[   35.477576] intel-sdw sdw-master-2: sdw_cdns_clock_stop: slave attached 0
[   37.491749] intel-sdw sdw-master-2: IO transfer timed out, cmd 3 device 15 addr 44 len 1
[   37.491768] intel-sdw sdw-master-2: sdw_cdns_clock_stop: end
[   37.491782] intel-sdw sdw-master-2: intel_suspend_runtime done

timeout.log

@RanderWang
Copy link

@plbossart yes, it is caused by FIFO_LEVEL register setting. the detail:
CDNS_MCP_FIFOLEVEL was set to 2, and after S2idle, we send cmd with count =1 & msg_count = 1, so we don't set this register correctly. I will check it later.

	if (cdns->msg_count != count) {
		cdns_writel(cdns, CDNS_MCP_FIFOLEVEL, count);
		cdns->msg_count = count;
	}

@RanderWang
Copy link

@plbossart fixed by plbossart#10

@mengdonglin mengdonglin added bug Something isn't working CML Applies to Comet Lake platform SDW Applies to SoundWire bus for codec connection labels Dec 11, 2019
@RanderWang
Copy link

a PR for branch soundwire-bug-fixes is #1618

@YvonneYang2
Copy link

Tested it with integretion/soundwire-latest(e375909) + #1586 + #1618 , issue cannot be reproduced.

@RanderWang
Copy link

RanderWang commented Dec 12, 2019

Fixed by PR #1618

@marc-hb marc-hb added the suspend resume Issues related to suspend resume (e.g. rtcwake) label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CML Applies to Comet Lake platform SDW Applies to SoundWire bus for codec connection suspend resume Issues related to suspend resume (e.g. rtcwake)
Projects
None yet
Development

No branches or pull requests

5 participants