mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10.git
synced 2026-09-09 00:07:04 +08:00
ASoC: amd: ps: disable MSI on resume in ACP PCI driver
JIRA: https://issues.redhat.com/browse/RHEL-193253 commit 5893013efabb056399a01e267f410cf76eba25eb Author: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Date: Tue Jul 7 11:29:36 2026 +0530 ASoC: amd: ps: disable MSI on resume in ACP PCI driver BIOS/firmware may re-enable MSI in PCI config space during system level resume even though this driver only uses legacy INTx interrupts. If MSI is left enabled with stale address/data registers, the device will write interrupts to a bogus address causing IOMMU IO_PAGE_FAULT and interrupt delivery failure. Clear the MSI Enable bit before reinitializing the ACP hardware on system level resume. Fixes: 491628388005 ("ASoC: amd: ps: add callback functions for acp pci driver pm ops") Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/20260707060130.2514138-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
This commit is contained in:
@@ -692,8 +692,37 @@ static int snd_acp_runtime_resume(struct device *dev)
|
||||
return acp_hw_runtime_resume(dev);
|
||||
}
|
||||
|
||||
static void acp_disable_msi_on_resume(struct pci_dev *pdev)
|
||||
{
|
||||
u16 control;
|
||||
|
||||
if (!pdev->msi_cap)
|
||||
return;
|
||||
|
||||
pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &control);
|
||||
if (control & PCI_MSI_FLAGS_ENABLE) {
|
||||
dev_warn(&pdev->dev,
|
||||
"ACP: MSI unexpectedly enabled after resume (flags=0x%04x), disabling\n",
|
||||
control);
|
||||
control &= ~PCI_MSI_FLAGS_ENABLE;
|
||||
pci_write_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, control);
|
||||
}
|
||||
}
|
||||
|
||||
static int snd_acp_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
|
||||
/*
|
||||
* BIOS/firmware may re-enable MSI in PCI config space during
|
||||
* system resume even though this driver only uses legacy INTx
|
||||
* interrupts. If MSI is left enabled with stale address/data
|
||||
* registers, the device will write interrupts to a bogus address
|
||||
* causing IOMMU IO_PAGE_FAULT and interrupt delivery failure.
|
||||
* Explicitly clear the MSI Enable bit before reinitializing
|
||||
* the ACP hardware.
|
||||
*/
|
||||
acp_disable_msi_on_resume(pdev);
|
||||
return acp_hw_resume(dev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user