All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: use time_is_before_jiffies(a + b) to replace "jiffies - a > b"
@ 2022-07-27  2:59 ` Yu Zhe
  0 siblings, 0 replies; 10+ messages in thread
From: Yu Zhe @ 2022-07-27  2:59 UTC (permalink / raw)
  To: Felix.Kuehling, alexander.deucher, christian.koenig, Xinhui.Pan,
	airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, kernel-janitors, liqiong, Yu Zhe

time_is_before_jiffies deals with timer wrapping correctly.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
index a9466d154395..6397926e059c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
@@ -156,7 +156,7 @@ static void interrupt_wq(struct work_struct *work)
 	while (dequeue_ih_ring_entry(dev, ih_ring_entry)) {
 		dev->device_info.event_interrupt_class->interrupt_wq(dev,
 								ih_ring_entry);
-		if (jiffies - start_jiffies > HZ) {
+		if (time_is_before_jiffies(start_jiffies + HZ)) {
 			/* If we spent more than a second processing signals,
 			 * reschedule the worker to avoid soft-lockup warnings
 			 */
-- 
2.11.0


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

end of thread, other threads:[~2022-07-28 22:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  2:59 [PATCH] drm/amdkfd: use time_is_before_jiffies(a + b) to replace "jiffies - a > b" Yu Zhe
2022-07-27  2:59 ` Yu Zhe
2022-07-27 16:04 ` Felix Kuehling
2022-07-27 16:04   ` Felix Kuehling
2022-07-28  2:20   ` Yu Zhe
2022-07-28  2:20     ` Yu Zhe
2022-07-28  3:30 ` [PATCH v2] " Yu Zhe
2022-07-28  3:30   ` Yu Zhe
2022-07-28 22:05   ` Felix Kuehling
2022-07-28 22:05     ` Felix Kuehling

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.