Skip to content

Commit b61cf04

Browse files
Nirmal PatelLorenzo Pieralisi
authored andcommitted
PCI: vmd: Reset VMD config register between soft reboots
VMD driver can disable or enable MSI remapping by changing VMCONFIG_MSI_REMAP register. This register needs to be set to the default value during soft reboots. Drives failed to enumerate when Windows boots after performing a soft reboot from Linux. Windows doesn't support MSI remapping disable feature and stale register value hinders Windows VMD driver initialization process. Adding vmd_shutdown function to make sure to set the VMCONFIG register to the default value. Link: https://lore.kernel.org/r/20230224202811.644370-1-nirmal.patel@linux.intel.com Fixes: ee81ee8 ("PCI: vmd: Disable MSI-X remapping when possible") Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Reviewed-by: Jon Derrick <jonathan.derrick@linux.dev>
1 parent ac9a786 commit b61cf04

File tree

1 file changed

+8
-0
lines changed
  • drivers/pci/controller

1 file changed

+8
-0
lines changed

drivers/pci/controller/vmd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,13 @@ static void vmd_remove(struct pci_dev *dev)
10361036
ida_simple_remove(&vmd_instance_ida, vmd->instance);
10371037
}
10381038

1039+
static void vmd_shutdown(struct pci_dev *dev)
1040+
{
1041+
struct vmd_dev *vmd = pci_get_drvdata(dev);
1042+
1043+
vmd_remove_irq_domain(vmd);
1044+
}
1045+
10391046
#ifdef CONFIG_PM_SLEEP
10401047
static int vmd_suspend(struct device *dev)
10411048
{
@@ -1101,6 +1108,7 @@ static struct pci_driver vmd_drv = {
11011108
.id_table = vmd_ids,
11021109
.probe = vmd_probe,
11031110
.remove = vmd_remove,
1111+
.shutdown = vmd_shutdown,
11041112
.driver = {
11051113
.pm = &vmd_dev_pm_ops,
11061114
},

0 commit comments

Comments
 (0)