<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
sysfs cleanup is a sw cleanup to me but done inside hw fini. sw/hw separation is not strictly followed, or name it like stage1/stage2 fini.</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<br>
</div>
<div id="ms-outlook-mobile-signature">Thanks,<br>
Lijo</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Andrey Grodzovsky <andrey.grodzovsky@amd.com><br>
<b>Sent:</b> Wednesday, April 28, 2021 8:41:43 PM<br>
<b>To:</b> dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; linux-pci@vger.kernel.org <linux-pci@vger.kernel.org>; ckoenig.leichtzumerken@gmail.com <ckoenig.leichtzumerken@gmail.com>;
 daniel.vetter@ffwll.ch <daniel.vetter@ffwll.ch>; Wentland, Harry <Harry.Wentland@amd.com><br>
<b>Cc:</b> Grodzovsky, Andrey <Andrey.Grodzovsky@amd.com>; gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>; Kuehling, Felix <Felix.Kuehling@amd.com>; ppaalanen@gmail.com <ppaalanen@gmail.com>; helgaas@kernel.org <helgaas@kernel.org>; Deucher, Alexander
 <Alexander.Deucher@amd.com><br>
<b>Subject:</b> [PATCH v5 03/27] drm/amdgpu: Split amdgpu_device_fini into early and late</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Some of the stuff in amdgpu_device_fini such as HW interrupts<br>
disable and pending fences finilization must be done right away on<br>
pci_remove while most of the stuff which relates to finilizing and<br>
releasing driver data structures can be kept until<br>
drm_driver.release hook is called, i.e. when the last device<br>
reference is dropped.<br>
<br>
v4: Change functions prefix early->hw and late->sw<br>
<br>
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  6 ++++-<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 +++++++++++++++-------<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    |  7 ++----<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c  | 15 ++++++++++++-<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c    | 26 +++++++++++++---------<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h    |  3 ++-<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c    | 12 +++++++++-<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c    |  1 +<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |  3 ++-<br>
 drivers/gpu/drm/amd/amdgpu/cik_ih.c        |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/cz_ih.c         |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/iceland_ih.c    |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c     |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/si_ih.c         |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/tonga_ih.c      |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c     |  2 +-<br>
 drivers/gpu/drm/amd/amdgpu/vega20_ih.c     |  2 +-<br>
 17 files changed, 79 insertions(+), 36 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
index 1af2fa1591fd..fddb82897e5d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
@@ -1073,7 +1073,9 @@ static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_device *bdev)<br>
 <br>
 int amdgpu_device_init(struct amdgpu_device *adev,<br>
                        uint32_t flags);<br>
-void amdgpu_device_fini(struct amdgpu_device *adev);<br>
+void amdgpu_device_fini_hw(struct amdgpu_device *adev);<br>
+void amdgpu_device_fini_sw(struct amdgpu_device *adev);<br>
+<br>
 int amdgpu_gpu_wait_for_idle(struct amdgpu_device *adev);<br>
 <br>
 void amdgpu_device_vram_access(struct amdgpu_device *adev, loff_t pos,<br>
@@ -1289,6 +1291,8 @@ void amdgpu_driver_lastclose_kms(struct drm_device *dev);<br>
 int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv);<br>
 void amdgpu_driver_postclose_kms(struct drm_device *dev,<br>
                                  struct drm_file *file_priv);<br>
+void amdgpu_driver_release_kms(struct drm_device *dev);<br>
+<br>
 int amdgpu_device_ip_suspend(struct amdgpu_device *adev);<br>
 int amdgpu_device_suspend(struct drm_device *dev, bool fbcon);<br>
 int amdgpu_device_resume(struct drm_device *dev, bool fbcon);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index 6447cd6ca5a8..8d22b79fc1cd 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -3590,14 +3590,12 @@ int amdgpu_device_init(struct amdgpu_device *adev,<br>
  * Tear down the driver info (all asics).<br>
  * Called at driver shutdown.<br>
  */<br>
-void amdgpu_device_fini(struct amdgpu_device *adev)<br>
+void amdgpu_device_fini_hw(struct amdgpu_device *adev)<br>
 {<br>
         dev_info(adev->dev, "amdgpu: finishing device.\n");<br>
         flush_delayed_work(&adev->delayed_init_work);<br>
         adev->shutdown = true;<br>
 <br>
-       kfree(adev->pci_state);<br>
-<br>
         /* make sure IB test finished before entering exclusive mode<br>
          * to avoid preemption on IB test<br>
          * */<br>
@@ -3614,11 +3612,24 @@ void amdgpu_device_fini(struct amdgpu_device *adev)<br>
                 else<br>
                         drm_atomic_helper_shutdown(adev_to_drm(adev));<br>
         }<br>
-       amdgpu_fence_driver_fini(adev);<br>
+       amdgpu_fence_driver_fini_hw(adev);<br>
+<br>
         if (adev->pm_sysfs_en)<br>
                 amdgpu_pm_sysfs_fini(adev);<br>
+       if (adev->ucode_sysfs_en)<br>
+               amdgpu_ucode_sysfs_fini(adev);<br>
+       sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);<br>
+<br>
+<br>
         amdgpu_fbdev_fini(adev);<br>
+<br>
+       amdgpu_irq_fini_hw(adev);<br>
+}<br>
+<br>
+void amdgpu_device_fini_sw(struct amdgpu_device *adev)<br>
+{<br>
         amdgpu_device_ip_fini(adev);<br>
+       amdgpu_fence_driver_fini_sw(adev);<br>
         release_firmware(adev->firmware.gpu_info_fw);<br>
         adev->firmware.gpu_info_fw = NULL;<br>
         adev->accel_working = false;<br>
@@ -3647,14 +3658,13 @@ void amdgpu_device_fini(struct amdgpu_device *adev)<br>
         adev->rmmio = NULL;<br>
         amdgpu_device_doorbell_fini(adev);<br>
 <br>
-       if (adev->ucode_sysfs_en)<br>
-               amdgpu_ucode_sysfs_fini(adev);<br>
-<br>
-       sysfs_remove_files(&adev->dev->kobj, amdgpu_dev_attributes);<br>
         if (IS_ENABLED(CONFIG_PERF_EVENTS))<br>
                 amdgpu_pmu_fini(adev);<br>
         if (adev->mman.discovery_bin)<br>
                 amdgpu_discovery_fini(adev);<br>
+<br>
+       kfree(adev->pci_state);<br>
+<br>
 }<br>
 <br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 671ec1002230..54cb5ee2f563 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -1249,14 +1249,10 @@ amdgpu_pci_remove(struct pci_dev *pdev)<br>
 {<br>
         struct drm_device *dev = pci_get_drvdata(pdev);<br>
 <br>
-#ifdef MODULE<br>
-       if (THIS_MODULE->state != MODULE_STATE_GOING)<br>
-#endif<br>
-               DRM_ERROR("Hotplug removal is not supported\n");<br>
         drm_dev_unplug(dev);<br>
         amdgpu_driver_unload_kms(dev);<br>
+<br>
         pci_disable_device(pdev);<br>
-       pci_set_drvdata(pdev, NULL);<br>
 }<br>
 <br>
 static void<br>
@@ -1587,6 +1583,7 @@ static const struct drm_driver amdgpu_kms_driver = {<br>
         .dumb_create = amdgpu_mode_dumb_create,<br>
         .dumb_map_offset = amdgpu_mode_dumb_mmap,<br>
         .fops = &amdgpu_driver_kms_fops,<br>
+       .release = &amdgpu_driver_release_kms,<br>
 <br>
         .prime_handle_to_fd = drm_gem_prime_handle_to_fd,<br>
         .prime_fd_to_handle = drm_gem_prime_fd_to_handle,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
index 8e0a5650d383..34d51e962799 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
@@ -523,7 +523,7 @@ int amdgpu_fence_driver_init(struct amdgpu_device *adev)<br>
  *<br>
  * Tear down the fence driver for all possible rings (all asics).<br>
  */<br>
-void amdgpu_fence_driver_fini(struct amdgpu_device *adev)<br>
+void amdgpu_fence_driver_fini_hw(struct amdgpu_device *adev)<br>
 {<br>
         unsigned i, j;<br>
         int r;<br>
@@ -544,6 +544,19 @@ void amdgpu_fence_driver_fini(struct amdgpu_device *adev)<br>
                 if (!ring->no_scheduler)<br>
                         drm_sched_fini(&ring->sched);<br>
                 del_timer_sync(&ring->fence_drv.fallback_timer);<br>
+       }<br>
+}<br>
+<br>
+void amdgpu_fence_driver_fini_sw(struct amdgpu_device *adev)<br>
+{<br>
+       unsigned int i, j;<br>
+<br>
+       for (i = 0; i < AMDGPU_MAX_RINGS; i++) {<br>
+               struct amdgpu_ring *ring = adev->rings[i];<br>
+<br>
+               if (!ring || !ring->fence_drv.initialized)<br>
+                       continue;<br>
+<br>
                 for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j)<br>
                         dma_fence_put(ring->fence_drv.fences[j]);<br>
                 kfree(ring->fence_drv.fences);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c<br>
index afbbec82a289..63e815c27585 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c<br>
@@ -49,6 +49,7 @@<br>
 #include <drm/drm_irq.h><br>
 #include <drm/drm_vblank.h><br>
 #include <drm/amdgpu_drm.h><br>
+#include <drm/drm_drv.h><br>
 #include "amdgpu.h"<br>
 #include "amdgpu_ih.h"<br>
 #include "atom.h"<br>
@@ -313,6 +314,20 @@ int amdgpu_irq_init(struct amdgpu_device *adev)<br>
         return 0;<br>
 }<br>
 <br>
+<br>
+void amdgpu_irq_fini_hw(struct amdgpu_device *adev)<br>
+{<br>
+       if (adev->irq.installed) {<br>
+               drm_irq_uninstall(&adev->ddev);<br>
+               adev->irq.installed = false;<br>
+               if (adev->irq.msi_enabled)<br>
+                       pci_free_irq_vectors(adev->pdev);<br>
+<br>
+               if (!amdgpu_device_has_dc_support(adev))<br>
+                       flush_work(&adev->hotplug_work);<br>
+       }<br>
+}<br>
+<br>
 /**<br>
  * amdgpu_irq_fini - shut down interrupt handling<br>
  *<br>
@@ -322,19 +337,10 @@ int amdgpu_irq_init(struct amdgpu_device *adev)<br>
  * functionality, shuts down vblank, hotplug and reset interrupt handling,<br>
  * turns off interrupts from all sources (all ASICs).<br>
  */<br>
-void amdgpu_irq_fini(struct amdgpu_device *adev)<br>
+void amdgpu_irq_fini_sw(struct amdgpu_device *adev)<br>
 {<br>
         unsigned i, j;<br>
 <br>
-       if (adev->irq.installed) {<br>
-               drm_irq_uninstall(adev_to_drm(adev));<br>
-               adev->irq.installed = false;<br>
-               if (adev->irq.msi_enabled)<br>
-                       pci_free_irq_vectors(adev->pdev);<br>
-               if (!amdgpu_device_has_dc_support(adev))<br>
-                       flush_work(&adev->hotplug_work);<br>
-       }<br>
-<br>
         for (i = 0; i < AMDGPU_IRQ_CLIENTID_MAX; ++i) {<br>
                 if (!adev->irq.client[i].sources)<br>
                         continue;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h<br>
index ac527e5deae6..392a7324e2b1 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h<br>
@@ -104,7 +104,8 @@ void amdgpu_irq_disable_all(struct amdgpu_device *adev);<br>
 irqreturn_t amdgpu_irq_handler(int irq, void *arg);<br>
 <br>
 int amdgpu_irq_init(struct amdgpu_device *adev);<br>
-void amdgpu_irq_fini(struct amdgpu_device *adev);<br>
+void amdgpu_irq_fini_sw(struct amdgpu_device *adev);<br>
+void amdgpu_irq_fini_hw(struct amdgpu_device *adev);<br>
 int amdgpu_irq_add_id(struct amdgpu_device *adev,<br>
                       unsigned client_id, unsigned src_id,<br>
                       struct amdgpu_irq_src *source);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
index 64beb3399604..1af3fba7bfd4 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
@@ -29,6 +29,7 @@<br>
 #include "amdgpu.h"<br>
 #include <drm/drm_debugfs.h><br>
 #include <drm/amdgpu_drm.h><br>
+#include <drm/drm_drv.h><br>
 #include "amdgpu_uvd.h"<br>
 #include "amdgpu_vce.h"<br>
 #include "atom.h"<br>
@@ -93,7 +94,7 @@ void amdgpu_driver_unload_kms(struct drm_device *dev)<br>
         }<br>
 <br>
         amdgpu_acpi_fini(adev);<br>
-       amdgpu_device_fini(adev);<br>
+       amdgpu_device_fini_hw(adev);<br>
 }<br>
 <br>
 void amdgpu_register_gpu_instance(struct amdgpu_device *adev)<br>
@@ -1151,6 +1152,15 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,<br>
         pm_runtime_put_autosuspend(dev->dev);<br>
 }<br>
 <br>
+<br>
+void amdgpu_driver_release_kms(struct drm_device *dev)<br>
+{<br>
+       struct amdgpu_device *adev = drm_to_adev(dev);<br>
+<br>
+       amdgpu_device_fini_sw(adev);<br>
+       pci_set_drvdata(adev->pdev, NULL);<br>
+}<br>
+<br>
 /*<br>
  * VBlank related functions.<br>
  */<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
index 1fb2a91ad30a..c0a16eac4923 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
@@ -2142,6 +2142,7 @@ int amdgpu_ras_pre_fini(struct amdgpu_device *adev)<br>
         if (!con)<br>
                 return 0;<br>
 <br>
+<br>
         /* Need disable ras on all IPs here before ip [hw/sw]fini */<br>
         amdgpu_ras_disable_all_features(adev, 0);<br>
         amdgpu_ras_recovery_fini(adev);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
index 56acec1075ac..0f195f7bf797 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
@@ -107,7 +107,8 @@ struct amdgpu_fence_driver {<br>
 };<br>
 <br>
 int amdgpu_fence_driver_init(struct amdgpu_device *adev);<br>
-void amdgpu_fence_driver_fini(struct amdgpu_device *adev);<br>
+void amdgpu_fence_driver_fini_hw(struct amdgpu_device *adev);<br>
+void amdgpu_fence_driver_fini_sw(struct amdgpu_device *adev);<br>
 void amdgpu_fence_driver_force_completion(struct amdgpu_ring *ring);<br>
 <br>
 int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c<br>
index d3745711d55f..183d44a6583c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c<br>
@@ -309,7 +309,7 @@ static int cik_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
         amdgpu_irq_remove_domain(adev);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c<br>
index 307c01301c87..d32743949003 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c<br>
@@ -301,7 +301,7 @@ static int cz_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
         amdgpu_irq_remove_domain(adev);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c<br>
index cc957471f31e..da96c6013477 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c<br>
@@ -300,7 +300,7 @@ static int iceland_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
         amdgpu_irq_remove_domain(adev);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c<br>
index f4e4040bbd25..5eea4550b856 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c<br>
@@ -569,7 +569,7 @@ static int navi10_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih_soft);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih2);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih1);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c b/drivers/gpu/drm/amd/amdgpu/si_ih.c<br>
index 51880f6ef634..751307f3252c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/si_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c<br>
@@ -175,7 +175,7 @@ static int si_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
 <br>
         return 0;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c<br>
index 249fcbee7871..973d80ec7f6c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c<br>
@@ -312,7 +312,7 @@ static int tonga_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
         amdgpu_irq_remove_domain(adev);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c<br>
index 88626d83e07b..2d0094c276ca 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c<br>
@@ -523,7 +523,7 @@ static int vega10_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih_soft);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih2);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih1);<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c<br>
index 5a3c867d5881..9059b21b079f 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c<br>
@@ -558,7 +558,7 @@ static int vega20_ih_sw_fini(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       amdgpu_irq_fini(adev);<br>
+       amdgpu_irq_fini_sw(adev);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih_soft);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih2);<br>
         amdgpu_ih_ring_fini(adev, &adev->irq.ih1);<br>
-- <br>
2.25.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Clijo.lazar%40amd.com%7C71f92dcef6d04dfea28308d90a5818c9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637552195764790324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=fzGS6ZXYffGH0DE%2BEM4jxyB8yDGpYO%2FmT%2FKAtgig1Tw%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Clijo.lazar%40amd.com%7C71f92dcef6d04dfea28308d90a5818c9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637552195764790324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=fzGS6ZXYffGH0DE%2BEM4jxyB8yDGpYO%2FmT%2FKAtgig1Tw%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>