mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
amd-iommu: implement suspend/resume
This patch puts everything together and enables suspend/resume support in the AMD IOMMU driver. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
parent
05f92db9f4
commit
736501ee00
1 changed files with 20 additions and 1 deletions
|
@ -965,12 +965,31 @@ static void disable_iommus(void)
|
||||||
|
|
||||||
static int amd_iommu_resume(struct sys_device *dev)
|
static int amd_iommu_resume(struct sys_device *dev)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Disable IOMMUs before reprogramming the hardware registers.
|
||||||
|
* IOMMU is still enabled from the resume kernel.
|
||||||
|
*/
|
||||||
|
disable_iommus();
|
||||||
|
|
||||||
|
/* re-load the hardware */
|
||||||
|
enable_iommus();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we have to flush after the IOMMUs are enabled because a
|
||||||
|
* disabled IOMMU will never execute the commands we send
|
||||||
|
*/
|
||||||
|
amd_iommu_flush_all_domains();
|
||||||
|
amd_iommu_flush_all_devices();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state)
|
static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
/* disable IOMMUs to go out of the way for BIOS */
|
||||||
|
disable_iommus();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sysdev_class amd_iommu_sysdev_class = {
|
static struct sysdev_class amd_iommu_sysdev_class = {
|
||||||
|
|
Loading…
Reference in a new issue