drm/amdgpu: release exclusive mode after hw_init if no kfd (v2)
Subsystems (3)
PATCH 1/1 drm/amdgpu: release exclusive mode after hw_init if no kfd (v2)
From: pding <[email protected]>
Move kfd probe prior to device init. Release exclusive mode after hw_init if kfd is not enabled.
v2:
- pass pdev param
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +3 -2
@@ -68,7 +68,8 @@ void amdgpu_amdkfd_fini(void) } } -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev) +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev) {const struct kfd2kgd_calls *kfd2kgd;
@@ -90,7 +91,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) } adev->kfd = kgd2kfd->probe ((struct kgd_dev *)adev, - adev->pdev, kfd2kgd); + pdev, kfd2kgd); }void amdgpu_amdkfd_device_init (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +2 -1
@@ -44,7 +44,8 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev);int amdgpu_amdkfd_resume (struct amdgpu_device *adev);void amdgpu_amdkfd_interrupt (struct amdgpu_device *adev,const void *ih_ring_entry); -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev); +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev);void amdgpu_amdkfd_device_init (struct amdgpu_device *adev);void amdgpu_amdkfd_device_fini (struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -1716,6 +1716,9 @@ static int amdgpu_init(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = true; } +if (amdgpu_sriov_vf (adev) && !adev->kfd) +amdgpu_virt_release_full_gpu (adev, true); +return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -2
@@ -138,6 +138,8 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) !pci_is_thunderbolt_attached(dev->pdev)) flags |=AMD_IS_PX ; +amdgpu_amdkfd_device_probe (adev, dev->pdev); +/* amdgpu_device_init should report only fatal error * like memory allocation failure or iomapping failure, * or memory manager initialization failure, it must
@@ -170,7 +172,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) "Error during ACPI methods call\n"); } -amdgpu_amdkfd_device_probe (adev);amdgpu_amdkfd_device_init (adev);if (amdgpu_device_is_px (dev)) {
@@ -182,7 +183,7 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)pm_runtime_put_autosuspend (dev->dev); } -if (amdgpu_sriov_vf (adev)) +if (amdgpu_sriov_vf (adev) && adev->kfd)amdgpu_virt_release_full_gpu (adev, true); out:
Signature · 6 lines
2.9.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509414421-26240-1-git-send-email-Pixel.Ding-5C7GfCeVMHo@public.gmane.org
Hi Oded,
Would you please help reviewing the V2 patch?
—
Sincerely Yours,
Pixel
Quoted 96 lines · Pixel Ding
From: pding <[email protected]>
Move kfd probe prior to device init. Release exclusive mode after
hw_initif kfd is not enabled.v2:
- pass pdev paramSigned-off-by pding <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +3
-2@@ -68,7 +68,8 @@ void amdgpu_amdkfd_fini(void) } } -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev) +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev) {const struct kfd2kgd_calls *kfd2kgd;@@ -90,7 +91,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) } adev->kfd = kgd2kfd->probe ((struct kgd_dev *)adev, - adev->pdev, kfd2kgd); + pdev, kfd2kgd); }void amdgpu_amdkfd_device_init (struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +2
-1@@ -44,7 +44,8 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev);int amdgpu_amdkfd_resume (struct amdgpu_device *adev);void amdgpu_amdkfd_interrupt (struct amdgpu_device *adev,const void *ih_ring_entry); -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev); +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev);void amdgpu_amdkfd_device_init (struct amdgpu_device *adev);void amdgpu_amdkfd_device_fini (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-0@@ -1716,6 +1716,9 @@ static int amdgpu_init(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = true; } +if (amdgpu_sriov_vf (adev) && !adev->kfd) +amdgpu_virt_release_full_gpu (adev, true); +return 0 ; }drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3
-2@@ -138,6 +138,8 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) !pci_is_thunderbolt_attached(dev->pdev)) flags |=AMD_IS_PX ; +amdgpu_amdkfd_device_probe (adev, dev->pdev); +/* amdgpu_device_init should report only fatal error * like memory allocation failure or iomapping failure, * or memory manager initialization failure, it must @@ -170,7 +172,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) "Error during ACPI methods call\n"); } -amdgpu_amdkfd_device_probe (adev);amdgpu_amdkfd_device_init (adev);if (amdgpu_device_is_px (dev)) {@@ -182,7 +183,7 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)pm_runtime_put_autosuspend (dev->dev); } -if (amdgpu_sriov_vf (adev)) +if (amdgpu_sriov_vf (adev) && adev->kfd)amdgpu_virt_release_full_gpu (adev, true);
Quoted 4 lines
out:
Signature · 1 line
2.9.5
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1CD23855-2D9C-4909-9FE0-776F4AACA275-5C7GfCeVMHo@public.gmane.org
I sent you an answer in the other email thread
Quoted 109 lines · Pixel
Hi Oded,
Would you please help reviewing the V2 patch?
—
Sincerely Yours,
PixelQuoted 92 lines · Pixel Ding
From: pding <[email protected]>
Move kfd probe prior to device init. Release exclusive mode after
hw_initif kfd is not enabled.v2:
- pass pdev paramSigned-off-by pding <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +3
-2@@ -68,7 +68,8 @@ void amdgpu_amdkfd_fini(void) } } -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev) +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev) {const struct kfd2kgd_calls *kfd2kgd;@@ -90,7 +91,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) } adev->kfd = kgd2kfd->probe ((struct kgd_dev *)adev, - adev->pdev, kfd2kgd); + pdev, kfd2kgd); }void amdgpu_amdkfd_device_init (struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +2
-1@@ -44,7 +44,8 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev);int amdgpu_amdkfd_resume (struct amdgpu_device *adev);void amdgpu_amdkfd_interrupt (struct amdgpu_device *adev,const void *ih_ring_entry); -void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev); +void amdgpu_amdkfd_device_probe (struct amdgpu_device *adev, +struct pci_dev *pdev);void amdgpu_amdkfd_device_init (struct amdgpu_device *adev);void amdgpu_amdkfd_device_fini (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3
-0@@ -1716,6 +1716,9 @@ static int amdgpu_init(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = true; } +if (amdgpu_sriov_vf (adev) && !adev->kfd) +amdgpu_virt_release_full_gpu (adev, true); +return 0 ; }drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-1@@ -138,6 +138,8 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) !pci_is_thunderbolt_attached(dev->pdev)) flags |=AMD_IS_PX ; +amdgpu_amdkfd_device_probe (adev, dev->pdev); +/* amdgpu_device_init should report only fatal error * like memory allocation failure or iomapping failure, * or memory manager initialization failure, it must @@ -170,7 +172,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) "Error during ACPI methods call\n"); } -amdgpu_amdkfd_device_probe (adev);amdgpu_amdkfd_device_init (adev);if (amdgpu_device_is_px (dev)) {@@ -182,7 +183,7 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)pm_runtime_put_autosuspend (dev->dev); }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1
-1-if (amdgpu_sriov_vf (adev)) +if (amdgpu_sriov_vf (adev) && adev->kfd)amdgpu_virt_release_full_gpu (adev, true);out:
--
2.9.5
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx