All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: AMD Graphics <amd-gfx@lists.freedesktop.org>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>,
	Luben Tuikov <luben.tuikov@amd.com>,
	James Zhu <James.Zhu@amd.com>
Subject: [PATCH] drm/amdgpu: Fix minmax error
Date: Sat, 26 Nov 2022 00:25:05 -0500	[thread overview]
Message-ID: <20221126052505.61384-1-luben.tuikov@amd.com> (raw)

Fix minmax compilation error by using the correct constant and correct integer
suffix.

Cc: James Zhu <James.Zhu@amd.com>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Fixes: 58170a7a002ad6 ("drm/amdgpu: fix stall on CPU when allocate large system memory")
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
index 8a2e5716d8dba2..65715cb395d838 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
@@ -51,7 +51,7 @@
 #include "amdgpu_amdkfd.h"
 #include "amdgpu_hmm.h"
 
-#define MAX_WALK_BYTE	(64ULL<<30)
+#define MAX_WALK_BYTE	(2UL << 30)
 
 /**
  * amdgpu_hmm_invalidate_gfx - callback to notify about mm change
@@ -197,8 +197,8 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
 			hmm_range->start, hmm_range->end);
 
 		/* Assuming 512MB takes maxmium 1 second to fault page address */
-		timeout = max((hmm_range->end - hmm_range->start) >> 29, 1ULL) *
-			HMM_RANGE_DEFAULT_TIMEOUT;
+		timeout = max((hmm_range->end - hmm_range->start) >> 29, 1UL);
+		timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
 		timeout = jiffies + msecs_to_jiffies(timeout);
 
 retry:

base-commit: 9e95ce4c60631c1339204f8723008a715391f410
-- 
2.39.0.rc0


             reply	other threads:[~2022-11-26  5:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26  5:25 Luben Tuikov [this message]
2022-11-26 14:00 ` [PATCH] drm/amdgpu: Fix minmax error Christian König
  -- strict thread matches above, loose matches on Subject: below --
2022-11-24 21:19 Luben Tuikov
2022-11-24 22:04 ` James Zhu
2022-11-25  7:45 ` Christian König
2022-11-25  7:56   ` Luben Tuikov
2022-11-25  7:59     ` Christian König
2022-11-25  8:33       ` Luben Tuikov
2022-11-25  9:57         ` Christian König
2022-11-25 19:42           ` Luben Tuikov
2022-11-25 21:03             ` James Zhu
2022-11-26  3:19               ` Luben Tuikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221126052505.61384-1-luben.tuikov@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=James.Zhu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.