Skip to contentSkip to conversation

drm/amdgpu: Handle fault with same timestamp

PATCH In review Philip Yang 4 participants 5 messages Dec 8, 2021 – Dec 9, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Handle fault with same timestamp

Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips,

Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 -2
index 8050f7ba93ad..3df146579ad9 100644
@@ -188,8 +188,8 @@ int amdgpu_ih_wait_on_checkpoint_process_ts(struct amdgpu_device *adev,
 	checkpoint_ts = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
 
 	return wait_event_interruptible_timeout(ih->wait_process,
-		    !amdgpu_ih_ts_after(ih->processed_timestamp, checkpoint_ts),
-		    timeout);
+		    amdgpu_ih_ts_after(checkpoint_ts, ih->processed_timestamp) ||
+		    ih->rptr == amdgpu_ih_get_wptr(adev, ih), timeout);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -3
index e031f0cf93a2..571b11117992 100644
@@ -522,9 +522,6 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
 	if (!handled)
 		amdgpu_amdkfd_interrupt(adev, entry.iv_entry);
 
-	dev_WARN_ONCE(adev->dev, ih->processed_timestamp == entry.timestamp,
-		      "IH timestamps are not unique");
-
 	if (amdgpu_ih_ts_after(ih->processed_timestamp, entry.timestamp))
 		ih->processed_timestamp = entry.timestamp;
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Am 2021-12-08 um 3:16 p.m. schrieb Philip Yang:

Quoted 8 lines

Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips,

Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled.

Quoted 34 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 -2
index 8050f7ba93ad..3df146579ad9 100644
@@ -188,8 +188,8 @@ int amdgpu_ih_wait_on_checkpoint_process_ts(struct amdgpu_device *adev,
 	checkpoint_ts = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
 
 	return wait_event_interruptible_timeout(ih->wait_process,
-		    !amdgpu_ih_ts_after(ih->processed_timestamp, checkpoint_ts),
-		    timeout);
+		    amdgpu_ih_ts_after(checkpoint_ts, ih->processed_timestamp) ||
+		    ih->rptr == amdgpu_ih_get_wptr(adev, ih), timeout);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -3
index e031f0cf93a2..571b11117992 100644
@@ -522,9 +522,6 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
 	if (!handled)
 		amdgpu_amdkfd_interrupt(adev, entry.iv_entry);
 
-	dev_WARN_ONCE(adev->dev, ih->processed_timestamp == entry.timestamp,
-		      "IH timestamps are not unique");
-
 	if (amdgpu_ih_ts_after(ih->processed_timestamp, entry.timestamp))
 		ih->processed_timestamp = entry.timestamp;
 }
#2 lore raw
In reply to Philip Yang
Quoted 9 lines · Philip Yang

Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips,

Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled.

Maybe add the link to the bug when you push this?

Alex

Quoted 37 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 -2
index 8050f7ba93ad..3df146579ad9 100644
@@ -188,8 +188,8 @@ int amdgpu_ih_wait_on_checkpoint_process_ts(struct amdgpu_device *adev,
        checkpoint_ts = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
 
        return wait_event_interruptible_timeout(ih->wait_process,
-                   !amdgpu_ih_ts_after(ih->processed_timestamp, checkpoint_ts),
-                   timeout);
+                   amdgpu_ih_ts_after(checkpoint_ts, ih->processed_timestamp) ||
+                   ih->rptr == amdgpu_ih_get_wptr(adev, ih), timeout);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -4
index e031f0cf93a2..571b11117992 100644
@@ -522,9 +522,6 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
        if (!handled)
                amdgpu_amdkfd_interrupt(adev, entry.iv_entry);
 
-       dev_WARN_ONCE(adev->dev, ih->processed_timestamp == entry.timestamp,
-                     "IH timestamps are not unique");
-
        if (amdgpu_ih_ts_after(ih->processed_timestamp, entry.timestamp))
                ih->processed_timestamp = entry.timestamp;
 }
--

2.17.1

#3 lore raw
Quoted 6 lines · Alex Deucher
Quoted 4 lines · Philip Yang

Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips,

Quoted 7 lines
Quoted 5 lines

Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled.

Maybe add the link to the bug when you push this?

Alex

Quoted 40 lines

Alex

Quoted 37 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 -2
index 8050f7ba93ad..3df146579ad9 100644
@@ -188,8 +188,8 @@ int amdgpu_ih_wait_on_checkpoint_process_ts(struct amdgpu_device *adev,
        checkpoint_ts = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
 
        return wait_event_interruptible_timeout(ih->wait_process,
-                   !amdgpu_ih_ts_after(ih->processed_timestamp, checkpoint_ts),
-                   timeout);
+                   amdgpu_ih_ts_after(checkpoint_ts, ih->processed_timestamp) ||
+                   ih->rptr == amdgpu_ih_get_wptr(adev, ih), timeout);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -4
index e031f0cf93a2..571b11117992 100644
@@ -522,9 +522,6 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
        if (!handled)
                amdgpu_amdkfd_interrupt(adev, entry.iv_entry);
 
-       dev_WARN_ONCE(adev->dev, ih->processed_timestamp == entry.timestamp,
-                     "IH timestamps are not unique");
-
        if (amdgpu_ih_ts_after(ih->processed_timestamp, entry.timestamp))
                ih->processed_timestamp = entry.timestamp;
 }
--

2.17.1

#4 lore raw

Am 08.12.21 um 21:27 schrieb Alex Deucher:

Quoted 5 lines · Alex Deucher
Quoted 4 lines · Philip Yang
Quoted 3 lines

Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled.

Maybe add the link to the bug when you push this?

With that done Reviewed-by: Christian König <[email protected]>

Quoted 42 lines

Alex

Quoted 39 lines

Alex

Quoted 37 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c  | 4 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 ---
  2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 -2
index 8050f7ba93ad..3df146579ad9 100644
@@ -188,8 +188,8 @@ int amdgpu_ih_wait_on_checkpoint_process_ts(struct amdgpu_device *adev,
         checkpoint_ts = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
 
         return wait_event_interruptible_timeout(ih->wait_process,
-                   !amdgpu_ih_ts_after(ih->processed_timestamp, checkpoint_ts),
-                   timeout);
+                   amdgpu_ih_ts_after(checkpoint_ts, ih->processed_timestamp) ||
+                   ih->rptr == amdgpu_ih_get_wptr(adev, ih), timeout);
  }
 
  /**
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0 -4
index e031f0cf93a2..571b11117992 100644
@@ -522,9 +522,6 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
         if (!handled)
                 amdgpu_amdkfd_interrupt(adev, entry.iv_entry);
 
-       dev_WARN_ONCE(adev->dev, ih->processed_timestamp == entry.timestamp,
-                     "IH timestamps are not unique");
-
         if (amdgpu_ih_ts_after(ih->processed_timestamp, entry.timestamp))
                 ih->processed_timestamp = entry.timestamp;
  }
--

2.17.1