Skip to contentSkip to conversation

PCI: vmd: Update VMD PM to correctly use generic PCI PM

PATCH Applied Jon Derrick 2 participants 2 messages Aug 6, 2020 – Sep 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI: vmd: Update VMD PM to correctly use generic PCI PM

The pci_save_state() call in vmd_suspend() can be performed by pci_pm_suspend_irq(). This also allows VMD to benefit from the call into pci_prepare_to_sleep().

The pci_restore_state() call in vmd_resume() was restoring state after pci_pm_resume()::pci_restore_standard_config() had already restored state. It's also been suspected that the config state should have been restored before re-requesting IRQs instead of afterwards.

This patch removes the pci_save_state()/pci_restore_state() calls in vmd_suspend()/vmd_resume() in order to allow proper flow through generic PCI core Power Management code.

Cc Kai-Heng Feng <[email protected]>
Cc You-Sheng Yang <[email protected]>

---
v1->v2: Commit message cleanup

 drivers/pci/controller/vmd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/pci/controller/vmd.c +0 -2
index 76d8acbee7d5..15c1d85d8780 100644
@@ -719,7 +719,6 @@ static int vmd_suspend(struct device *dev)
 	for (i = 0; i < vmd->msix_count; i++)
 		devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
 
-	pci_save_state(pdev);
 	return 0;
 }
 
@@ -737,7 +736,6 @@ static int vmd_resume(struct device *dev)
 			return err;
 	}
 
-	pci_restore_state(pdev);
 	return 0;
 }
 #endif
Signature · 1 line
2.18.1
#1 lore raw
Quoted 13 lines · Jon Derrick

The pci_save_state() call in vmd_suspend() can be performed by pci_pm_suspend_irq(). This also allows VMD to benefit from the call into pci_prepare_to_sleep().

The pci_restore_state() call in vmd_resume() was restoring state after pci_pm_resume()::pci_restore_standard_config() had already restored state. It's also been suspected that the config state should have been restored before re-requesting IRQs instead of afterwards.

This patch removes the pci_save_state()/pci_restore_state() calls in vmd_suspend()/vmd_resume() in order to allow proper flow through generic PCI core Power Management code.

Quoted 8 lines
Cc Kai-Heng Feng <[email protected]>
Cc You-Sheng Yang <[email protected]>

---
v1->v2: Commit message cleanup

 drivers/pci/controller/vmd.c | 2 --
 1 file changed, 2 deletions(-)

Applied to pci/vmd, thanks.

Lorenzo

Quoted 23 lines
drivers/pci/controller/vmd.c +0 -2
index 76d8acbee7d5..15c1d85d8780 100644
@@ -719,7 +719,6 @@ static int vmd_suspend(struct device *dev)
 	for (i = 0; i < vmd->msix_count; i++)
 		devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
 
-	pci_save_state(pdev);
 	return 0;
 }
 
@@ -737,7 +736,6 @@ static int vmd_resume(struct device *dev)
 			return err;
 	}
 
-	pci_restore_state(pdev);
 	return 0;
 }
 #endif
Signature · 1 line
2.18.1