ASoC: SOF: Intel: hda: disable SoundWire interrupt later
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 10 Apr 2024 02:34:35 +0000 (02:34 +0000)
committerVinod Koul <vkoul@kernel.org>
Thu, 11 Apr 2024 17:22:51 +0000 (22:52 +0530)
The SoundWire interrupts can be masked at two levels
a) in the Cadence IP
b) at the HDaudio controller level

We have an existing mechanism with cancel_work_sync() and status flags
to make sure all existing interrupts are handled in the Cadence IP,
and likewise no new interrupts can be generated before turning off the
links.

However on remove we first use the higher-level mask at the controller
level, which is a sledgehammer preventing interrupts from all
links. This is very racy and not necessary. We can disable the
SoundWire interrupts after all the cleanups are done without any loss
of functionality.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240410023438.487017-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
sound/soc/sof/intel/hda.c

index 7fe72b06545147aee2bde593de7c7a5129de4a10..ecfdb8f882d201f5ffd634d0b3c5d04073612362 100644 (file)
@@ -384,12 +384,12 @@ static int hda_sdw_exit(struct snd_sof_dev *sdev)
 
        hdev = sdev->pdata->hw_pdata;
 
-       hda_sdw_int_enable(sdev, false);
-
        if (hdev->sdw)
                sdw_intel_exit(hdev->sdw);
        hdev->sdw = NULL;
 
+       hda_sdw_int_enable(sdev, false);
+
        return 0;
 }