Skip to contentSkip to conversation

drm/amdgpu: remove nonsense in_interrupt() checks

PATCH In review Christian König 2 participants 10 messages Oct 25, 2018 – Nov 5, 2018 6 messages not in the archive

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

PATCH 1/4 drm/amdgpu: remove nonsense in_interrupt() checks

might_sleep() is supposed to raise if warning if called in interrupt or atomic context.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +2 -6
index f2f358aa0597..8f50bc245dd6 100644
@@ -162,9 +162,7 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg)
 	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
 		goto failed_kiq_read;
 
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
 	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
 		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
 		r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
@@ -210,9 +208,7 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)
 	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
 		goto failed_kiq_write;
 
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
 	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
 
 		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181025091500.54226-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/4 drm/amdgpu: cleanup GMC v9 TLB invalidation

Move the kiq handling into amdgpu_virt.c and drop the fallback.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 40 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c    | 53 ++++----------------------------
 3 files changed, 49 insertions(+), 47 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +40 -0
index 8f50bc245dd6..17524d799a30 100644
@@ -224,6 +224,46 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)
 	pr_err("failed to write reg:%x\n", reg);
 }
 
+void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
+					uint32_t reg0, uint32_t reg1,
+					uint32_t ref, uint32_t mask)
+{
+	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
+	struct amdgpu_ring *ring = &kiq->ring;
+	signed long r, cnt = 0;
+	unsigned long flags;
+	uint32_t seq;
+
+	spin_lock_irqsave(&kiq->ring_lock, flags);
+	amdgpu_ring_alloc(ring, 32);
+	amdgpu_ring_emit_reg_write_reg_wait(ring, reg0, reg1,
+					    ref, mask);
+	amdgpu_fence_emit_polling(ring, &seq);
+	amdgpu_ring_commit(ring);
+	spin_unlock_irqrestore(&kiq->ring_lock, flags);
+
+	r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
+
+	/* don't wait anymore for IRQ context */
+	if (r < 1 && in_interrupt())
+		goto failed_kiq;
+
+	might_sleep();
+	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
+
+		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
+		r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
+	}
+
+	if (cnt > MAX_KIQ_REG_TRY)
+		goto failed_kiq;
+
+	return;
+
+failed_kiq:
+	pr_err("failed to write reg %x wait reg %x\n", reg0, reg1);
+}
+
 /**
  * amdgpu_virt_request_full_gpu() - request full gpu access
  * @amdgpu:	amdgpu device.
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +3 -0
index 880ac113a3a9..bcae2341c725 100644
@@ -288,6 +288,9 @@ void amdgpu_free_static_csa(struct amdgpu_device *adev);
 void amdgpu_virt_init_setting(struct amdgpu_device *adev);
 uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg);
 void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v);
+void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
+					uint32_t reg0, uint32_t rreg1,
+					uint32_t ref, uint32_t mask);
 int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init);
 int amdgpu_virt_release_full_gpu(struct amdgpu_device *adev, bool init);
 int amdgpu_virt_reset_gpu(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -47

71 lines not on this page · raw message

Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181025091500.54226-2-christian.koenig-5C7GfCeVMHo@public.gmane.org

#4 lore raw

RE: [PATCH 2/4] drm/amdgpu: cleanup GMC v9 TLB invalidation

Add Wentao.

Best wishes
Emily Deng

Quoted 172 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 2/4] drm/amdgpu: cleanup GMC v9 TLB invalidation

Move the kiq handling into amdgpu_virt.c and drop the fallback.

---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 40 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 3 ++
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 53 ++++---------------------------
-

3 files changed, 49 insertions(+), 47 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +39 -0
index 8f50bc245dd6..17524d799a30 100644
@@ -224,6 +224,46 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device
 *adev, uint32_t reg, uint32_t v)
 	pr_err("failed to write reg:%x\n", reg);  }
 
+void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
+					uint32_t reg0, uint32_t reg1,
+					uint32_t ref, uint32_t mask)
+{
+	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
+	struct amdgpu_ring *ring = &kiq->ring;
+	signed long r, cnt = 0;
+	unsigned long flags;
+	uint32_t seq;
+
+	spin_lock_irqsave(&kiq->ring_lock, flags);
+	amdgpu_ring_alloc(ring, 32);
+	amdgpu_ring_emit_reg_write_reg_wait(ring, reg0, reg1,
+					    ref, mask);
+	amdgpu_fence_emit_polling(ring, &seq);
+	amdgpu_ring_commit(ring);
+	spin_unlock_irqrestore(&kiq->ring_lock, flags);
+
+	r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
+
+	/* don't wait anymore for IRQ context */
+	if (r < 1 && in_interrupt())
+		goto failed_kiq;
+
+	might_sleep();
+	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
+
+		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
+		r = amdgpu_fence_wait_polling(ring, seq,
 MAX_KIQ_REG_WAIT);
+	}
+
+	if (cnt > MAX_KIQ_REG_TRY)
+		goto failed_kiq;
+
+	return;
+
+failed_kiq:
+	pr_err("failed to write reg %x wait reg %x\n", reg0, reg1); }
+
 /**
 * amdgpu_virt_request_full_gpu() - request full gpu access
 * @amdgpu:	amdgpu device.
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +3 -0
index 880ac113a3a9..bcae2341c725 100644
@@ -288,6 +288,9 @@ void amdgpu_free_static_csa(struct amdgpu_device
 *adev);  void amdgpu_virt_init_setting(struct amdgpu_device *adev);
 uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg);
 void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg,
 uint32_t v);
+void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
+					uint32_t reg0, uint32_t rreg1,
+					uint32_t ref, uint32_t mask);
 int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init);

int amdgpu_virt_release_full_gpu(struct amdgpu_device *adev, bool init); int amdgpu_virt_reset_gpu(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index af786b5513bc..7dee74f1937c 100644

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -42
@@ -312,48 +312,6 @@ static uint32_t
 gmc_v9_0_get_invalidate_req(unsigned int vmid,
 	return req;
 }
 
-static signed long  amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device
 *adev,
-						  uint32_t reg0, uint32_t reg1,
-						  uint32_t ref, uint32_t mask)
-{
-	signed long r, cnt = 0;
-	unsigned long flags;
-	uint32_t seq;
-	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
-	struct amdgpu_ring *ring = &kiq->ring;
-
-	spin_lock_irqsave(&kiq->ring_lock, flags);
-
-	amdgpu_ring_alloc(ring, 32);
-	amdgpu_ring_emit_reg_write_reg_wait(ring, reg0, reg1,
-					    ref, mask);
-	amdgpu_fence_emit_polling(ring, &seq);
-	amdgpu_ring_commit(ring);
-	spin_unlock_irqrestore(&kiq->ring_lock, flags);
-
-	r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
-
-	/* don't wait anymore for IRQ context */
-	if (r < 1 && in_interrupt())
-		goto failed_kiq;
-
-	might_sleep();
-
-	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
-		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
-		r = amdgpu_fence_wait_polling(ring, seq,
 MAX_KIQ_REG_WAIT);
-	}
-
-	if (cnt > MAX_KIQ_REG_TRY)
-		goto failed_kiq;
-
-	return 0;
-
-failed_kiq:
-	pr_err("failed to invalidate tlb with kiq\n");
-	return r;
-}
-

/*
* GART
* VMID 0 is the physical GPU addresses as used by the kernel.

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
@@ -375,7 +333,6 @@ static void gmc_v9_0_flush_gpu_tlb(struct
 amdgpu_device *adev,  {
 	const unsigned eng = 17;
 	unsigned i, j;
-	int r;
 
 	for (i = 0; i < AMDGPU_MAX_VMHUBS; ++i) {
 		struct amdgpu_vmhub *hub = &adev->vmhub[i]; @@ -384,10
+341,12 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device

*adev,

		if (adev->gfx.kiq.ring.ready &&
		    (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))
&&
		    !adev->in_gpu_reset) {
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
-			r = amdgpu_kiq_reg_write_reg_wait(adev, hub-
Quoted 1 line

vm_inv_eng0_req + eng,

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -3
-				hub->vm_inv_eng0_ack + eng, tmp, 1 << vmid);
-			if (!r)
-				continue;
+			uint32_t req = hub->vm_inv_eng0_req + eng;
+			uint32_t ack = hub->vm_inv_eng0_ack + eng;
+
+			amdgpu_virt_kiq_reg_write_reg_wait(adev, req, ack,

tmp,

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -0
+							   1 << vmid);
+			continue;
		}

		spin_lock(&adev->gmc.invalidate_lock);
Quoted 7 lines

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw

PATCH 3/4 drm/amdgpu: drop the busy wait for GMC v9 TLB invalidations

In reply to a message not in the archive

This code is not performance critical.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -22
index 7dee74f1937c..ff5e5f69b403 100644
@@ -350,35 +350,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,
 		}
 
 		spin_lock(&adev->gmc.invalidate_lock);
-
 		WREG32_NO_KIQ(hub->vm_inv_eng0_req + eng, tmp);
-
-		/* Busy wait for ACK.*/
-		for (j = 0; j < 100; j++) {
-			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
-			tmp &= 1 << vmid;
-			if (tmp)
-				break;
-			cpu_relax();
-		}
-		if (j < 100) {
-			spin_unlock(&adev->gmc.invalidate_lock);
-			continue;
-		}
-
-		/* Wait for ACK with a delay.*/
 		for (j = 0; j < adev->usec_timeout; j++) {
 			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
-			tmp &= 1 << vmid;
-			if (tmp)
+			if (tmp & (1 << vmid))
 				break;
 			udelay(1);
 		}
-		if (j < adev->usec_timeout) {
-			spin_unlock(&adev->gmc.invalidate_lock);
-			continue;
-		}
 		spin_unlock(&adev->gmc.invalidate_lock);
+		if (j < adev->usec_timeout)
+			continue;
+
 		DRM_ERROR("Timeout waiting for VM flush ACK!\n");
 	}
 }
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181025091500.54226-3-christian.koenig-5C7GfCeVMHo@public.gmane.org

#7 lore raw

RE: [PATCH 3/4] drm/amdgpu: drop the busy wait for GMC v9 TLB invalidations

Add Wentao.

Best wishes
Emily Deng

Quoted 63 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 3/4] drm/amdgpu: drop the busy wait for GMC v9 TLB invalidations

This code is not performance critical.

---
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 26 ++++----------------------

1 file changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -22
index 7dee74f1937c..ff5e5f69b403 100644
@@ -350,35 +350,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct
 amdgpu_device *adev,
 		}
 
 		spin_lock(&adev->gmc.invalidate_lock);
-
 		WREG32_NO_KIQ(hub->vm_inv_eng0_req + eng, tmp);
-
-		/* Busy wait for ACK.*/
-		for (j = 0; j < 100; j++) {
-			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack +
 eng);
-			tmp &= 1 << vmid;
-			if (tmp)
-				break;
-			cpu_relax();
-		}
-		if (j < 100) {
-			spin_unlock(&adev->gmc.invalidate_lock);
-			continue;
-		}
-
-		/* Wait for ACK with a delay.*/
 		for (j = 0; j < adev->usec_timeout; j++) {
 			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack +
 eng);
-			tmp &= 1 << vmid;
-			if (tmp)
+			if (tmp & (1 << vmid))
 				break;
 			udelay(1);
 		}
-		if (j < adev->usec_timeout) {
-			spin_unlock(&adev->gmc.invalidate_lock);
-			continue;
-		}
 		spin_unlock(&adev->gmc.invalidate_lock);
+		if (j < adev->usec_timeout)
+			continue;
+
		DRM_ERROR("Timeout waiting for VM flush ACK!\n");
	}
}
Quoted 7 lines

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw

PATCH 4/4 drm/amdgpu: use GMC v9 KIQ workaround only for the GFXHUB

In reply to a message not in the archive

The MMHUB is not affected by this.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -3
index ff5e5f69b403..9ea73fb36572 100644
@@ -338,9 +338,9 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,
 		struct amdgpu_vmhub *hub = &adev->vmhub[i];
 		u32 tmp = gmc_v9_0_get_invalidate_req(vmid, flush_type);
 
-		if (adev->gfx.kiq.ring.ready &&
-		    (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev)) &&
-		    !adev->in_gpu_reset) {
+		if (i == AMDGPU_GFXHUB && !adev->in_gpu_reset &&
+		    adev->gfx.kiq.ring.ready &&
+		    (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))) {
 			uint32_t req = hub->vm_inv_eng0_req + eng;
 			uint32_t ack = hub->vm_inv_eng0_ack + eng;
 
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181025091500.54226-4-christian.koenig-5C7GfCeVMHo@public.gmane.org

#10 lore raw

RE: [PATCH 4/4] drm/amdgpu: use GMC v9 KIQ workaround only for the GFXHUB

Add Wentao.

Best wishes
Emily Deng

Quoted 36 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 4/4] drm/amdgpu: use GMC v9 KIQ workaround only for the GFXHUB

The MMHUB is not affected by this.

---
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -2
index ff5e5f69b403..9ea73fb36572 100644
@@ -338,9 +338,9 @@ static void gmc_v9_0_flush_gpu_tlb(struct
 amdgpu_device *adev,
 		struct amdgpu_vmhub *hub = &adev->vmhub[i];
 		u32 tmp = gmc_v9_0_get_invalidate_req(vmid, flush_type);
 
-		if (adev->gfx.kiq.ring.ready &&
-		    (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))

&&

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -1
-		    !adev->in_gpu_reset) {
+		if (i == AMDGPU_GFXHUB && !adev->in_gpu_reset &&
+		    adev->gfx.kiq.ring.ready &&
+		    (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev)))
{
			uint32_t req = hub->vm_inv_eng0_req + eng;
			uint32_t ack = hub->vm_inv_eng0_ack + eng;
Quoted 7 lines

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#11 lore raw
In reply to a message not in the archive

Add Wentao.

Best wishes
Emily Deng

Quoted 44 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 1/4] drm/amdgpu: remove nonsense in_interrupt() checks

might_sleep() is supposed to raise if warning if called in interrupt or atomic context.

---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 ++------

1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
index f2f358aa0597..8f50bc245dd6 100644
@@ -162,9 +162,7 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device
 *adev, uint32_t reg)
 	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
 		goto failed_kiq_read;
 
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
 	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
 		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);

r = amdgpu_fence_wait_polling(ring, seq,
MAX_KIQ_REG_WAIT); @@ -210,9 +208,7 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)

	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
		goto failed_kiq_write;
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {

		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
Quoted 7 lines

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN7PR12MB26447299AB84EF2061511A228FF70-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#13 lore raw

Just a gentle ping.

Emily can I get an rb for this or at least a tested-by?

Thanks,
Christian.

Am 25.10.18 um 11:39 schrieb Deng, Emily:

Quoted 50 lines

Add Wentao.

Best wishes
Emily Deng

Quoted 43 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 1/4] drm/amdgpu: remove nonsense in_interrupt() checks

might_sleep() is supposed to raise if warning if called in interrupt or atomic context.

---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 ++------

1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
index f2f358aa0597..8f50bc245dd6 100644
@@ -162,9 +162,7 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device
 *adev, uint32_t reg)
 	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
 		goto failed_kiq_read;
 
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
 	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
 		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);

r = amdgpu_fence_wait_polling(ring, seq,
MAX_KIQ_REG_WAIT); @@ -210,9 +208,7 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)

	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
		goto failed_kiq_write;
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
Quoted 8 lines
Quoted 8 lines
		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 322d0175-6590-beea-9ba2-8dee89c48af2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#15 lore raw

The series are Reviewed-by: Emily Deng <[email protected]>

Best wishes
Emily Deng

Quoted 68 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, October 30, 2018 10:39 PM
To: Deng, Emily <[email protected]>; [email protected]; Lou, Wentao <[email protected]>
Subject: Re: [PATCH 1/4] drm/amdgpu: remove nonsense in_interrupt() checks

Just a gentle ping.

Emily can I get an rb for this or at least a tested-by?

Thanks,
Christian.

Am 25.10.18 um 11:39 schrieb Deng, Emily:

Quoted 33 lines

Add Wentao.

Best wishes
Emily Deng

Quoted 26 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Thursday, October 25, 2018 5:15 PM
To: [email protected]
Subject: [PATCH 1/4] drm/amdgpu: remove nonsense in_interrupt() checks

might_sleep() is supposed to raise if warning if called in interrupt or atomic context.

---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 ++------

1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0 -0
index f2f358aa0597..8f50bc245dd6 100644
@@ -162,9 +162,7 @@ uint32_t amdgpu_virt_kiq_rreg(struct
 amdgpu_device *adev, uint32_t reg)
 	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
 		goto failed_kiq_read;
 
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
 	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
 		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);

r = amdgpu_fence_wait_polling(ring, seq,

MAX_KIQ_REG_WAIT); @@

Quoted 11 lines
Quoted 11 lines

-210,9 +208,7 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)

	if (r < 1 && (adev->in_gpu_reset || in_interrupt()))
		goto failed_kiq_write;
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -3
-	if (in_interrupt())
-		might_sleep();
-
+	might_sleep();
	while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
		msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);

--
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx