Skip to contentSkip to conversation

drm/amdgpu: Partially revert commit 2dc80b006

PATCH In review Rex Zhu 4 participants 6 messages Jun 13, 2018 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Partially revert commit 2dc80b006

Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +8 -6
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
 	if (amdgpu_emu_mode == 1)
 		return 0;
 
-	r = amdgpu_ib_ring_tests(adev);
-	if (r)
-		DRM_ERROR("ib ring test failed (%d).\n", r);
-
 	for (i = 0; i < adev->num_ip_blocks; i++) {
 		if (!adev->ip_blocks[i].status.valid)
 			continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
 		}
 	}
 
+	amdgpu_device_ip_late_set_cg_state(adev);
+	amdgpu_device_ip_late_set_pg_state(adev);
+
 	queue_delayed_work(system_wq, &adev->late_init_work,
 			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 
@@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)
 {
 	struct amdgpu_device *adev =
 		container_of(work, struct amdgpu_device, late_init_work.work);
-	amdgpu_device_ip_late_set_cg_state(adev);
-	amdgpu_device_ip_late_set_pg_state(adev);
+	int r;
+
+	r = amdgpu_ib_ring_tests(adev);
+	if (r)
+		DRM_ERROR("ib ring test failed (%d).\n", r);
 }
 
 /**
Signature · 6 lines
1.9.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): 1528890013-23490-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 13.06.2018 um 13:40 schrieb Rex Zhu:

Quoted 10 lines

Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

Yeah, that thought came to my mind as well.

Essentially the IB test should simulate a submission from userspace to make sure that the stack is working as expected. I think it was just moved before CG/PG to avoid issues with that, which is actually not very clever.

Patch is Reviewed-by: Christian König <[email protected]>, but there could be some fallout we could need to deal with.

Thanks,
Christian.

Quoted 33 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -4
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
  	if (amdgpu_emu_mode == 1)
  		return 0;
 
-	r = amdgpu_ib_ring_tests(adev);
-	if (r)
-		DRM_ERROR("ib ring test failed (%d).\n", r);
-
  	for (i = 0; i < adev->num_ip_blocks; i++) {
  		if (!adev->ip_blocks[i].status.valid)
  			continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
  		}
  	}
 
+	amdgpu_device_ip_late_set_cg_state(adev);
+	amdgpu_device_ip_late_set_pg_state(adev);
+
  	queue_delayed_work(system_wq, &adev->late_init_work,
  			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 
@@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)
  {
  	struct amdgpu_device *adev =
  		container_of(work, struct amdgpu_device, late_init_work.work);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work) · line 1930

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -2
-	amdgpu_device_ip_late_set_cg_state(adev);
-	amdgpu_device_ip_late_set_pg_state(adev);
+	int r;
+
+	r = amdgpu_ib_ring_tests(adev);
+	if (r)
+		DRM_ERROR("ib ring test failed (%d).\n", r);
  }
 
  /**

_______________________________________________
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): 6526fa0b-474e-102c-6577-5723427970a9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw

Hi,

can you please improve the commit message?
seeing "Revert $HASH" conveys zero information about the code change. I'm sorry for bringing this up again, but following AMDGPU/Radeon driver development is an exercise in frustration for anyone who is not on AMD's payroll.
git commit logs like:
"revert XYZ" or "fix bug #123" make it really cumbersome to actually look at history and pick interesting/breaking commits.

thanks,
Jan

Quoted 69 lines · Christian König

Am 13.06.2018 um 13:40 schrieb Rex Zhu:

Quoted 11 lines

Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

Yeah, that thought came to my mind as well.

Essentially the IB test should simulate a submission from userspace to make sure that the stack is working as expected. I think it was just moved before CG/PG to avoid issues with that, which is actually not very clever.

Patch is Reviewed-by: Christian König <[email protected]>, but there could be some fallout we could need to deal with.

Thanks,
Christian.

---

Quoted 41 lines
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct
 amdgpu_device *adev)
        if (amdgpu_emu_mode == 1)
                return 0;
  -     r = amdgpu_ib_ring_tests(adev);
-       if (r)
-               DRM_ERROR("ib ring test failed (%d).\n", r);
-
        for (i = 0; i < adev->num_ip_blocks; i++) {
                if (!adev->ip_blocks[i].status.valid)
                        continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct
 amdgpu_device *adev)
                }
        }
  +     amdgpu_device_ip_late_set_cg_state(adev);
+       amdgpu_device_ip_late_set_pg_state(adev);
+
        queue_delayed_work(system_wq, &adev->late_init_work,
                           msecs_to_jiffies(AMDGPU_RESUME_MS));
  @@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct

work_struct *work)
{
struct amdgpu_device *adev =
container_of(work, struct amdgpu_device,
late_init_work.work);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -2
-       amdgpu_device_ip_late_set_cg_state(adev);
-       amdgpu_device_ip_late_set_pg_state(adev);
+       int r;
+
+       r = amdgpu_ib_ring_tests(adev);
+       if (r)
+               DRM_ERROR("ib ring test failed (%d).\n", r);
Quoted 9 lines
Quoted 3 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

A message that is not in the archive (sent off-list or not yet received): CABE_ZV06N+_JcnqJMU=78DKNwGMwxpEsg7Tr0Xgw0x=-hyc6bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw

On 06/13/2018 08:30 AM, Jan Vesely wrote:
Hi,

can you please improve the commit message?
seeing "Revert $HASH" conveys zero information about the code change.
I'm sorry for bringing this up again, but following AMDGPU/Radeon driver development is an exercise in frustration for anyone who is not on AMD's payroll. git commit logs like:
"revert XYZ" or "fix bug #123" make it really cumbersome to actually look at history and pick interesting/breaking commits.

thanks,
Jan
Just a polite agreement and seconding here. The abundance of acronyms is confusing but understandable, and the weekly dumps of DC updates show not a bit of dialog about how or why the patches were written. Although I read the rest of the emails to the list, I can usually just mark that set of 18 to 30 mails as read and send it straight to the trash. It's too much work to glean useful information from them.

Regards,
Will

On Wed, Jun 13, 2018 at 8:46 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Am 13.06.2018 um 13:40 schrieb Rex Zhu:
Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

Yeah, that thought came to my mind as well.

Essentially the IB test should simulate a submission from userspace to make sure that the stack is working as expected. I think it was just moved before CG/PG to avoid issues with that, which is actually not very clever.

Patch is Reviewed-by: Christian König <[email protected]<mailto:[email protected]>>, but there could be some fallout we could need to deal with.

Thanks,
Christian.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
        if (amdgpu_emu_mode == 1)
                return 0;
  -     r = amdgpu_ib_ring_tests(adev);
-       if (r)
-               DRM_ERROR("ib ring test failed (%d).\n", r);
-
        for (i = 0; i < adev->num_ip_blocks; i++) {
                if (!adev->ip_blocks[i].status.va<https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fstatus.va&data=02%7C01%7C%7C3869c12d0e1d489d0f1b08d5d131d2d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636644934270231216&sdata=U37xx4d4KwmIMbYBRB2V8ueYMIPTQx6t%2Bm90qpR60Ek%3D&reserved=0>lid)
                        continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
                }
        }
  +     amdgpu_device_ip_late_set_cg_state(adev);
+       amdgpu_device_ip_late_set_pg_state(adev);
+
        queue_delayed_work(system_wq, &adev->late_init_work,
                           msecs_to_jiffies(AMDGPU_RESUME_MS));
  @@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)

{
struct amdgpu_device *adev =
container_of(work, struct amdgpu_device, late_init_work.work<https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flate_init_work.work&data=02%7C01%7C%7C3869c12d0e1d489d0f1b08d5d131d2d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636644934270387474&sdata=R3%2BYpuk333iEpjzcc8lLjr6NKPi74VximJcFAGCHqUc%3D&reserved=0>);

-       amdgpu_device_ip_late_set_cg_state(adev);
-       amdgpu_device_ip_late_set_pg_state(adev);
+       int r;

+
+ r = amdgpu_ib_ring_tests(adev);
+ if (r)
+ DRM_ERROR("ib ring test failed (%d).\n", r);
}

    /**

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7C%7C3869c12d0e1d489d0f1b08d5d131d2d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636644934270387474&sdata=EllXqELZzZXDFafao7ingUyBAK4bl2T4Ja54uqdzR%2BE%3D&reserved=0>

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7C%7C3869c12d0e1d489d0f1b08d5d131d2d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636644934270387474&sdata=EllXqELZzZXDFafao7ingUyBAK4bl2T4Ja54uqdzR%2BE%3D&reserved=0

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

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

Hi Jan,

Thanks for your suggestion. Obvious the patch title was inappropriate. I will update it.

In fact, I originally plan to send this patch internally for discussion. So just thought that "Revert xxxxx" can cause the attention.

Best Regards
Rex

________________________________
From: jv356-nChP9VK/[email protected] <jv356-nChP9VK/[email protected]> on behalf of Jan Vesely <[email protected]>
Sent: Wednesday, June 13, 2018 9:30 PM
To: Koenig, Christian
Cc: Zhu, Rex; amd-gfx list
Subject: Re: [PATCH] drm/amdgpu: Partially revert commit 2dc80b006

Hi,

can you please improve the commit message?
seeing "Revert $HASH" conveys zero information about the code change.
I'm sorry for bringing this up again, but following AMDGPU/Radeon driver development is an exercise in frustration for anyone who is not on AMD's payroll. git commit logs like:
"revert XYZ" or "fix bug #123" make it really cumbersome to actually look at history and pick interesting/breaking commits.

thanks,
Jan

On Wed, Jun 13, 2018 at 8:46 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Am 13.06.2018 um 13:40 schrieb Rex Zhu:
Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

Yeah, that thought came to my mind as well.

Essentially the IB test should simulate a submission from userspace to make sure that the stack is working as expected. I think it was just moved before CG/PG to avoid issues with that, which is actually not very clever.

Patch is Reviewed-by: Christian König <[email protected]<mailto:[email protected]>>, but there could be some fallout we could need to deal with.

Thanks,
Christian.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
        if (amdgpu_emu_mode == 1)
                return 0;
  -     r = amdgpu_ib_ring_tests(adev);
-       if (r)
-               DRM_ERROR("ib ring test failed (%d).\n", r);
-
        for (i = 0; i < adev->num_ip_blocks; i++) {
                if (!adev->ip_blocks[i].status.va<http://status.va>lid)
                        continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
                }
        }
  +     amdgpu_device_ip_late_set_cg_state(adev);
+       amdgpu_device_ip_late_set_pg_state(adev);
+
        queue_delayed_work(system_wq, &adev->late_init_work,
                           msecs_to_jiffies(AMDGPU_RESUME_MS));
  @@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)

{
struct amdgpu_device *adev =
container_of(work, struct amdgpu_device, late_init_work.work<http://late_init_work.work>);

-       amdgpu_device_ip_late_set_cg_state(adev);
-       amdgpu_device_ip_late_set_pg_state(adev);
+       int r;

+
+ r = amdgpu_ib_ring_tests(adev);
+ if (r)
+ DRM_ERROR("ib ring test failed (%d).\n", r);
}

    /**

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[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): CY4PR12MB1687387C53D92564048587ECFB7E0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#9 lore raw

thank you. Every effort to make the patches easier to follow is appreciated.

Jan

Quoted 113 lines · Rex

Hi Jan,

Thanks for your suggestion. Obvious the patch title was inappropriate. I will update it.

In fact, I originally plan to send this patch internally for discussion. So just thought that "Revert xxxxx" can cause the attention.

Best Regards
Rex

------------------------------
*From:* jv356-nChP9VK/[email protected] <jv356-nChP9VK/[email protected]> on behalf of Jan Vesely <[email protected]>
*Sent:* Wednesday, June 13, 2018 9:30 PM
*To:* Koenig, Christian
*Cc:* Zhu, Rex; amd-gfx list
*Subject:* Re: [PATCH] drm/amdgpu: Partially revert commit 2dc80b006

Hi,

can you please improve the commit message?
seeing "Revert $HASH" conveys zero information about the code change. I'm sorry for bringing this up again, but following AMDGPU/Radeon driver development is an exercise in frustration for anyone who is not on AMD's payroll.
git commit logs like:
"revert XYZ" or "fix bug #123" make it really cumbersome to actually look at history and pick interesting/breaking commits.

thanks,
Jan

On Wed, Jun 13, 2018 at 8:46 AM, Christian König < [email protected]> wrote:

Am 13.06.2018 um 13:40 schrieb Rex Zhu:

Move the CG enablement out of delay worker thread.

1. CG/PG enablement are part of gpu hw ip initialize, we should wait for them complete. otherwise, there are some potential conflicts, for example, Suspend and CG enablement concurrently.
2. better run ib test after hw initialize completely. That is to say, ib test should be after CG/PG enablement. otherwise, the test will not cover the cg/pg/poweroff enable case.

Yeah, that thought came to my mind as well.

Essentially the IB test should simulate a submission from userspace to make sure that the stack is working as expected. I think it was just moved before CG/PG to avoid issues with that, which is actually not very clever.

Patch is Reviewed-by: Christian König <[email protected]>, but there could be some fallout we could need to deal with.

Thanks,
Christian.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index 9647f54..90b78c7 100644
@@ -1709,10 +1709,6 @@ static int amdgpu_device_ip_late_set_cg_state(struct
 amdgpu_device *adev)
        if (amdgpu_emu_mode == 1)
                return 0;
  -     r = amdgpu_ib_ring_tests(adev);
-       if (r)
-               DRM_ERROR("ib ring test failed (%d).\n", r);
-
        for (i = 0; i < adev->num_ip_blocks; i++) {
                if (!adev->ip_blocks[i].status.valid)
                        continue;
@@ -1793,6 +1789,9 @@ static int amdgpu_device_ip_late_init(struct
 amdgpu_device *adev)
                }
        }
  +     amdgpu_device_ip_late_set_cg_state(adev);
+       amdgpu_device_ip_late_set_pg_state(adev);
+
        queue_delayed_work(system_wq, &adev->late_init_work,
                           msecs_to_jiffies(AMDGPU_RESUME_MS));
  @@ -1921,8 +1920,11 @@ static void amdgpu_device_ip_late_init_func_handler(struct

work_struct *work)
{
struct amdgpu_device *adev =
container_of(work, struct amdgpu_device,
late_init_work.work);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -2
-       amdgpu_device_ip_late_set_cg_state(adev);
-       amdgpu_device_ip_late_set_pg_state(adev);
+       int r;
+
+       r = amdgpu_ib_ring_tests(adev);
+       if (r)
+               DRM_ERROR("ib ring test failed (%d).\n", r);
  }
    /**
Quoted 7 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