drm/amdgpu: ratelimited override pte flags messages
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 28 Sep 2023 22:17:21 +0000 (18:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 Oct 2023 22:40:11 +0000 (18:40 -0400)
Use ratelimited version of dev_dbg to avoid flooding dmesg log. No
functional change.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 96d601e..9b025fd 100644 (file)
@@ -843,14 +843,8 @@ static void amdgpu_vm_pte_update_flags(struct amdgpu_vm_update_params *params,
         */
        if ((flags & AMDGPU_PTE_SYSTEM) && (adev->flags & AMD_IS_APU) &&
            adev->gmc.gmc_funcs->override_vm_pte_flags &&
-           num_possible_nodes() > 1) {
-               if (!params->pages_addr)
-                       amdgpu_gmc_override_vm_pte_flags(adev, params->vm,
-                                                        addr, &flags);
-               else
-                       dev_dbg(adev->dev,
-                               "override_vm_pte_flags skipped: non-contiguous\n");
-       }
+           num_possible_nodes() > 1 && !params->pages_addr)
+               amdgpu_gmc_override_vm_pte_flags(adev, params->vm, addr, &flags);
 
        params->vm->update_funcs->update(params, pt, pe, addr, count, incr,
                                         flags);
index 4e823e3..3a10503 100644 (file)
@@ -1247,7 +1247,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
         * the DMA address.
         */
        if (!adev->ram_is_direct_mapped) {
-               dev_dbg(adev->dev, "RAM is not direct mapped\n");
+               dev_dbg_ratelimited(adev->dev, "RAM is not direct mapped\n");
                return;
        }
 
@@ -1256,7 +1256,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
         */
        if ((*flags & AMDGPU_PTE_MTYPE_VG10_MASK) !=
            AMDGPU_PTE_MTYPE_VG10(MTYPE_NC)) {
-               dev_dbg(adev->dev, "MTYPE is not NC\n");
+               dev_dbg_ratelimited(adev->dev, "MTYPE is not NC\n");
                return;
        }
 
@@ -1267,7 +1267,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
        if (adev->gmc.is_app_apu && vm->mem_id >= 0) {
                local_node = adev->gmc.mem_partitions[vm->mem_id].numa.node;
        } else {
-               dev_dbg(adev->dev, "Only native mode APU is supported.\n");
+               dev_dbg_ratelimited(adev->dev, "Only native mode APU is supported.\n");
                return;
        }
 
@@ -1275,12 +1275,12 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
         * page or NUMA nodes.
         */
        if (!page_is_ram(addr >> PAGE_SHIFT)) {
-               dev_dbg(adev->dev, "Page is not RAM.\n");
+               dev_dbg_ratelimited(adev->dev, "Page is not RAM.\n");
                return;
        }
        nid = pfn_to_nid(addr >> PAGE_SHIFT);
-       dev_dbg(adev->dev, "vm->mem_id=%d, local_node=%d, nid=%d\n",
-               vm->mem_id, local_node, nid);
+       dev_dbg_ratelimited(adev->dev, "vm->mem_id=%d, local_node=%d, nid=%d\n",
+                           vm->mem_id, local_node, nid);
        if (nid == local_node) {
                uint64_t old_flags = *flags;
                unsigned int mtype_local = MTYPE_RW;
@@ -1292,8 +1292,8 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 
                *flags = (*flags & ~AMDGPU_PTE_MTYPE_VG10_MASK) |
                         AMDGPU_PTE_MTYPE_VG10(mtype_local);
-               dev_dbg(adev->dev, "flags updated from %llx to %llx\n",
-                       old_flags, *flags);
+               dev_dbg_ratelimited(adev->dev, "flags updated from %llx to %llx\n",
+                                   old_flags, *flags);
        }
 }