Skip to content

Commit

Permalink
drm/amdgpu: Verify DMA opearations from device are done
Browse files Browse the repository at this point in the history
In case device remove is just simualted by sysfs then verify
device doesn't keep doing DMA to the released memory after
pci_remove is done.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210512142648.666476-16-andrey.grodzovsky@amd.com
  • Loading branch information
Andrey Grodzovsky committed May 20, 2021
1 parent 984f826 commit 98c6e6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,13 @@ amdgpu_pci_remove(struct pci_dev *pdev)
drm_dev_unplug(dev);
amdgpu_driver_unload_kms(dev);

/*
* Flush any in flight DMA operations from device.
* Clear the Bus Master Enable bit and then wait on the PCIe Device
* StatusTransactions Pending bit.
*/
pci_disable_device(pdev);
pci_wait_for_pending_transaction(pdev);
}

static void
Expand Down

0 comments on commit 98c6e6a

Please sign in to comment.