All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/sdma4: set align mask to 255
@ 2023-06-07 16:31 Alex Deucher
  2023-06-12 21:47 ` Alex Deucher
  2023-06-12 23:20 ` Felix Kuehling
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Deucher @ 2023-06-07 16:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

The wptr needs to be incremented at at least 64 dword intervals,
use 256 to align with windows.  This should fix potential hangs
with unaligned updates.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 1f83eebfc8a7..cd37f45e01a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2312,7 +2312,7 @@ const struct amd_ip_funcs sdma_v4_0_ip_funcs = {
 
 static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_SDMA,
-	.align_mask = 0xf,
+	.align_mask = 0xff,
 	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
 	.support_64bit_ptrs = true,
 	.secure_submission_supported = true,
@@ -2344,7 +2344,7 @@ static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
 
 static const struct amdgpu_ring_funcs sdma_v4_0_page_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_SDMA,
-	.align_mask = 0xf,
+	.align_mask = 0xff,
 	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
 	.support_64bit_ptrs = true,
 	.secure_submission_supported = true,
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
index 8eebf9c2bbcd..05bb0691ee0e 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
@@ -1823,7 +1823,7 @@ const struct amd_ip_funcs sdma_v4_4_2_ip_funcs = {
 
 static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_SDMA,
-	.align_mask = 0xf,
+	.align_mask = 0xff,
 	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
 	.support_64bit_ptrs = true,
 	.get_rptr = sdma_v4_4_2_ring_get_rptr,
@@ -1854,7 +1854,7 @@ static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
 
 static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_SDMA,
-	.align_mask = 0xf,
+	.align_mask = 0xff,
 	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
 	.support_64bit_ptrs = true,
 	.get_rptr = sdma_v4_4_2_ring_get_rptr,
-- 
2.40.1


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

* Re: [PATCH] drm/amdgpu/sdma4: set align mask to 255
  2023-06-07 16:31 [PATCH] drm/amdgpu/sdma4: set align mask to 255 Alex Deucher
@ 2023-06-12 21:47 ` Alex Deucher
  2023-06-13  1:14   ` Liu, Aaron
  2023-06-12 23:20 ` Felix Kuehling
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2023-06-12 21:47 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx

ping?

On Wed, Jun 7, 2023 at 12:31 PM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> The wptr needs to be incremented at at least 64 dword intervals,
> use 256 to align with windows.  This should fix potential hangs
> with unaligned updates.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 1f83eebfc8a7..cd37f45e01a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2312,7 +2312,7 @@ const struct amd_ip_funcs sdma_v4_0_ip_funcs = {
>
>  static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>         .type = AMDGPU_RING_TYPE_SDMA,
> -       .align_mask = 0xf,
> +       .align_mask = 0xff,
>         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>         .support_64bit_ptrs = true,
>         .secure_submission_supported = true,
> @@ -2344,7 +2344,7 @@ static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>
>  static const struct amdgpu_ring_funcs sdma_v4_0_page_ring_funcs = {
>         .type = AMDGPU_RING_TYPE_SDMA,
> -       .align_mask = 0xf,
> +       .align_mask = 0xff,
>         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>         .support_64bit_ptrs = true,
>         .secure_submission_supported = true,
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> index 8eebf9c2bbcd..05bb0691ee0e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> @@ -1823,7 +1823,7 @@ const struct amd_ip_funcs sdma_v4_4_2_ip_funcs = {
>
>  static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>         .type = AMDGPU_RING_TYPE_SDMA,
> -       .align_mask = 0xf,
> +       .align_mask = 0xff,
>         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>         .support_64bit_ptrs = true,
>         .get_rptr = sdma_v4_4_2_ring_get_rptr,
> @@ -1854,7 +1854,7 @@ static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>
>  static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
>         .type = AMDGPU_RING_TYPE_SDMA,
> -       .align_mask = 0xf,
> +       .align_mask = 0xff,
>         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>         .support_64bit_ptrs = true,
>         .get_rptr = sdma_v4_4_2_ring_get_rptr,
> --
> 2.40.1
>

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

* Re: [PATCH] drm/amdgpu/sdma4: set align mask to 255
  2023-06-07 16:31 [PATCH] drm/amdgpu/sdma4: set align mask to 255 Alex Deucher
  2023-06-12 21:47 ` Alex Deucher
@ 2023-06-12 23:20 ` Felix Kuehling
  1 sibling, 0 replies; 5+ messages in thread
From: Felix Kuehling @ 2023-06-12 23:20 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx

Am 2023-06-07 um 12:31 schrieb Alex Deucher:
> The wptr needs to be incremented at at least 64 dword intervals,
> use 256 to align with windows.  This should fix potential hangs
> with unaligned updates.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
>   drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 1f83eebfc8a7..cd37f45e01a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2312,7 +2312,7 @@ const struct amd_ip_funcs sdma_v4_0_ip_funcs = {
>   
>   static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>   	.type = AMDGPU_RING_TYPE_SDMA,
> -	.align_mask = 0xf,
> +	.align_mask = 0xff,
>   	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>   	.support_64bit_ptrs = true,
>   	.secure_submission_supported = true,
> @@ -2344,7 +2344,7 @@ static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>   
>   static const struct amdgpu_ring_funcs sdma_v4_0_page_ring_funcs = {
>   	.type = AMDGPU_RING_TYPE_SDMA,
> -	.align_mask = 0xf,
> +	.align_mask = 0xff,
>   	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>   	.support_64bit_ptrs = true,
>   	.secure_submission_supported = true,
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> index 8eebf9c2bbcd..05bb0691ee0e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> @@ -1823,7 +1823,7 @@ const struct amd_ip_funcs sdma_v4_4_2_ip_funcs = {
>   
>   static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>   	.type = AMDGPU_RING_TYPE_SDMA,
> -	.align_mask = 0xf,
> +	.align_mask = 0xff,
>   	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>   	.support_64bit_ptrs = true,
>   	.get_rptr = sdma_v4_4_2_ring_get_rptr,
> @@ -1854,7 +1854,7 @@ static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>   
>   static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
>   	.type = AMDGPU_RING_TYPE_SDMA,
> -	.align_mask = 0xf,
> +	.align_mask = 0xff,
>   	.nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>   	.support_64bit_ptrs = true,
>   	.get_rptr = sdma_v4_4_2_ring_get_rptr,

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

* RE: [PATCH] drm/amdgpu/sdma4: set align mask to 255
  2023-06-12 21:47 ` Alex Deucher
@ 2023-06-13  1:14   ` Liu, Aaron
  2023-06-13 14:15     ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Liu, Aaron @ 2023-06-13  1:14 UTC (permalink / raw)
  To: Alex Deucher, Deucher, Alexander; +Cc: amd-gfx

[AMD Official Use Only - General]

Reviewed-by: Aaron Liu <aaron.liu@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Tuesday, June 13, 2023 5:48 AM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amdgpu/sdma4: set align mask to 255
>
> ping?
>
> On Wed, Jun 7, 2023 at 12:31 PM Alex Deucher <alexander.deucher@amd.com>
> wrote:
> >
> > The wptr needs to be incremented at at least 64 dword intervals, use
> > 256 to align with windows.  This should fix potential hangs with
> > unaligned updates.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
> >  drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > index 1f83eebfc8a7..cd37f45e01a1 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > @@ -2312,7 +2312,7 @@ const struct amd_ip_funcs sdma_v4_0_ip_funcs = {
> >
> >  static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
> >         .type = AMDGPU_RING_TYPE_SDMA,
> > -       .align_mask = 0xf,
> > +       .align_mask = 0xff,
> >         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
> >         .support_64bit_ptrs = true,
> >         .secure_submission_supported = true, @@ -2344,7 +2344,7 @@
> > static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
> >
> >  static const struct amdgpu_ring_funcs sdma_v4_0_page_ring_funcs = {
> >         .type = AMDGPU_RING_TYPE_SDMA,
> > -       .align_mask = 0xf,
> > +       .align_mask = 0xff,
> >         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
> >         .support_64bit_ptrs = true,
> >         .secure_submission_supported = true, diff --git
> > a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> > index 8eebf9c2bbcd..05bb0691ee0e 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
> > @@ -1823,7 +1823,7 @@ const struct amd_ip_funcs sdma_v4_4_2_ip_funcs =
> > {
> >
> >  static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
> >         .type = AMDGPU_RING_TYPE_SDMA,
> > -       .align_mask = 0xf,
> > +       .align_mask = 0xff,
> >         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
> >         .support_64bit_ptrs = true,
> >         .get_rptr = sdma_v4_4_2_ring_get_rptr, @@ -1854,7 +1854,7 @@
> > static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
> >
> >  static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
> >         .type = AMDGPU_RING_TYPE_SDMA,
> > -       .align_mask = 0xf,
> > +       .align_mask = 0xff,
> >         .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
> >         .support_64bit_ptrs = true,
> >         .get_rptr = sdma_v4_4_2_ring_get_rptr,
> > --
> > 2.40.1
> >

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

* Re: [PATCH] drm/amdgpu/sdma4: set align mask to 255
  2023-06-13  1:14   ` Liu, Aaron
@ 2023-06-13 14:15     ` Christian König
  0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2023-06-13 14:15 UTC (permalink / raw)
  To: Liu, Aaron, Alex Deucher, Deucher, Alexander; +Cc: amd-gfx

Reviewed-by: Christian König <christian.koenig@amd.com>

Am 13.06.23 um 03:14 schrieb Liu, Aaron:
> [AMD Official Use Only - General]
>
> Reviewed-by: Aaron Liu <aaron.liu@amd.com>
>
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
>> Deucher
>> Sent: Tuesday, June 13, 2023 5:48 AM
>> To: Deucher, Alexander <Alexander.Deucher@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH] drm/amdgpu/sdma4: set align mask to 255
>>
>> ping?
>>
>> On Wed, Jun 7, 2023 at 12:31 PM Alex Deucher <alexander.deucher@amd.com>
>> wrote:
>>> The wptr needs to be incremented at at least 64 dword intervals, use
>>> 256 to align with windows.  This should fix potential hangs with
>>> unaligned updates.
>>>
>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
>>>   drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
>>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> index 1f83eebfc8a7..cd37f45e01a1 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> @@ -2312,7 +2312,7 @@ const struct amd_ip_funcs sdma_v4_0_ip_funcs = {
>>>
>>>   static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>>>          .type = AMDGPU_RING_TYPE_SDMA,
>>> -       .align_mask = 0xf,
>>> +       .align_mask = 0xff,
>>>          .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>>>          .support_64bit_ptrs = true,
>>>          .secure_submission_supported = true, @@ -2344,7 +2344,7 @@
>>> static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
>>>
>>>   static const struct amdgpu_ring_funcs sdma_v4_0_page_ring_funcs = {
>>>          .type = AMDGPU_RING_TYPE_SDMA,
>>> -       .align_mask = 0xf,
>>> +       .align_mask = 0xff,
>>>          .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>>>          .support_64bit_ptrs = true,
>>>          .secure_submission_supported = true, diff --git
>>> a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> index 8eebf9c2bbcd..05bb0691ee0e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> @@ -1823,7 +1823,7 @@ const struct amd_ip_funcs sdma_v4_4_2_ip_funcs =
>>> {
>>>
>>>   static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>>>          .type = AMDGPU_RING_TYPE_SDMA,
>>> -       .align_mask = 0xf,
>>> +       .align_mask = 0xff,
>>>          .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>>>          .support_64bit_ptrs = true,
>>>          .get_rptr = sdma_v4_4_2_ring_get_rptr, @@ -1854,7 +1854,7 @@
>>> static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
>>>
>>>   static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
>>>          .type = AMDGPU_RING_TYPE_SDMA,
>>> -       .align_mask = 0xf,
>>> +       .align_mask = 0xff,
>>>          .nop = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP),
>>>          .support_64bit_ptrs = true,
>>>          .get_rptr = sdma_v4_4_2_ring_get_rptr,
>>> --
>>> 2.40.1
>>>


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

end of thread, other threads:[~2023-06-13 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-07 16:31 [PATCH] drm/amdgpu/sdma4: set align mask to 255 Alex Deucher
2023-06-12 21:47 ` Alex Deucher
2023-06-13  1:14   ` Liu, Aaron
2023-06-13 14:15     ` Christian König
2023-06-12 23:20 ` Felix Kuehling

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.