Skip to content

[TEST] SoundWire/debug suspend resume - #2603

Closed
plbossart wants to merge 14 commits into
thesofproject:topic/sof-devfrom
plbossart:sdw/debug-suspend-resume
Closed

plbossart wants to merge 14 commits into
thesofproject:topic/sof-devfrom
plbossart:sdw/debug-suspend-resume

Conversation

@plbossart

Copy link
Copy Markdown
Member

Set of traces added to show race condition between system and pm_runtime resume

  1. Intel master system resume
[ 6132.008499] intel-sdw intel-sdw.0: intel_resume: start
[ 6132.008502] intel-sdw intel-sdw.0: intel_resume: pm_runtime status was suspended, forcing active
[ 6132.008510] intel-sdw intel-sdw.0: intel_link_power_up: powering up all links
[ 6132.008512] intel-sdw intel-sdw.0: intel_link_power_up: first link up, programming SYNCPRD
[ 6132.009010] rt711-sdca sdw:0:25d:711:1: sdw_modify_slave_status: initializing enumeration and init completion for Slave 1
[ 6132.009163] intel-sdw intel-sdw.0: intel_resume: done
  1. RT711 system resume
[ 6132.009170] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: start
[ 6132.009172] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: wait_for_completion start
[ 6132.009986] cdns_update_slave_status_work: 4 callbacks suppressed
[ 6132.009988] intel-sdw intel-sdw.0: Slave status change: 0x2
[ 6132.009994] soundwire sdw-master-0: Slave attached, programming device number
[ 6132.010192] soundwire sdw-master-0: SDW Slave Addr: 30025d071101
[ 6132.010195] soundwire sdw-master-0: SDW Slave class_id 0x01, mfg_id 0x025d, part_id 0x0711, unique_id 0x0, version 0x3
[ 6132.010197] soundwire sdw-master-0: Slave already registered, reusing dev_num:1
[ 6132.010576] intel-sdw intel-sdw.0: Msg ignored for Slave 0
[ 6132.010582] soundwire sdw-master-0: No more devices to enumerate
[ 6132.010639] intel-sdw intel-sdw.0: Slave status change: 0x21
[ 6132.010647] rt711-sdca sdw:0:25d:711:1: sdw_modify_slave_status: signaling enumeration completion for Slave 1
[ 6132.010939] rt711-sdca sdw:0:25d:711:1: Configured bus base 1, scale 3, mclk 19200000, curr_freq 4800000
[ 6132.011207] rt711-sdca sdw:0:25d:711:1: update_status starting
[ 6132.011394] rt711-sdca sdw:0:25d:711:1: update_status done
[ 6132.011397] rt711-sdca sdw:0:25d:711:1: sdw_handle_slave_status: signaling initialization completion for Slave 1
[ 6132.011467] intel-sdw intel-sdw.0: Slave status change: 0x40
  1. RT711 pm_resume start BEFORE end of system resume
[ 6132.011479] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume_runtime: start
[ 6132.011481] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: start
[ 6132.011483] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: wait_for_completion start
[ 6132.011485] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: wait_for_completion done
[ 6132.011487] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: regmap_sync
[ 6132.013272] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume: done
[ 6132.013274] rt711-sdca sdw:0:25d:711:1: rt711_sdca_dev_resume_runtime: done
  1. RT711 pm_resume ends BEFORE end of system resume
[ 6132.013889] rt711-sdca sdw:0:25d:711:1: update_status starting
[ 6132.013891] rt711-sdca sdw:0:25d:711:1: update_status done
[ 6132.013953] intel-sdw intel-sdw.0: Slave status change: 0x20
[ 6132.013959] rt711-sdca sdw:0:25d:711:1: update_status starting
[ 6132.014142] rt711-sdca sdw:0:25d:711:1: update_status done
[ 6132.504434] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[ 6132.504471] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[ 6133.004308] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[ 6133.004351] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[ 6134.839596] ax88179_178a 4-1:1.0 enx00051ba2250c: ax88179 - Link status is: 1
[ 6137.105454] rt711-sdca sdw:0:25d:711:1: Initialization not complete, timed out
[ 6137.105471] PM: dpm_run_callback(): rt711_sdca_dev_resume+0x0/0x170 [snd_soc_rt711_sdca] returns -110
[ 6137.105478] PM: Device sdw:0:25d:711:1 failed to resume: error -110
  1. Phase2 never completed and times out. Kaboom.

The state machine requires that we first initialize the device after
attachment before dealing with alerts. Add an error case if that isn't
the case.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
bardliao and others added 13 commits December 8, 2020 21:52
Optimize the logic a bit, we don't have to reset unattach_request
after the regmap_sync tag since we only jump to regmap_sync when
unattach_request is 0.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add a dev_dbg() log for both enumeration and initialization completion
to better track suspend-resume issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
this is very verbose but may be useful to track update_status() progress

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
make sure the suspend timeout is properly managed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
let's see what happens with resume operations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Check if there is any issue with system resume?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fix potential race condition by preventing the pm_runtime resume from
being executed while system resume is taking place.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
When the pm_runtime status is forced active in a child device, the
following error is thrown:

[ 6239.434332] kernel: rt711-sdca sdw:0:25d:711:1: runtime PM trying
to activate child device sdw:0:25d:711:1 but parent (sdw-master-0) is
not active

Add the same fix to force pm_runtime status as active when doing a
system resume.

FIXME: is there a better way of doing this?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
add traces and force pm_runtime status to be active on system resume.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Intel validation reports a 'calibration timeout'. Dynamic debug logs
show the power state was changed to D3, let's make sure this cannot
happen while the calibration is run.

BugLink: thesofproject#2611
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
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.

3 participants