Skip to contentSkip to conversation

drm/amdgpu: fix PSP autoload twice in FLR

PATCH In review Liu ChengZhe 2 participants 4 messages Jul 28, 2020 – Jul 29, 2020

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

PATCH 1/1 drm/amdgpu: fix PSP autoload twice in FLR

the block->status.hw = false assignment will overwrite PSP's previous hw status, which will cause PSP execute resume operation after hw init.

v2: remove the braces

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
index 62ecac97fbd2..5d9affa1d35a 100644
@@ -2574,6 +2574,9 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		AMD_IP_BLOCK_TYPE_IH,
 	};
 
+	for (i = 0; i < adev->num_ip_blocks; i++)
+		adev->ip_blocks[i].status.hw = false;
+
 	for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
 		int j;
 		struct amdgpu_ip_block *block;
@@ -2581,7 +2584,6 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		for (j = 0; j < adev->num_ip_blocks; j++) {
 			block = &adev->ip_blocks[j];
 
-			block->status.hw = false;
 			if (block->version->type != ip_order[i] ||
 				!block->status.valid)
 				continue;
Signature · 6 lines
2.25.1

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

Thanks for removing the braces.

Quoted 1 line · Liu ChengZhe

the block->status.hw = false assignment will overwrite PSP's previous

^^^^^^
You want to start a sentence here. Capitalize "The".
Also don't use future tense in commit descriptions (and commit titles). Simply use present tense. Using future tense makes it confusing if
this is what the code used to do before this change or if the code
is doing this right now as someone is reading the commit in the future with "git log".

Quoted 1 line

hw status, which will cause PSP execute resume operation after hw init.

I've found it best to describe what's being done as if telling a story. Break it down into "tell what's happening" and "tell what what's fixed and how it affects the rest of the system". Something like this:

Assigning false to block->status.hw overwrites PSP's previous hardware status, which causes the PSP to resume operation after hardware init.

Remove this assignment and let the PSP start when it is told to.

Check if the above rendition of your change is correct, and use it if so.

Regards,
Luben

Quoted 27 lines

v2: (R)remove the braces(.)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index 62ecac97fbd2..5d9affa1d35a 100644
@@ -2574,6 +2574,9 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		AMD_IP_BLOCK_TYPE_IH,
 	};
 
+	for (i = 0; i < adev->num_ip_blocks; i++)
+		adev->ip_blocks[i].status.hw = false;
+
 	for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
 		int j;
 		struct amdgpu_ip_block *block;

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) · line 2589

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
@@ -2581,7 +2584,6 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		for (j = 0; j < adev->num_ip_blocks; j++) {
 			block = &adev->ip_blocks[j];
 
-			block->status.hw = false;
 			if (block->version->type != ip_order[i] ||
 				!block->status.valid)
 				continue;

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

#2 lore raw
Quoted 17 lines · Luben Tuikov

Thanks for removing the braces.

Quoted 1 line · Liu ChengZhe

the block->status.hw = false assignment will overwrite PSP's previous

^^^^^^
You want to start a sentence here. Capitalize "The".
Also don't use future tense in commit descriptions (and commit titles). Simply use present tense. Using future tense makes it confusing if
this is what the code used to do before this change or if the code
is doing this right now as someone is reading the commit in the future with "git log".

Quoted 1 line

hw status, which will cause PSP execute resume operation after hw init.

I've found it best to describe what's being done as if telling a story. Break it down into "tell what's happening" and "tell what what's fixed and how it affects the rest of the system". Something like this:

Quoted 7 lines

Assigning false to block->status.hw overwrites PSP's previous hardware status, which causes the PSP to resume operation after hardware init.

Remove this assignment and let the PSP start when it is told to.

Check if the above rendition of your change is correct, and use it if so.

Double checking now, since "resume" is an op, you should capitalize it.

"... which causes the PSP to execute Resume operation right
after hardware init.

Remove this assignment and let the PSP execute Resume operation when it is told to do so."

Or something to that effect.

Regards,
Luben

Quoted 33 lines

Regards,
Luben

Quoted 29 lines

v2: (R)remove the braces(.)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index 62ecac97fbd2..5d9affa1d35a 100644
@@ -2574,6 +2574,9 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		AMD_IP_BLOCK_TYPE_IH,
 	};
 
+	for (i = 0; i < adev->num_ip_blocks; i++)
+		adev->ip_blocks[i].status.hw = false;
+
 	for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
 		int j;
 		struct amdgpu_ip_block *block;
@@ -2581,7 +2584,6 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		for (j = 0; j < adev->num_ip_blocks; j++) {
 			block = &adev->ip_blocks[j];
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) · line 2589

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
-			block->status.hw = false;
 			if (block->version->type != ip_order[i] ||
 				!block->status.valid)
 				continue;

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

#3 lore raw

[AMD Official Use Only - Internal Distribution Only]

Thanks for the modification!

-----Original Message-----
From: Tuikov, Luben <[email protected]>
Sent: Wednesday, July 29, 2020 2:49 AM
To: Liu, Cheng Zhe <[email protected]>; [email protected]
Cc: Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Xiao, Jack <[email protected]>; Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix PSP autoload twice in FLR

Quoted 17 lines · Luben Tuikov

Thanks for removing the braces.

Quoted 1 line · Liu ChengZhe

the block->status.hw = false assignment will overwrite PSP's previous

^^^^^^
You want to start a sentence here. Capitalize "The".
Also don't use future tense in commit descriptions (and commit titles). Simply use present tense. Using future tense makes it confusing if this is what the code used to do before this change or if the code is doing this right now as someone is reading the commit in the future with "git log".

Quoted 1 line

hw status, which will cause PSP execute resume operation after hw init.

I've found it best to describe what's being done as if telling a story. Break it down into "tell what's happening" and "tell what what's fixed and how it affects the rest of the system". Something like this:

Quoted 7 lines

Assigning false to block->status.hw overwrites PSP's previous hardware status, which causes the PSP to resume operation after hardware init.

Remove this assignment and let the PSP start when it is told to.

Check if the above rendition of your change is correct, and use it if so.

Double checking now, since "resume" is an op, you should capitalize it.

"... which causes the PSP to execute Resume operation right after hardware init.

Remove this assignment and let the PSP execute Resume operation when it is told to do so."

Or something to that effect.

Regards,
Luben

Quoted 34 lines

Regards,
Luben

Quoted 30 lines

v2: (R)remove the braces(.)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index 62ecac97fbd2..5d9affa1d35a 100644
@@ -2574,6 +2574,9 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		AMD_IP_BLOCK_TYPE_IH,
 	};
 
+	for (i = 0; i < adev->num_ip_blocks; i++)
+		adev->ip_blocks[i].status.hw = false;
+
 	for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
 		int j;
 		struct amdgpu_ip_block *block;
@@ -2581,7 +2584,6 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
 		for (j = 0; j < adev->num_ip_blocks; j++) {
 			block = &adev->ip_blocks[j];
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) · line 2589

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
-			block->status.hw = false;
 			if (block->version->type != ip_order[i] ||
 				!block->status.valid)
 				continue;

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