ASoC: SOF: misc updates for 6.7
Subsystems (5)
cover ASoC: SOF: misc updates for 6.7
New PCI ID, one fix for a delayed IRQ thread causing issues, one update for debug and one follow-up cleanup for the .remove callback.
Arun T (1):
ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
Peter Ujfalusi (2):
ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending
before suspend
ASoC: SOF: ipc4: Dump the notification payload
Pierre-Louis Bossart (1):
ASoC: SOF: make .remove callback return void
sound/soc/sof/amd/acp.c | 4 ++-- sound/soc/sof/amd/acp.h | 2 +- sound/soc/sof/imx/imx8.c | 4 +--- sound/soc/sof/imx/imx8m.c | 4 +--- sound/soc/sof/imx/imx8ulp.c | 4 +--- sound/soc/sof/intel/byt.c | 4 +--- sound/soc/sof/intel/hda-dsp.c | 3 +++ sound/soc/sof/intel/hda.c | 4 +--- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/intel/pci-mtl.c | 31 ++++++++++++++++++++++++++ sound/soc/sof/ipc4.c | 4 ++++ sound/soc/sof/mediatek/mt8186/mt8186.c | 4 +--- sound/soc/sof/mediatek/mt8195/mt8195.c | 4 +--- sound/soc/sof/ops.h | 6 ++--- sound/soc/sof/sof-priv.h | 2 +- 15 files changed, 52 insertions(+), 30 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/4 ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
From: Arun T <[email protected]>
Split out firmware definitions for Intel Arrow Lake platforms.
--- sound/soc/sof/intel/pci-mtl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
sound/soc/sof/intel/pci-mtl.c +31 -0
@@ -50,9 +50,40 @@ static const struct sof_dev_desc mtl_desc = { .ops_free = hda_ops_free, }; +static const struct sof_dev_desc arl_desc = { + .use_acpi_target_states = true, + .machines = snd_soc_acpi_intel_arl_machines, + .alt_machines = snd_soc_acpi_intel_arl_sdw_machines, + .resindex_lpe_base =0 , + .resindex_pcicfg_base =-1 , + .resindex_imr_base =-1 , + .irqindex_host_ipc =-1 , + .chip_info = &mtl_chip_info, + .ipc_supported_mask =BIT (SOF_IPC_TYPE_4 ), + .ipc_default =SOF_IPC_TYPE_4 , + .dspless_mode_supported = true,/* Only supported for HDaudio */ + .default_fw_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ipc4/arl" , + }, + .default_lib_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ipc4-lib/arl" , + }, + .default_tplg_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ace-tplg" , + }, + .default_fw_filename = { + [SOF_IPC_TYPE_4 ] ="sof-arl.ri" , + }, + .nocodec_tplg_filename ="sof-arl-nocodec.tplg" , + .ops = &sof_mtl_ops, + .ops_init = sof_mtl_ops_init, + .ops_free = hda_ops_free, +}; +/* PCI IDs */ static const struct pci_device_id sof_pci_ids[] = { {PCI_DEVICE_DATA (INTEL ,HDA_MTL , &mtl_desc) }, + {PCI_DEVICE_DATA (INTEL ,HDA_ARL_S , &arl_desc) }, {0 , } };MODULE_DEVICE_TABLE (pci, sof_pci_ids);
Signature · 1 line
2.39.2
PATCH 2/4 ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend
In reply to Pierre-Louis BossartFrom: Peter Ujfalusi <[email protected]>
In the existing IPC support, the reply to each IPC message is handled in an IRQ thread. The assumption is that the IRQ thread is scheduled without significant delays.
On an experimental (iow, buggy) kernel, the IRQ thread dealing with the reply to the last IPC message before powering-down the DSP can be delayed by several seconds. The IRQ thread will proceed with register accesses after the DSP is powered-down which results in a kernel crash.
While the bug which causes the delay is not in the audio stack, we must handle such cases with defensive programming to avoid such crashes.
Call synchronize_irq() before proceeding to power down the DSP to make sure that no irq thread is pending execution.
--- sound/soc/sof/intel/hda-dsp.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/sof/intel/hda-dsp.c +3 -0
@@ -699,6 +699,9 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)if (ret <0 )return ret; +/* make sure that no irq handler is pending before shutdown */ +synchronize_irq (sdev->ipc_irq); +hda_codec_jack_wake_enable (sdev, runtime_suspend);/* power down all hda links */
Signature · 1 line
2.39.2
PATCH 3/4 ASoC: SOF: ipc4: Dump the notification payload
In reply to Pierre-Louis BossartFrom: Peter Ujfalusi <[email protected]>
Now that we have notifications with payload (kcontrol change notifications), it is time to add the payload dump on the rx path as well.
--- sound/soc/sof/ipc4.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/sof/ipc4.c +4 -0
@@ -666,6 +666,10 @@ static void sof_ipc4_rx_msg(struct snd_sof_dev *sdev)sof_ipc4_log_header (sdev->dev,"ipc rx done " , ipc4_msg, true);if (data_size) { +if (sof_debug_check_flag (SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD )) +sof_ipc4_dump_payload (sdev, ipc4_msg->data_ptr, + ipc4_msg->data_size); +kfree (ipc4_msg->data_ptr); ipc4_msg->data_ptr =NULL ; ipc4_msg->data_size =0 ;
Signature · 1 line
2.39.2
PATCH 4/4 ASoC: SOF: make .remove callback return void
In reply to Pierre-Louis BossartWe don't use the returned value and return 0 anyways, let's follow the example of platform drivers and simplify the definitions.
--- sound/soc/sof/amd/acp.c | 4 ++-- sound/soc/sof/amd/acp.h | 2 +- sound/soc/sof/imx/imx8.c | 4 +--- sound/soc/sof/imx/imx8m.c | 4 +--- sound/soc/sof/imx/imx8ulp.c | 4 +--- sound/soc/sof/intel/byt.c | 4 +--- sound/soc/sof/intel/hda.c | 4 +--- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/mediatek/mt8186/mt8186.c | 4 +--- sound/soc/sof/mediatek/mt8195/mt8195.c | 4 +--- sound/soc/sof/ops.h | 6 ++---- sound/soc/sof/sof-priv.h | 2 +- 12 files changed, 14 insertions(+), 30 deletions(-)
sound/soc/sof/amd/acp.c +2 -2
@@ -575,7 +575,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) }EXPORT_SYMBOL_NS (amd_sof_acp_probe,SND_SOC_SOF_AMD_COMMON ); -int amd_sof_acp_remove (struct snd_sof_dev *sdev) +void amd_sof_acp_remove (struct snd_sof_dev *sdev) {struct acp_dev_data *adata = sdev->pdata->hw_pdata;
@@ -588,7 +588,7 @@ int amd_sof_acp_remove(struct snd_sof_dev *sdev)if (adata->dmic_dev)platform_device_unregister (adata->dmic_dev); -return acp_reset (sdev); +acp_reset (sdev); }EXPORT_SYMBOL_NS (amd_sof_acp_remove,SND_SOC_SOF_AMD_COMMON );
sound/soc/sof/amd/acp.h +1 -1
@@ -220,7 +220,7 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr,/* ACP device probe/remove */ int amd_sof_acp_probe (struct snd_sof_dev *sdev); -int amd_sof_acp_remove (struct snd_sof_dev *sdev); +void amd_sof_acp_remove (struct snd_sof_dev *sdev);/* DSP Loader callbacks */ int acp_sof_dsp_run (struct snd_sof_dev *sdev);
sound/soc/sof/imx/imx8.c +1 -3
@@ -338,7 +338,7 @@ static int imx8_probe(struct snd_sof_dev *sdev)return ret; } -static int imx8_remove (struct snd_sof_dev *sdev) +static void imx8_remove (struct snd_sof_dev *sdev) {struct imx8_priv *priv = sdev->pdata->hw_pdata;int i;
@@ -350,8 +350,6 @@ static int imx8_remove(struct snd_sof_dev *sdev)device_link_del (priv->link[i]);dev_pm_domain_detach (priv->pd_dev[i], false); } - -return 0 ; }/* on i.MX8 there is 1 to 1 match between type and BAR idx */
sound/soc/sof/imx/imx8m.c +1 -3
@@ -269,14 +269,12 @@ static int imx8m_probe(struct snd_sof_dev *sdev)return ret; } -static int imx8m_remove (struct snd_sof_dev *sdev) +static void imx8m_remove (struct snd_sof_dev *sdev) {struct imx8m_priv *priv = sdev->pdata->hw_pdata;imx8_disable_clocks (sdev, priv->clks);platform_device_unregister (priv->ipc_dev); - -return 0 ; }/* on i.MX8 there is 1 to 1 match between type and BAR idx */
sound/soc/sof/imx/imx8ulp.c +1 -3
@@ -278,14 +278,12 @@ static int imx8ulp_probe(struct snd_sof_dev *sdev)return ret; } -static int imx8ulp_remove (struct snd_sof_dev *sdev) +static void imx8ulp_remove (struct snd_sof_dev *sdev) {struct imx8ulp_priv *priv = sdev->pdata->hw_pdata;imx8_disable_clocks (sdev, priv->clks);platform_device_unregister (priv->ipc_dev); - -return 0 ; }/* on i.MX8 there is 1 to 1 match between type and BAR idx */
sound/soc/sof/intel/byt.c +1 -3
@@ -100,11 +100,9 @@ static int byt_resume(struct snd_sof_dev *sdev)return 0 ; } -static int byt_remove (struct snd_sof_dev *sdev) +static void byt_remove (struct snd_sof_dev *sdev) {byt_reset_dsp_disable_int (sdev); - -return 0 ; }static int byt_acpi_probe (struct snd_sof_dev *sdev)
sound/soc/sof/intel/hda.c +1 -3
@@ -1317,7 +1317,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)return ret; } -int hda_dsp_remove (struct snd_sof_dev *sdev) +void hda_dsp_remove (struct snd_sof_dev *sdev) {struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;const struct sof_intel_dsp_desc *chip = hda->desc;
@@ -1377,8 +1377,6 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)sof_hda_bus_exit (sdev);hda_codec_i915_exit (sdev); - -return 0 ; }int hda_power_down_dsp (struct snd_sof_dev *sdev)
sound/soc/sof/intel/hda.h +1 -1
@@ -577,7 +577,7 @@ struct sof_intel_hda_stream {* DSP Core services. */ int hda_dsp_probe (struct snd_sof_dev *sdev); -int hda_dsp_remove (struct snd_sof_dev *sdev); +void hda_dsp_remove (struct snd_sof_dev *sdev);int hda_dsp_core_power_up (struct snd_sof_dev *sdev,unsigned int core_mask);int hda_dsp_core_run (struct snd_sof_dev *sdev,unsigned int core_mask);int hda_dsp_enable_core (struct snd_sof_dev *sdev,unsigned int core_mask);
sound/soc/sof/mediatek/mt8186/mt8186.c +1 -3
@@ -391,7 +391,7 @@ static int mt8186_dsp_probe(struct snd_sof_dev *sdev)return ret; } -static int mt8186_dsp_remove (struct snd_sof_dev *sdev) +static void mt8186_dsp_remove (struct snd_sof_dev *sdev) {struct adsp_priv *priv = sdev->pdata->hw_pdata;
@@ -399,8 +399,6 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev)mt8186_sof_hifixdsp_shutdown (sdev);adsp_sram_power_off (sdev);mt8186_adsp_clock_off (sdev); - -return 0 ; }static int mt8186_dsp_shutdown (struct snd_sof_dev *sdev)
sound/soc/sof/mediatek/mt8195/mt8195.c +1 -3
@@ -388,7 +388,7 @@ static int mt8195_dsp_shutdown(struct snd_sof_dev *sdev)return snd_sof_suspend (sdev->dev); } -static int mt8195_dsp_remove (struct snd_sof_dev *sdev) +static void mt8195_dsp_remove (struct snd_sof_dev *sdev) { struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev);struct adsp_priv *priv = sdev->pdata->hw_pdata;
@@ -396,8 +396,6 @@ static int mt8195_dsp_remove(struct snd_sof_dev *sdev)platform_device_unregister (priv->ipc_dev);adsp_sram_power_on (&pdev->dev, false);adsp_clock_off (sdev); - -return 0 ; }static int mt8195_dsp_suspend (struct snd_sof_dev *sdev,u32 target_state)
sound/soc/sof/ops.h +2 -4
@@ -43,12 +43,10 @@ static inline int snd_sof_probe(struct snd_sof_dev *sdev)return sof_ops (sdev)->probe (sdev); } -static inline int snd_sof_remove (struct snd_sof_dev *sdev) +static inline void snd_sof_remove (struct snd_sof_dev *sdev) {if (sof_ops (sdev)->remove) -return sof_ops (sdev)->remove (sdev); - -return 0 ; +sof_ops (sdev)->remove (sdev); }static inline int snd_sof_shutdown (struct snd_sof_dev *sdev)
sound/soc/sof/sof-priv.h +1 -1
@@ -166,7 +166,7 @@ struct snd_sof_dsp_ops {/* probe/remove/shutdown */ int (*probe)(struct snd_sof_dev *sof_dev);/* mandatory */ -int (*remove)(struct snd_sof_dev *sof_dev);/* optional */ +void (*remove)(struct snd_sof_dev *sof_dev);/* optional */ int (*shutdown)(struct snd_sof_dev *sof_dev);/* optional */ /* DSP core boot / reset */
Signature · 1 line
2.39.2
Mark Brown
maintainerQuoted 6 lines · Pierre-Louis Bossart
New PCI ID, one fix for a delayed IRQ thread causing issues, one update for debug and one follow-up cleanup for the .remove callback.
Arun T (1):
ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
Quoted 6 lines
Peter Ujfalusi (2):
ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending
before suspend
ASoC: SOF: ipc4: Dump the notification payload[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
commit: 3851831f529ec3d7b2c7708b2579bfc00d43733c
[2/4] ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend
commit: 576a0b71b5b479008dacb3047a346625040f5ac6
[3/4] ASoC: SOF: ipc4: Dump the notification payload
commit: a2d952ba90de2197a27e1443b783265a91760507
[4/4] ASoC: SOF: make .remove callback return void
commit: e4d09de3919bb0ed5327acb238e849f3287f2706All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark