Skip to contentSkip to conversation

drm/amdgpu:fix amdgpu_sa_bo_new error(v2)

PATCH In review Monk Liu 2 participants 4 messages Feb 9, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/2 drm/amdgpu:fix amdgpu_sa_bo_new error(v2)

ib_pool init should prior to fbdev_init, otherwise there will be error from amdgpu_sa_bo_new (amdgpu_sa.c:323)

fbdev_init will call ttm_validate which further call amdgpu_sa_bo_new.

v2:
move fbdev_init behind ib test.

Change-Id I3a969570d443f61a44f67b0d76b3871ca5c3ea81
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index afcae15..abd7e15 100644
@@ -1918,8 +1918,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* Get a log2 for easy divisions. */
 	adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
 
-	amdgpu_fbdev_init(adev);
-
 	r = amdgpu_ib_pool_init(adev);
 	if (r) {
 		dev_err(adev->dev, "IB initialization failed (%d).\n", r);
@@ -1930,6 +1928,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (r)
 		DRM_ERROR("ib ring test failed (%d).\n", r);
 
+	amdgpu_fbdev_init(adev);
+
 	r = amdgpu_gem_debugfs_init(adev);
 	if (r) {
 		DRM_ERROR("registering gem debugfs failed (%d).\n", r);
Signature · 6 lines
2.7.4

_______________________________________________
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): 1486612206-2379-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amdgpu:cleanup

1)remove braces not needed
2)don't return failure on debugfs_firmware_init failed

Change-Id I90ec3197184d0fdda54575bfbad7b705aa178698
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -7
index abd7e15..0d33bc9 100644
@@ -1931,20 +1931,16 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	amdgpu_fbdev_init(adev);
 
 	r = amdgpu_gem_debugfs_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering gem debugfs failed (%d).\n", r);
-	}
 
 	r = amdgpu_debugfs_regs_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering register debugfs failed (%d).\n", r);
-	}
 
 	r = amdgpu_debugfs_firmware_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering firmware debugfs failed (%d).\n", r);
-		return r;
-	}
 
 	if ((amdgpu_testing & 1)) {
 		if (adev->accel_working)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1486612206-2379-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#4 lore raw

RE: [PATCH 2/2] drm/amdgpu:cleanup

Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, February 08, 2017 10:50 PM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 2/2] drm/amdgpu:cleanup

1)remove braces not needed
2)don't return failure on debugfs_firmware_init failed

I'd split these in two, one that is pure cleanup, and the second which drops the early return. With that fixed:

Quoted 41 lines
Change-Id I90ec3197184d0fdda54575bfbad7b705aa178698
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -7
index abd7e15..0d33bc9 100644
@@ -1931,20 +1931,16 @@ int amdgpu_device_init(struct amdgpu_device
 *adev,
 	amdgpu_fbdev_init(adev);
 
 	r = amdgpu_gem_debugfs_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering gem debugfs failed (%d).\n", r);
-	}
 
 	r = amdgpu_debugfs_regs_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering register debugfs failed (%d).\n", r);
-	}
 
 	r = amdgpu_debugfs_firmware_init(adev);
-	if (r) {
+	if (r)
 		DRM_ERROR("registering firmware debugfs failed (%d).\n",
 r);
-		return r;
-	}
 
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
 	if ((amdgpu_testing & 1)) {
 		if (adev->accel_working)
--

2.7.4

Quoted 4 lines

_______________________________________________
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

Reviewed-by Alex Deucher
#5 lore raw
In reply to a message not in the archive
Quoted 14 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, February 08, 2017 10:50 PM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH 1/2] drm/amdgpu:fix amdgpu_sa_bo_new error(v2)

ib_pool init should prior to fbdev_init, otherwise there will be error from amdgpu_sa_bo_new (amdgpu_sa.c:323)

Quoted 8 lines

fbdev_init will call ttm_validate which further call amdgpu_sa_bo_new.

v2:
move fbdev_init behind ib test.

Change-Id I3a969570d443f61a44f67b0d76b3871ca5c3ea81
Quoted 32 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
index afcae15..abd7e15 100644
@@ -1918,8 +1918,6 @@ int amdgpu_device_init(struct amdgpu_device
 *adev,
 	/* Get a log2 for easy divisions. */
 	adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
 
-	amdgpu_fbdev_init(adev);
-
 	r = amdgpu_ib_pool_init(adev);
 	if (r) {
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
 		dev_err(adev->dev, "IB initialization failed (%d).\n", r);
@@ -1930,6 +1928,8 @@ int amdgpu_device_init(struct amdgpu_device
 *adev,
 	if (r)
 		DRM_ERROR("ib ring test failed (%d).\n", r);
 
+	amdgpu_fbdev_init(adev);
+
 	r = amdgpu_gem_debugfs_init(adev);
 	if (r) {

DRM_ERROR("registering gem debugfs failed (%d).\n", r);
--
2.7.4

Quoted 4 lines

_______________________________________________
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