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

Fix a io timeout issue if SDW_INTEL_CLK_STOP_BUS_RESET is set #8

Closed
Closed
Changes from 1 commit
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
990f385
soundwire: sdw_slave: add probe_complete structure and new fields
plbossart Oct 9, 2019
e8fbd1c
soundwire: sdw_slave: add enumeration_complete structure
plbossart Sep 26, 2019
60d0186
soundwire: sdw_slave: add initialization_complete definition
plbossart Nov 4, 2019
ac2bdb9
soundwire: sdw_slave: track unattach_request to handle all init seque…
plbossart Nov 11, 2019
0449125
soundwire: intel: update interfaces between ASoC and SoundWire
plbossart Oct 23, 2019
4a5582e
soundwire: intel: update stream callbacks for hwparams/free stream op…
RanderWang Aug 19, 2019
fd8a78d
soundwire: intel: update headers for interrupts
bardliao Nov 22, 2019
591e457
soundwire: add link_list to handle interrupts for all links with a si…
plbossart Dec 4, 2019
9bdd2a2
soundwire: intel: add mutex for shared SHIM register access
plbossart Dec 4, 2019
fcb10cb
soundwire: intel: add clock stop quirks
plbossart Dec 3, 2019
cb81165
soundwire: renames to prepare support for master drivers/devices
plbossart Sep 10, 2019
790b08e
soundwire: rename dev_to_sdw_dev macro
plbossart Sep 11, 2019
6dfddd1
soundwire: rename drv_to_sdw_slave_driver macro
plbossart Sep 11, 2019
b5dd9f1
soundwire: bus_type: rename sdw_drv_ to sdw_slave_drv
plbossart Sep 11, 2019
5f04169
soundwire: intel: rename res field as link_res
plbossart Sep 11, 2019
b30918c
soundwire: add support for sdw_slave_type
plbossart Sep 11, 2019
a0dc13b
soundwire: slave: move uevent handling to slave
plbossart Nov 14, 2019
a91f181
soundwire: add initial definitions for sdw_master_device
plbossart Sep 11, 2019
5070d2f
soundwire: intel: remove platform devices and provide new interface
plbossart Oct 23, 2019
934c515
soundwire: add device driver to sdw_md_driver
bardliao Sep 12, 2019
d0cf769
soundwire: intel: add prepare support in sdw dai driver
RanderWang Aug 19, 2019
85335de
soundwire: intel: add trigger support in sdw dai driver
RanderWang Aug 19, 2019
83a0079
soundwire: intel: add sdw_stream_setup helper for .startup callback
RanderWang Aug 19, 2019
aaa7452
soundwire: intel: free all resources on hw_free()
plbossart Oct 23, 2019
cc3fafc
soundwire: intel_init: add implementation of sdw_intel_enable_irq()
plbossart Oct 23, 2019
dcdc2da
ASoC: SOF: Intel: add SoundWire configuration interface
plbossart Sep 11, 2019
40f40c1
ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
plbossart Aug 16, 2019
e11843c
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
plbossart Jun 26, 2019
9f44318
ASoC: SOF: Intel: hda: initial SoundWire machine driver autodetect
plbossart Sep 12, 2019
1af5f83
ASoC: SOF: Intel: hda: disable SoundWire interrupts on suspend
plbossart Sep 24, 2019
704ab89
ASoC: SOF: Intel: add build support for SoundWire
plbossart Sep 4, 2019
3bcd2f7
ASoC: SOF: Intel: hda-ctrl: add reset cycle before parsing capabilities
plbossart Oct 21, 2019
e8e7b3c
ASoC: codecs: rt700: add Soundwire support
shumingfan Apr 18, 2018
1a95183
ASoC: codecs: rt1308: add SoundWire support
shumingfan Aug 2, 2019
c338b59
ASoC: codecs: rt711: add SoundWire support
shumingfan Aug 15, 2019
e6bf8bd
ASoC: codecs: rt715: add SoundWire support
Aug 21, 2019
6b795cb
ASoC: codecs: Add DEBUG to Makefile
plbossart Apr 18, 2019
010b83f
ASoC: codecs: rt715: rt715_sdw_regmap can be static
intel-lab-lkp Oct 18, 2019
3f8d624
ASoC: rt711: changes 32bits address mapping of index defined register…
shumingfan Oct 23, 2019
82e8f68
ASoC: rt700: changes 32bits address mapping of index defined register…
shumingfan Oct 23, 2019
d5fb100
ASoC: rt1308-sdw: fix some coding style
shumingfan Oct 23, 2019
328e05c
Resume correct register setting for dmic recording after suspend.
Oct 24, 2019
8c70932
ASoC: rt711: add JD2 configuration
shumingfan Oct 24, 2019
fdef4a7
ASoC: codec:rt715-sdw:Modify register mapping of index from 32bits to…
Oct 25, 2019
426a427
ASoC: rt700: fix pop noise while stopping playback
shumingfan Oct 28, 2019
23dc3d6
ASoC: rt711: fix pop noise while stopping playback
shumingfan Oct 28, 2019
96f861d
ASoC: rt1308-sdw: fix DC offset loading from EFUSE and increase DAC v…
shumingfan Oct 28, 2019
b2132a0
ASoC: codec:rt715-sdw: Modify some ret values regarding to warning an…
Oct 29, 2019
93d6821
ASoC: rt1308-sdw: output gain enhancement
shumingfan Oct 30, 2019
a7bb5ef
ASoC: rt711: move rt711_parse_dt to rt711_probe
bardliao Nov 4, 2019
47f232d
ASoC: codecs: rt1308-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
054a31d
ASoC: codecs: rt700-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
e34741a
ASoC: codecs: rt711-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
e41e7da
ASoC: codecs: rt715-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
5266145
ASoC: rt700: enable wake_capable
shumingfan Nov 7, 2019
f3e0268
ASoC: rt711: enable wake_capable
shumingfan Nov 7, 2019
b074c8a
ASoC: rt715: enable wake_capable
shumingfan Nov 7, 2019
ecbb43c
ASoC: rt700: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
53e1176
ASoC: rt711: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
9b05c1e
ASoC: rt1308-sdw: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
6f5927d
ASoC: codec: rt715: Remove unused rt715_index_read function.
Nov 11, 2019
5d934bd
ASoC: codecs: rt1308-sdw: check unattach request before wait_for_comp…
plbossart Nov 8, 2019
3f27a61
ASoC: codecs: rt700-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
aeb5573
ASoC: codecs: rt711-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
6198e22
ASoC: codecs: rt715-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
b9221c6
ASoC: rt711: fix no sound output after waking up from deep s3
shumingfan Nov 13, 2019
a65bac3
Correct some sdw default registers and add missing registers in rt715…
Nov 22, 2019
bfa6914
ASoC: rt5682: Add the field "is_sdw" of private data
oder-chiou Nov 22, 2019
446fade
ASoC: rt5682: Add the soundwire support
oder-chiou Nov 26, 2019
12c8e4f
Add missing rt715_reg_defaults values.
Dec 2, 2019
69ccb10
ASoC: Intel: common: soc-acpi: declare new tables for SoundWire
plbossart Aug 24, 2019
ffef1a7
ASoC: Intel: common: add match tables for ICL w/ SoundWire
bardliao Jun 20, 2019
47b7742
ASoC: Intel: common: add match tables for CNL/CFL/CML w/ SoundWire
RanderWang Jul 22, 2019
40e30a3
ASoC: Intel: common: add match tables for TGL w/ SoundWire
plbossart Sep 4, 2019
0544bfd
ASoC: SOF: Intel: reference SoundWire machine lists
plbossart Sep 4, 2019
89ff59b
ASoC: Intel: boards: add sdw_rt700 machine driver
plbossart Apr 11, 2019
64e0638
ASoC: Intel: boards: add sdw_rt711_rt1308_rt715 3-in-1 config support
plbossart Aug 26, 2019
031ebb3
ASoC: Intel: boards: sdw_rt711: add machine driver
plbossart Sep 17, 2019
fe92688
ASoC: Intel: boards: SoundWire rt711 + I2S RT1308 configuration
plbossart Sep 25, 2019
d8441c9
NOT FOR UPSTREAM: Add debug for boards
plbossart Jun 24, 2019
b31dc61
ASoC: intel: sdw_rt711_rt1308_rt715: remove ENABLE_RT1308_SDW2 flag
bardliao Nov 5, 2019
cbc6956
ASoC: intel: sdw_rt711_rt1308_rt715: Use a fixed number of num_links and
bardliao Nov 7, 2019
892ebc3
ASoC: intel:sdw_rt711_i2s_rt1308: add quirk for rt711
RanderWang Nov 12, 2019
b495c0d
ASoC: intel: refine sdw_rt711_rt1308_rt715
RanderWang Nov 12, 2019
04c1964
ASoC: Intel: sdw_rt711_rt1308_rt715: get more specific DMI info
bardliao Nov 21, 2019
3f0cb65
ASoC: Intel: sdw_rt711_rt1308_rt715: add Dell XPS to DMI table
bardliao Nov 29, 2019
9080680
soundwire: intel/cadence: merge Soundwire interrupt handlers/threads
bardliao Sep 24, 2019
e9e1a0c
soundwire: bus: fix race condition with probe_complete signaling
plbossart Aug 2, 2019
d252434
soundwire: bus: add PM/no-PM versions of read/write functions
plbossart Jun 11, 2019
d34ac3b
soundwire: bus: write Slave Device Number without runtime_pm
plbossart Sep 26, 2019
55e09c9
soundwire: intel: add helpers for link power down and shim wake
plbossart Sep 20, 2019
ccea5bf
soundwire: intel: Add basic power management support
plbossart Sep 20, 2019
e53be0e
soundwire: intel: add pm_runtime support
plbossart Sep 20, 2019
c1b0b80
ASoC: SOF: Intel: hda: merge IPC, stream and SoundWire interrupt hand…
bardliao Nov 22, 2019
78befd7
soundwire: intel: reset pm_runtime status during system resume
plbossart Oct 11, 2019
2ed75c1
soundwire: intel: fix race condition on system resume
plbossart Nov 26, 2019
746a451
soundwire: bus: add helper to reset Slave status to UNATTACHED
plbossart Sep 26, 2019
bf32526
soundwire: intel: call helper to reset Slave states on resume
plbossart Sep 26, 2019
6fb0e81
soundwire: bus: check first if Slaves become UNATTACHED
plbossart Sep 26, 2019
468ff8c
soundwire: bus: fix race condition with enumeration_complete signaling
plbossart Sep 26, 2019
d75a7be
soundwire: bus: fix race condition with initialization_complete signa…
plbossart Nov 4, 2019
960183a
soundwire: bus: fix race condition by tracking UNATTACHED transition
plbossart Nov 8, 2019
d0cd616
soundwire: intel: disable pm_runtime when removing a master
plbossart Oct 9, 2019
cc0a0e2
soundwire: bus: disable pm_runtime in sdw_slave_delete
plbossart Oct 9, 2019
c430377
soundwire: stream: remove redundant pr_err traces
plbossart Nov 14, 2019
35f7098
soundwire: stream: update state machine and add state checks
plbossart Oct 12, 2019
3175f75
soundwire: stream: only prepare stream when it is configured.
bardliao Sep 20, 2019
46ea583
soundwire: stream: do not update parameters during DISABLED-PREPARED …
plbossart Oct 15, 2019
66f4988
soundwire: intel: reinitialize IP+DSP in .prepare(), but only when re…
bardliao Oct 14, 2019
d9f03e3
soundwire: intel: pm_runtime idle scheduling
plbossart Oct 24, 2019
aad2ab6
[HACK] add traces to debug aplay suspend/resume issue
plbossart Oct 12, 2019
f395248
pm: add more traces
plbossart Nov 21, 2019
6270e2c
soundwire: cadence_master: remove config update for interrupt setting
RanderWang Dec 2, 2019
ad96056
soundwire: intel: add mutex to prevent concurrent access to SHIM regi…
plbossart Dec 2, 2019
fc41d00
ALSA: HDA: intel-dsp-config: add DMI info for Dell laptop
bardliao Nov 5, 2019
5c5c47a
soundwire: cadence_master: handle multiple status reports per Slave
plbossart Jun 11, 2019
a841e21
soundwire: Add generic bandwidth allocation algorithm
plbossart Apr 24, 2018
7701e64
soundwire: dynamic_allocation: set grp_ctrl_valid false
bardliao Aug 2, 2019
1b06205
soundwire: bus: fix device number leak on errors
plbossart Jul 30, 2019
3564f53
soundwire: intel: modify DMAT field for ALH
bardliao Aug 19, 2019
3be29ef
soundwire: intel: fix factor of two in MCLK handling
bardliao Aug 19, 2019
ee6b051
soundwire: cadence_master: log register write info
plbossart Jun 26, 2019
0ad1565
add more traces to bus code
plbossart Jun 11, 2019
d85f3d2
add traces for bus
plbossart Aug 1, 2019
3d5a4cb
[HACK] soundwire: add dynamic DEBUG in makefile
plbossart Sep 12, 2019
4fc19f8
ALSA: HDA: intel-dsp-config: add DMI info for Dell laptop
bardliao Nov 20, 2019
18536a4
Soundwire: generic_bandwidth_allocation: don't free params if it is null
bardliao Dec 2, 2019
2a68b06
ASoC: rt5682: Fix the merging conflict
oder-chiou Dec 4, 2019
42fdb5d
ASoC: rt700: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
18c1498
ASoC: rt711: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
10ce197
ASoC: rt715: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
9b0300f
ASoC: rt1308-sdw: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
bfa79af
Merge remote-tracking branch 'sof/integration/soundwire-interfaces' i…
plbossart Dec 5, 2019
e2fcb7d
Merge remote-tracking branch 'sof/integration/soundwire-intel' into i…
plbossart Dec 5, 2019
4415c1b
Merge remote-tracking branch 'sof/integration/soundwire-sof' into int…
plbossart Dec 5, 2019
6daafa4
Merge remote-tracking branch 'sof/integration/realtek-sdw-codecs' int…
plbossart Dec 5, 2019
094293c
Merge remote-tracking branch 'sof/integration/soundwire-machine-drive…
plbossart Dec 5, 2019
d64c4a3
Merge remote-tracking branch 'sof/integration/soundwire-debug-fixes' …
plbossart Dec 5, 2019
a8e4abb
ASoC: SOF: Intel: hda: specify behavior for clock stop
plbossart Dec 3, 2019
f42bece
soundwire: intel_init: add support for clock_stop quirks
plbossart Dec 3, 2019
370f696
soundwire: intel: handle all existing pm_runtime code as TEARDOWN option
plbossart Dec 3, 2019
c8a3ebc
soundwire: Add clock stop support
RanderWang Nov 8, 2019
cdc0a57
soundwire: cadence_master: simplifiy cdns_init()
RanderWang Dec 5, 2019
b366732
soundwire: cadence_master: add clock_stop/restart routines
RanderWang Dec 5, 2019
297e916
soundwire: intel: add support for pm requirement in runtime pm
RanderWang Dec 5, 2019
6033d49
soundwire: intel: remove change for intel_init
plbossart Dec 5, 2019
58e56a2
soundwire: intel: split TEARDOWN and BUS RESET clock modes
plbossart Dec 5, 2019
1665226
soundwire: intel: add wake interrupt support
RanderWang Dec 5, 2019
c55e4e2
ASoC: sof: add wakeen interrupt support for soundwire
RanderWang Dec 5, 2019
7c5f9dc
ASoC: SOF: hda: cleanup comments and prototypes
plbossart Dec 5, 2019
5f22089
ASoC: SOF: Intel: hda: add parameter to control SoundWire clock stop …
plbossart Dec 5, 2019
6d7a6e7
soundwire: intel: add support for CLK_STOP_NOT_ALLOWED
plbossart Dec 5, 2019
83bd6a0
soundwire: intel_init: handle power rail dependencies for clock stop …
plbossart Dec 5, 2019
e34d8be
[FIXME] soundwire: intel: clock_stop mode without quirks
plbossart Dec 5, 2019
f1ae688
soundwire: bus: don't signal enumeration complete after alert
plbossart Dec 5, 2019
a1dd398
soundwire: bus: fix io error when processing alert event
RanderWang Dec 4, 2019
85bb336
soundwire: bus: add traces for slave alerts
plbossart Dec 5, 2019
5aef8fe
soundwire: cadence_master: debug error on Olympic device in clock_stop
plbossart Dec 5, 2019
84149d6
soundwire: cadence_master: add interface to check clock status
RanderWang Dec 6, 2019
22bdc58
soundwire: intel: Fix a io timeout issue if SDW_INTEL_CLK_STOP_BUS_RESET
RanderWang Dec 6, 2019
a8502e3
soundwire: intel: refine pm function for clock_stop_quirks = 0
RanderWang Dec 6, 2019
52f38fc
Asoc: sof: check sdw wakeen interrupt in irq thread
RanderWang Dec 6, 2019
aa11fde
Asoc: sof: fix a kernel panic issue in sdw
RanderWang Dec 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
soundwire: sdw_slave: add enumeration_complete structure
When the Master starts the bus (be it during the initial boot or
system resume), it usually performs a HardReset to make sure
electrical levels are correct, then enables the control channel.

While the PM framework guarantees that the Slave devices will only
become 'active' once the Master completes the bus initialization,
there is still a risk of a race condition: the Slave enumeration is
handled in a separate interrupt thread triggered by hardware status
changes, so the Slave device may not be ready to accept commands when
the Slave driver tries to access the registers and restore settings in
its resume or pm_runtime_resume callbacks. In those cases, any
read/write commands from/to the Slave device will result in a timeout.

This patch adds an enumeration_complete structure. When the bus is
goes through a HardReset sequence and restarted, the Slave will be
marked as UNATTACHED, which will result in a call to
init_completion().

When the Slave reports its presence during PING frames as a non-zero
Device, the Master hardware will issue an interrupt and the bus driver
will invoke complete(). The order between init_completion()/complete()
is predictable since this is a Master-initiated transition.

The Slave driver may use wait_for_completion() in its resume callback.
When regmap is used, the Slave driver will typically set its regmap in
cache-only mode on suspend, then on resume block on
wait_for_completion(&enumeration_complete) to guarantee it is safe to
start read/write transactions. It may then exit the cache-only mode
and use a regmap_sync to restore settings. All these steps are
optional, their use completely depends on the Slave device
capabilities and how the Slave driver is implemented.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Dec 4, 2019
commit e8fbd1ce9b4baddc7710724d1ce0ef3ee76de903
4 changes: 4 additions & 0 deletions include/linux/soundwire/sdw.h
Original file line number Diff line number Diff line change
@@ -551,6 +551,9 @@ struct sdw_slave_ops {
* @probe_complete: completion utility to control potential races
* on startup between driver probe/initialization and SoundWire
* Slave state changes/implementation-defined interrupts
* @enumeration_complete: completion utility to control potential races
* on startup between device enumeration and read/write access to the
* Slave device
*/
struct sdw_slave {
struct sdw_slave_id id;
@@ -567,6 +570,7 @@ struct sdw_slave {
u16 dev_num;
bool probed;
struct completion probe_complete;
struct completion enumeration_complete;
};

#define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)