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

Pr5042 mod #5047

Closed
wants to merge 14 commits into from
Closed

Conversation

plbossart
Copy link
Member

continuation of PR #5042 to root cause the Controller Bank Switch issue #4823

plbossart and others added 4 commits June 6, 2024 04:58
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Testing the theory that if the interrupt happens during a bank switch
the first read will be blocked and since the interrupts are now
disabled the bank switch will fail as well.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@plbossart
Copy link
Member Author

Test aborted since the LNL device kept timing out, re-rerunning the tests now.

@plbossart
Copy link
Member Author

SOFCI TEST

We want to make sure the sync_go does happen after the last write

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member Author

SOFCI TEST

Follow the recommended programming flows.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For some reason, we don't have a symmetry between clock stop and clock
start. We should disable the interrupts first on clock stop, and
re-enable them last on clock restart.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Follow recommended programming flows.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Test hypothesis that a delay might help with rate conditions

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add the controller and link id to better identify the failure.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The exclusion between regular and deferred messages doesn't seem quite
right.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
These registers come straight from platform firmware properties, for
integration/debug it's useful to know the values directly from the
kernel logs.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member Author

SOFCI TEST

We need a helper to disable peripheral alerts during bank switchs.

FIXME: cancelling the work locks the system, something is still off

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
… config

There is an potential deadlock on Intel platforms with the following
scenario:

a) the bank switch starts and the msg->lock is taken

b) an interrupt happens and the workqueue schedules a read from
IntStat0 register, which is blocked by the msg->lock

c) the manager writes the bank switch command, which is blocked by the
read that won't go out.

b) is blocked by a) and c) is blocked by b).

This patch suggests disabling the peripheral interrupts temporarily
during sync_arm/sync_go sequences used by the bank switch.

FIXME: What happens if there's already a work scheduled?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member Author

Disabling the peripheral interrupts doesn't seem to help

[  370.814030] kernel: _sdw_prepare_stream: before bank switch for stream subdevice #0-Capture
[  370.814033] kernel: soundwire_intel soundwire_intel.link.0: intel_sync_arm: started
[  370.814036] kernel: soundwire_intel soundwire_intel.link.0: intel_sync_arm: done
[  370.814037] kernel: soundwire sdw-master-0-0: do_transfer_defer
[  370.814042] kernel: soundwire_intel soundwire_intel.link.0: intel_sync_go_unlocked: started
[  370.814048] kernel: soundwire_intel soundwire_intel.link.0: intel_sync_go_unlocked: done
[  370.814049] kernel: soundwire_intel soundwire_intel.link.0: intel_post_bank_switch: sync_go wait start
[  370.816174] kernel: soundwire_intel soundwire_intel.link.0: intel_post_bank_switch: sync_go wait done
[  370.841382] kernel: soundwire sdw-master-0-0: sdw_transfer: dev 7 addr 0x8490 flags 0x0
[  373.811332] kernel: soundwire sdw-master-0-1: sdw_transfer: dev 6 addr 0x45 flags 0x1
[  373.811344] kernel: soundwire sdw-master-0-1: sdw_transfer: after mutex
[  373.811574] kernel: soundwire_intel soundwire_intel.link.0: sdw_cdns_irq int_status 0x0
[  373.811594] kernel: soundwire_intel soundwire_intel.link.1: sdw_cdns_irq int_status 0x80000004
[  373.811751] kernel: soundwire sdw-master-0-1: sdw_transfer: done
[  373.811759] kernel: soundwire sdw-master-0-1: sdw_transfer: dev 15 addr 0x44 flags 0x0
[  373.811765] kernel: soundwire sdw-master-0-1: sdw_transfer: after mutex
[  373.811975] kernel: soundwire_intel soundwire_intel.link.0: sdw_cdns_irq int_status 0x0
[  373.811994] kernel: soundwire_intel soundwire_intel.link.1: sdw_cdns_irq int_status 0x80000004
[  373.812094] kernel: soundwire sdw-master-0-1: sdw_transfer: done
[  373.812106] kernel: soundwire_bus:sdw_bus_wait_for_clk_prep_deprep: soundwire sdw-master-0-1: clock stop prepare done slave:15
[  373.812113] kernel: soundwire sdw-master-0-1: sdw_transfer: dev 15 addr 0x44 flags 0x1
[  373.812118] kernel: soundwire sdw-master-0-1: sdw_transfer: after mutex
[  373.812234] kernel: soundwire_intel soundwire_intel.link.0: sdw_cdns_irq int_status 0x0
[  373.812245] kernel: soundwire_intel soundwire_intel.link.1: sdw_cdns_irq int_status 0x80000004
[  373.812264] kernel: soundwire sdw-master-0-1: sdw_transfer: done
[  373.839607] kernel: soundwire sdw-master-0-0: sdw_ml_sync_bank_switch: master 0:0 timed out on bank switch
[  373.839720] kernel: soundwire sdw-master-0-0: multi link bank switch failed: -110
[  373.839769] kernel: _sdw_prepare_stream: do_bank_switch failed for stream subdevice #0-Capture: -110
[  373.839784] kernel: soundwire sdw-master-0-0: sdw_transfer: after mutex
[  373.839819] kernel: sdw_release_bus_lock: releasing locks for stream subdevice #0-Capture
[  373.839827] kernel: sdw_release_bus_lock: released locks for stream subdevice #0-Capture
[  373.839831] kernel:  SDW0-Capture: ASoC: error at snd_soc_link_prepare on SDW0-Capture: -110
[  373.839878] kernel:  SDW0-Capture: ASoC: error at __soc_pcm_prepare on SDW0-Capture: -110
[  373.839922] kernel:  Jack In: ASoC: error at dpcm_be_dai_prepare on Jack In: -110
[  373.839964] kernel:  Jack In: ASoC: error at dpcm_fe_dai_prepare on Jack In: -110

we still however have this jack detection lurking in the background. Gah, so frustrating.

@plbossart plbossart closed this Jun 13, 2024
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.

2 participants