Skip to contentSkip to conversation

drm/amdgpu: cancel reset work on fini

PATCH In review Alex Deucher 2 participants 6 messages Oct 21, 2016 – Oct 22, 2016 3 messages not in the archive

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

PATCH 1/1 drm/amdgpu: cancel reset work on fini

Cancel any pending reset work when we tear down the driver.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +2 -0
index 278708f..9fa8098 100644
@@ -239,6 +239,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 	if (r) {
 		adev->irq.installed = false;
 		flush_work(&adev->hotplug_work);
+		cancel_work_sync(&adev->reset_work);
 		return r;
 	}
 
@@ -264,6 +265,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
 		if (adev->irq.msi_enabled)
 			pci_disable_msi(adev->pdev);
 		flush_work(&adev->hotplug_work);
+		cancel_work_sync(&adev->reset_work);
 	}
 
 	for (i = 0; i < AMDGPU_MAX_IRQ_SRC_ID; ++i) {
Signature · 6 lines
2.5.5

_______________________________________________
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): 1477082714-15229-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/1 drm/amdgpu/dpm: flush any thermal work on fini

Flush any outstanding thermal work before tearing down the dpm driver.

---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 ++
 3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +2 -0
index 6ecfc48..b090895 100644
@@ -6294,6 +6294,8 @@ static int ci_dpm_sw_fini(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
 	mutex_lock(&adev->pm.mutex);
 	amdgpu_pm_sysfs_fini(adev);
 	ci_dpm_fini(adev);
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2 -0
index 42e5c94..190bce8 100644
@@ -3063,6 +3063,8 @@ static int kv_dpm_sw_fini(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
 	mutex_lock(&adev->pm.mutex);
 	amdgpu_pm_sysfs_fini(adev);
 	kv_dpm_fini(adev);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +2 -0
index 9172133..21ed3db 100644
@@ -7779,6 +7779,8 @@ static int si_dpm_sw_fini(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
 	mutex_lock(&adev->pm.mutex);
 	amdgpu_pm_sysfs_fini(adev);
 	si_dpm_fini(adev);
Signature · 6 lines
2.5.5

_______________________________________________
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): 1477082714-15229-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH] drm/amdgpu/dpm: flush any thermal work on fini

Am 21.10.2016 um 22:45 schrieb Alex Deucher:

Quoted 4 lines

Flush any outstanding thermal work before tearing down the dpm driver.

Quoted 37 lines
---
  drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 ++
  drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 ++
  drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 ++
  3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +2 -0
index 6ecfc48..b090895 100644
@@ -6294,6 +6294,8 @@ static int ci_dpm_sw_fini(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
  	mutex_lock(&adev->pm.mutex);
  	amdgpu_pm_sysfs_fini(adev);
  	ci_dpm_fini(adev);
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2 -0
index 42e5c94..190bce8 100644
@@ -3063,6 +3063,8 @@ static int kv_dpm_sw_fini(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
  	mutex_lock(&adev->pm.mutex);
  	amdgpu_pm_sysfs_fini(adev);
  	kv_dpm_fini(adev);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0 -0
index 9172133..21ed3db 100644

drivers/gpu/drm/amd/amdgpu/si_dpm.c static int si_dpm_sw_fini(void *handle) · line 7786

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +2 -0
@@ -7779,6 +7779,8 @@ static int si_dpm_sw_fini(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	flush_work(&adev->pm.dpm.thermal.work);
+
  	mutex_lock(&adev->pm.mutex);
  	amdgpu_pm_sysfs_fini(adev);
  	si_dpm_fini(adev);

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

#5 lore raw

PATCH 1/1 drm/amdgpu: s/amdgpuCrtc/amdgpu_crtc/ in pageflip code

In reply to a message not in the archive

Fix random CamelCase that has annoyed me for a while.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -6
index 083e2b4..c7bc2b3 100644
@@ -68,9 +68,9 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
 	struct amdgpu_flip_work *work =
 		container_of(delayed_work, struct amdgpu_flip_work, flip_work);
 	struct amdgpu_device *adev = work->adev;
-	struct amdgpu_crtc *amdgpuCrtc = adev->mode_info.crtcs[work->crtc_id];
+	struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[work->crtc_id];
 
-	struct drm_crtc *crtc = &amdgpuCrtc->base;
+	struct drm_crtc *crtc = &amdgpu_crtc->base;
 	unsigned long flags;
 	unsigned i;
 	int vpos, hpos;
@@ -85,14 +85,14 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
 	/* Wait until we're out of the vertical blank period before the one
 	 * targeted by the flip
 	 */
-	if (amdgpuCrtc->enabled &&
+	if (amdgpu_crtc->enabled &&
 	    (amdgpu_get_crtc_scanoutpos(adev->ddev, work->crtc_id, 0,
 					&vpos, &hpos, NULL, NULL,
 					&crtc->hwmode)
 	     & (DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK)) ==
 	    (DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK) &&
 	    (int)(work->target_vblank -
-		  amdgpu_get_vblank_counter_kms(adev->ddev, amdgpuCrtc->crtc_id)) > 0) {
+		  amdgpu_get_vblank_counter_kms(adev->ddev, amdgpu_crtc->crtc_id)) > 0) {
 		schedule_delayed_work(&work->flip_work, usecs_to_jiffies(1000));
 		return;
 	}
@@ -104,12 +104,12 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
 	adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base, work->async);
 
 	/* Set the flip status */
-	amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
+	amdgpu_crtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
 	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 
 
 	DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_SUBMITTED, work: %p,\n",
-					 amdgpuCrtc->crtc_id, amdgpuCrtc, work);
+					 amdgpu_crtc->crtc_id, amdgpu_crtc, work);
 
 }
 
Signature · 6 lines
2.5.5

_______________________________________________
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): 1477082714-15229-3-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#7 lore raw

Re: [PATCH] drm/amdgpu: s/amdgpuCrtc/amdgpu_crtc/ in pageflip code

Am 21.10.2016 um 22:45 schrieb Alex Deucher:

Quoted 3 lines

Fix random CamelCase that has annoyed me for a while.

Quoted 42 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +4 -5
index 083e2b4..c7bc2b3 100644
@@ -68,9 +68,9 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
  	struct amdgpu_flip_work *work =
  		container_of(delayed_work, struct amdgpu_flip_work, flip_work);
  	struct amdgpu_device *adev = work->adev;
-	struct amdgpu_crtc *amdgpuCrtc = adev->mode_info.crtcs[work->crtc_id];
+	struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[work->crtc_id];
 
-	struct drm_crtc *crtc = &amdgpuCrtc->base;
+	struct drm_crtc *crtc = &amdgpu_crtc->base;
  	unsigned long flags;
  	unsigned i;
  	int vpos, hpos;
@@ -85,14 +85,14 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
  	/* Wait until we're out of the vertical blank period before the one
  	 * targeted by the flip
  	 */
-	if (amdgpuCrtc->enabled &&
+	if (amdgpu_crtc->enabled &&
  	    (amdgpu_get_crtc_scanoutpos(adev->ddev, work->crtc_id, 0,
  					&vpos, &hpos, NULL, NULL,
  					&crtc->hwmode)
  	     & (DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK)) ==
  	    (DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK) &&
  	    (int)(work->target_vblank -
-		  amdgpu_get_vblank_counter_kms(adev->ddev, amdgpuCrtc->crtc_id)) > 0) {
+		  amdgpu_get_vblank_counter_kms(adev->ddev, amdgpu_crtc->crtc_id)) > 0) {
  		schedule_delayed_work(&work->flip_work, usecs_to_jiffies(1000));
  		return;
  	}
@@ -104,12 +104,12 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
  	adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base, work->async);
 
  	/* Set the flip status */
-	amdgpuCrtc->pflip_status = AMDGPU_FLIP_SUBMITTED;

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c static void amdgpu_flip_work_func(struct work_struct *__work) · line 115

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -1
+	amdgpu_crtc->pflip_status = AMDGPU_FLIP_SUBMITTED;
  	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 
 
  	DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_SUBMITTED, work: %p,\n",
-					 amdgpuCrtc->crtc_id, amdgpuCrtc, work);
+					 amdgpu_crtc->crtc_id, amdgpu_crtc, work);
 
  }
 

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

Reviewed-by
#8 lore raw
In reply to a message not in the archive

Am 21.10.2016 um 22:45 schrieb Alex Deucher:

Quoted 3 lines

Cancel any pending reset work when we tear down the driver.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +1 -0
index 278708f..9fa8098 100644
@@ -239,6 +239,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
  	if (r) {
  		adev->irq.installed = false;
  		flush_work(&adev->hotplug_work);
+		cancel_work_sync(&adev->reset_work);
  		return r;
  	}
 

drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c void amdgpu_irq_fini(struct amdgpu_device *adev) · line 271

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +1 -0
@@ -264,6 +265,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
  		if (adev->irq.msi_enabled)
  			pci_disable_msi(adev->pdev);
  		flush_work(&adev->hotplug_work);
+		cancel_work_sync(&adev->reset_work);
  	}
 
  	for (i = 0; i < AMDGPU_MAX_IRQ_SRC_ID; ++i) {

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