All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status
@ 2017-05-05 14:27 Alex Deucher
       [not found] ` <1493994447-20285-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2017-05-05 14:27 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Update the scratch reg for when the engine is hung.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index d735cd1..4bdda56 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
 		WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
 }
 
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+						  bool hung)
+{
+	u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
+
+	if (hung)
+		tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+	else
+		tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+	WREG32(adev->bios_scratch_reg_offset + 3, tmp);
+}
+
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
 {
 	struct atom_context *ctx = adev->mode_info.atom_context;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
index d0c4dcd..a2c3ebe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
@@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
+void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
+						  bool hung);
 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
 
 #endif
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset
       [not found] ` <1493994447-20285-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-05 14:27   ` Alex Deucher
       [not found]     ` <1493994447-20285-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2017-05-08 18:32   ` [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status Alex Deucher
  1 sibling, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2017-05-05 14:27 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Need to use the atomfirmware interface rather than atombios since
soc15 is atomfirmware based.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 79af896..b04f929 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include "drmP.h"
 #include "amdgpu.h"
-#include "amdgpu_atombios.h"
+#include "amdgpu_atomfirmware.h"
 #include "amdgpu_ih.h"
 #include "amdgpu_uvd.h"
 #include "amdgpu_vce.h"
@@ -392,11 +392,11 @@ static void soc15_gpu_pci_config_reset(struct amdgpu_device *adev)
 
 static int soc15_asic_reset(struct amdgpu_device *adev)
 {
-	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, true);
 
 	soc15_gpu_pci_config_reset(adev);
 
-	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
+	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, false);
 
 	return 0;
 }
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status
       [not found] ` <1493994447-20285-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2017-05-05 14:27   ` [PATCH 2/2] drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset Alex Deucher
@ 2017-05-08 18:32   ` Alex Deucher
       [not found]     ` <CADnq5_M4M47SvQdaC550Sc89Zu2oXRDXa2MjTEZuN4NsjqcXeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2017-05-08 18:32 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Alex Deucher

On Fri, May 5, 2017 at 10:27 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> Update the scratch reg for when the engine is hung.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

ping on this series.

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
>  2 files changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> index d735cd1..4bdda56 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
> @@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
>                 WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
>  }
>
> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
> +                                                 bool hung)
> +{
> +       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
> +
> +       if (hung)
> +               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
> +       else
> +               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
> +
> +       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
> +}
> +
>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
>  {
>         struct atom_context *ctx = adev->mode_info.atom_context;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> index d0c4dcd..a2c3ebe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
> @@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
>  void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
>  void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
>  void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
> +                                                 bool hung);
>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
>
>  #endif
> --
> 2.5.5
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status
       [not found]     ` <CADnq5_M4M47SvQdaC550Sc89Zu2oXRDXa2MjTEZuN4NsjqcXeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-05-08 20:43       ` Harry Wentland
       [not found]         ` <039ed304-e365-ba38-1501-4e81fee639d1-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Harry Wentland @ 2017-05-08 20:43 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx list; +Cc: Alex Deucher

On 2017-05-08 02:32 PM, Alex Deucher wrote:
> On Fri, May 5, 2017 at 10:27 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
>> Update the scratch reg for when the engine is hung.
>>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>
> ping on this series.
>

I'm not an expert on this and haven't had a chance to look up the 
atomfirmware definitions but this looks reasonable to me.

Acked-by: Harry Wentland <harry.wentland@amd.com>

Harry


> Alex
>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
>>  2 files changed, 15 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>> index d735cd1..4bdda56 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>> @@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
>>                 WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
>>  }
>>
>> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
>> +                                                 bool hung)
>> +{
>> +       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
>> +
>> +       if (hung)
>> +               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
>> +       else
>> +               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
>> +
>> +       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
>> +}
>> +
>>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
>>  {
>>         struct atom_context *ctx = adev->mode_info.atom_context;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>> index d0c4dcd..a2c3ebe 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>> @@ -28,6 +28,8 @@ bool amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device *adev)
>>  void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
>>  void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev);
>>  void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev);
>> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev,
>> +                                                 bool hung);
>>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
>>
>>  #endif
>> --
>> 2.5.5
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset
       [not found]     ` <1493994447-20285-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-09  3:12       ` zhoucm1
  0 siblings, 0 replies; 6+ messages in thread
From: zhoucm1 @ 2017-05-09  3:12 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher



On 2017年05月05日 22:27, Alex Deucher wrote:
> Need to use the atomfirmware interface rather than atombios since
> soc15 is atomfirmware based.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
The series is Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 79af896..b04f929 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -25,7 +25,7 @@
>   #include <linux/module.h>
>   #include "drmP.h"
>   #include "amdgpu.h"
> -#include "amdgpu_atombios.h"
> +#include "amdgpu_atomfirmware.h"
>   #include "amdgpu_ih.h"
>   #include "amdgpu_uvd.h"
>   #include "amdgpu_vce.h"
> @@ -392,11 +392,11 @@ static void soc15_gpu_pci_config_reset(struct amdgpu_device *adev)
>   
>   static int soc15_asic_reset(struct amdgpu_device *adev)
>   {
> -	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
> +	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, true);
>   
>   	soc15_gpu_pci_config_reset(adev);
>   
> -	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
> +	amdgpu_atomfirmware_scratch_regs_engine_hung(adev, false);
>   
>   	return 0;
>   }

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status
       [not found]         ` <039ed304-e365-ba38-1501-4e81fee639d1-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-09  9:45           ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2017-05-09  9:45 UTC (permalink / raw)
  To: Harry Wentland, Alex Deucher, amd-gfx list; +Cc: Alex Deucher

Am 08.05.2017 um 22:43 schrieb Harry Wentland:
> On 2017-05-08 02:32 PM, Alex Deucher wrote:
>> On Fri, May 5, 2017 at 10:27 AM, Alex Deucher <alexdeucher@gmail.com> 
>> wrote:
>>> Update the scratch reg for when the engine is hung.
>>>
>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>
>> ping on this series.
>>
>
> I'm not an expert on this and haven't had a chance to look up the 
> atomfirmware definitions but this looks reasonable to me.

Dito. Problem is as far as I know nobody else is deeply into atombios 
and reviewing patches.

> Acked-by: Harry Wentland <harry.wentland@amd.com>

Acked-by: Christian König <christian.koenig@amd.com> as well.

Christian.

>
> Harry
>
>
>> Alex
>>
>>> ---
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 +++++++++++++
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h |  2 ++
>>>  2 files changed, 15 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c 
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>>> index d735cd1..4bdda56 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
>>> @@ -88,6 +88,19 @@ void 
>>> amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev)
>>>                 WREG32(adev->bios_scratch_reg_offset + i, 
>>> adev->bios_scratch[i]);
>>>  }
>>>
>>> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct 
>>> amdgpu_device *adev,
>>> +                                                 bool hung)
>>> +{
>>> +       u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3);
>>> +
>>> +       if (hung)
>>> +               tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
>>> +       else
>>> +               tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
>>> +
>>> +       WREG32(adev->bios_scratch_reg_offset + 3, tmp);
>>> +}
>>> +
>>>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device 
>>> *adev)
>>>  {
>>>         struct atom_context *ctx = adev->mode_info.atom_context;
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h 
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>>> index d0c4dcd..a2c3ebe 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
>>> @@ -28,6 +28,8 @@ bool 
>>> amdgpu_atomfirmware_gpu_supports_virtualization(struct amdgpu_device 
>>> *adev)
>>>  void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device 
>>> *adev);
>>>  void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device 
>>> *adev);
>>>  void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device 
>>> *adev);
>>> +void amdgpu_atomfirmware_scratch_regs_engine_hung(struct 
>>> amdgpu_device *adev,
>>> +                                                 bool hung);
>>>  int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device 
>>> *adev);
>>>
>>>  #endif
>>> -- 
>>> 2.5.5
>>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-09  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 14:27 [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status Alex Deucher
     [not found] ` <1493994447-20285-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-05-05 14:27   ` [PATCH 2/2] drm/amdgpu/soc15: use atomfirmware for setting bios scratch for reset Alex Deucher
     [not found]     ` <1493994447-20285-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-05-09  3:12       ` zhoucm1
2017-05-08 18:32   ` [PATCH 1/2] drm/amdgpu/atomfirmware: add function to update engine hang status Alex Deucher
     [not found]     ` <CADnq5_M4M47SvQdaC550Sc89Zu2oXRDXa2MjTEZuN4NsjqcXeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-08 20:43       ` Harry Wentland
     [not found]         ` <039ed304-e365-ba38-1501-4e81fee639d1-5C7GfCeVMHo@public.gmane.org>
2017-05-09  9:45           ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.