All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early
@ 2021-09-29  9:22 YuBiao Wang
  2021-09-29 13:43 ` Alex Deucher
  2021-09-29 14:32 ` Andrey Grodzovsky
  0 siblings, 2 replies; 3+ messages in thread
From: YuBiao Wang @ 2021-09-29  9:22 UTC (permalink / raw)
  To: amd-gfx
  Cc: Andrey Grodzovsky, Evan Quan, horace.chen, Tuikov Luben,
	Christian König, Deucher Alexander, Jack Xiao,
	Hawking Zhang, Monk Liu, Feifei Xu, Kevin Wang, Jingwen Chen,
	YuBiao Wang

Some IP such as SMU need irq_put to perform hw_fini.
So move irq_fini_hw after ip_fini.

Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 4c8f2f4647c0..18e26a78ef82 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3864,10 +3864,10 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
 		amdgpu_ucode_sysfs_fini(adev);
 	sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);
 
-	amdgpu_irq_fini_hw(adev);
-
 	amdgpu_device_ip_fini_early(adev);
 
+	amdgpu_irq_fini_hw(adev);
+
 	ttm_device_clear_dma_mappings(&adev->mman.bdev);
 
 	amdgpu_gart_dummy_page_fini(adev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early
  2021-09-29  9:22 [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early YuBiao Wang
@ 2021-09-29 13:43 ` Alex Deucher
  2021-09-29 14:32 ` Andrey Grodzovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2021-09-29 13:43 UTC (permalink / raw)
  To: YuBiao Wang
  Cc: amd-gfx list, Andrey Grodzovsky, Evan Quan, Horace Chen,
	Tuikov Luben, Christian König, Deucher Alexander, Jack Xiao,
	Hawking Zhang, Monk Liu, Feifei Xu, Kevin Wang, Jingwen Chen

On Wed, Sep 29, 2021 at 5:22 AM YuBiao Wang <YuBiao.Wang@amd.com> wrote:
>
> Some IP such as SMU need irq_put to perform hw_fini.
> So move irq_fini_hw after ip_fini.
>
> Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>

This looks correct in general, but will this code:
        if (!amdgpu_device_has_dc_support(adev))
                        flush_work(&adev->hotplug_work);
in amdgpu_irq_fini_hw() cause any problems if it gets executed after
the DCE hw has been stopped?  I guess it should be ok.

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4c8f2f4647c0..18e26a78ef82 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3864,10 +3864,10 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>                 amdgpu_ucode_sysfs_fini(adev);
>         sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);
>
> -       amdgpu_irq_fini_hw(adev);
> -
>         amdgpu_device_ip_fini_early(adev);
>
> +       amdgpu_irq_fini_hw(adev);
> +
>         ttm_device_clear_dma_mappings(&adev->mman.bdev);
>
>         amdgpu_gart_dummy_page_fini(adev);
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early
  2021-09-29  9:22 [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early YuBiao Wang
  2021-09-29 13:43 ` Alex Deucher
@ 2021-09-29 14:32 ` Andrey Grodzovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Grodzovsky @ 2021-09-29 14:32 UTC (permalink / raw)
  To: YuBiao Wang, amd-gfx
  Cc: Evan Quan, horace.chen, Tuikov Luben, Christian König,
	Deucher Alexander, Jack Xiao, Hawking Zhang, Monk Liu, Feifei Xu,
	Kevin Wang, Jingwen Chen

Can you test  this change with hotunplug tests in libdrm ?
Since the tests are still in disabled mode until latest fixes propagate
to drm-next upstream you will need to comment out 
https://gitlab.freedesktop.org/mesa/drm/-/blob/main/tests/amdgpu/hotunplug_tests.c#L65
I recently fixed a few regressions in amdgpu so hopefully there isn't 
more regressions
which will interfere with your testing.

Andrey

On 2021-09-29 5:22 a.m., YuBiao Wang wrote:
> Some IP such as SMU need irq_put to perform hw_fini.
> So move irq_fini_hw after ip_fini.
>
> Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4c8f2f4647c0..18e26a78ef82 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3864,10 +3864,10 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>   		amdgpu_ucode_sysfs_fini(adev);
>   	sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);
>   
> -	amdgpu_irq_fini_hw(adev);
> -
>   	amdgpu_device_ip_fini_early(adev);
>   
> +	amdgpu_irq_fini_hw(adev);
> +
>   	ttm_device_clear_dma_mappings(&adev->mman.bdev);
>   
>   	amdgpu_gart_dummy_page_fini(adev);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-29 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29  9:22 [PATCH] drm/amd/amdgpu: Do irq_fini_hw after ip_fini_early YuBiao Wang
2021-09-29 13:43 ` Alex Deucher
2021-09-29 14:32 ` Andrey Grodzovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.