Skip to contentSkip to conversation

drm/ttm: use cancel_delayed_work_sync() in ttm_bo

PATCH In review Tejun Heo 2 participants 2 messages Oct 15, 2010

Subsystems (3)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 drm/ttm: use cancel_delayed_work_sync() in ttm_bo

Make ttm_bo::ttm_bo_device_release call cancel_delayed_work_sync() instead of calling cancel_delayed_work() followed by flush_scheduled_work().

This is to prepare for the deprecation and removal of flush_scheduled_work().

---
 drivers/gpu/drm/ttm/ttm_bo.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -2
Index: work/drivers/gpu/drm/ttm/ttm_bo.c
===================================================================
@@ -1480,8 +1480,7 @@ int ttm_bo_device_release(struct ttm_bo_
 	list_del(&bdev->device_list);
 	mutex_unlock(&glob->device_list_mutex);
 
-	if (!cancel_delayed_work(&bdev->wq))
-		flush_scheduled_work();
+	cancel_delayed_work_sync(&bdev->wq);
 
 	while (ttm_bo_delayed_delete(bdev, true))
 		;
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tejun Heo

Make ttm_bo::ttm_bo_device_release call cancel_delayed_work_sync() instead of calling cancel_delayed_work() followed by flush_scheduled_work().

This is to prepare for the deprecation and removal of flush_scheduled_work().

Thanks,
Thomas

Quoted 19 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

Index: work/drivers/gpu/drm/ttm/ttm_bo.c
===================================================================

drivers/gpu/drm/ttm/ttm_bo.c +1 -2
@@ -1480,8 +1480,7 @@ int ttm_bo_device_release(struct ttm_bo_
  	list_del(&bdev->device_list);
  	mutex_unlock(&glob->device_list_mutex);
 
-	if (!cancel_delayed_work(&bdev->wq))
-		flush_scheduled_work();
+	cancel_delayed_work_sync(&bdev->wq);
 
  	while (ttm_bo_delayed_delete(bdev, true))
  		;