[2/7] drm/qxl: fix incorrect use of the lru_lock

Submitted by Christian König on Aug. 7, 2017, 3:48 p.m.

Details

Message ID 1502120903-24080-2-git-send-email-deathsimple@vodafone.de
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Christian König Aug. 7, 2017, 3:48 p.m.
From: Christian König <christian.koenig@amd.com>

The BO manager has its own lock and doesn't use the lru_lock.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/qxl/qxl_ttm.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 0fdedee..07dc08d 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -454,15 +454,10 @@  void qxl_ttm_fini(struct qxl_device *qdev)
 static int qxl_mm_dump_table(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = (struct drm_info_node *)m->private;
-	struct drm_mm *mm = (struct drm_mm *)node->info_ent->data;
-	struct drm_device *dev = node->minor->dev;
-	struct qxl_device *rdev = dev->dev_private;
-	struct ttm_bo_global *glob = rdev->mman.bdev.glob;
+	struct ttm_mem_type_manager *man = node->info_ent->data;
 	struct drm_printer p = drm_seq_file_printer(m);
 
-	spin_lock(&glob->lru_lock);
-	drm_mm_print(mm, &p);
-	spin_unlock(&glob->lru_lock);
+	man->func->debug(man, &p);
 	return 0;
 }
 #endif
@@ -483,9 +478,9 @@  int qxl_ttm_debugfs_init(struct qxl_device *qdev)
 		qxl_mem_types_list[i].show = &qxl_mm_dump_table;
 		qxl_mem_types_list[i].driver_features = 0;
 		if (i == 0)
-			qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
+			qxl_mem_types_list[i].data = &qdev->mman.bdev.man[TTM_PL_VRAM];
 		else
-			qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV].priv;
+			qxl_mem_types_list[i].data = &qdev->mman.bdev.man[TTM_PL_PRIV];
 
 	}
 	return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);

Comments

Hi guys,

can I get an rb or at least an Acked-by for that one?

The code was obviously copied over from radeon where it wasn't correct 
in the first place.

Thanks,
Christian.

Am 07.08.2017 um 17:48 schrieb Christian König:
> From: Christian König <christian.koenig@amd.com>
>
> The BO manager has its own lock and doesn't use the lru_lock.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/qxl/qxl_ttm.c | 13 ++++---------
>   1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index 0fdedee..07dc08d 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -454,15 +454,10 @@ void qxl_ttm_fini(struct qxl_device *qdev)
>   static int qxl_mm_dump_table(struct seq_file *m, void *data)
>   {
>   	struct drm_info_node *node = (struct drm_info_node *)m->private;
> -	struct drm_mm *mm = (struct drm_mm *)node->info_ent->data;
> -	struct drm_device *dev = node->minor->dev;
> -	struct qxl_device *rdev = dev->dev_private;
> -	struct ttm_bo_global *glob = rdev->mman.bdev.glob;
> +	struct ttm_mem_type_manager *man = node->info_ent->data;
>   	struct drm_printer p = drm_seq_file_printer(m);
>   
> -	spin_lock(&glob->lru_lock);
> -	drm_mm_print(mm, &p);
> -	spin_unlock(&glob->lru_lock);
> +	man->func->debug(man, &p);
>   	return 0;
>   }
>   #endif
> @@ -483,9 +478,9 @@ int qxl_ttm_debugfs_init(struct qxl_device *qdev)
>   		qxl_mem_types_list[i].show = &qxl_mm_dump_table;
>   		qxl_mem_types_list[i].driver_features = 0;
>   		if (i == 0)
> -			qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
> +			qxl_mem_types_list[i].data = &qdev->mman.bdev.man[TTM_PL_VRAM];
>   		else
> -			qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV].priv;
> +			qxl_mem_types_list[i].data = &qdev->mman.bdev.man[TTM_PL_PRIV];
>   
>   	}
>   	return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
Ack-by: Monk.Liu <monk.liu@amd.com>