All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug.
@ 2022-03-01 18:07 Andrey Grodzovsky
  2022-03-01 18:08 ` [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing Andrey Grodzovsky
  2022-03-02  8:37 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Christian König
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Grodzovsky @ 2022-03-01 18:07 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Andrey Grodzovsky

Protect with drm_dev_enter/exit

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index f522b52725e4..4294f17cedcb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -23,6 +23,7 @@
  */
 
 #include <drm/drm_auth.h>
+#include <drm/drm_drv.h>
 #include "amdgpu.h"
 #include "amdgpu_sched.h"
 #include "amdgpu_ras.h"
@@ -339,7 +340,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
 {
 	struct amdgpu_ctx *ctx = container_of(ref, struct amdgpu_ctx, refcount);
 	struct amdgpu_device *adev = ctx->adev;
-	unsigned i, j;
+	unsigned i, j, idx;
 
 	if (!adev)
 		return;
@@ -350,7 +351,12 @@ static void amdgpu_ctx_fini(struct kref *ref)
 			ctx->entities[i][j] = NULL;
 		}
 	}
-	amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
+
+	if (drm_dev_enter(&adev->ddev, &idx)) {
+		amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
+		drm_dev_exit(idx);
+	}
+
 	kfree(ctx);
 }
 
-- 
2.25.1


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

* [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing.
  2022-03-01 18:07 [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Andrey Grodzovsky
@ 2022-03-01 18:08 ` Andrey Grodzovsky
  2022-03-01 18:34   ` Alex Deucher
  2022-03-02  8:37 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Christian König
  1 sibling, 1 reply; 5+ messages in thread
From: Andrey Grodzovsky @ 2022-03-01 18:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Andrey Grodzovsky

This will allow to enable the tests only after latest fix
after which the tests passed on my system.

I tested on NV21 standalone and Vega 10 and Polaris as
pair with DRI_PRIME.

It's possible there might be still issues on ASICs i don't
have at my posession but that that the point of enbling
the tests finally - if other people during testing will
encounter errors they will report and I will be able to fix.

The releated merge request for enabling libdrm tests suite  is in
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/227

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 415ecf8b2e05..be4adda8d674 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -100,9 +100,10 @@
  * - 3.43.0 - Add device hot plug/unplug support
  * - 3.44.0 - DCN3 supports DCC independent block settings: !64B && 128B, 64B && 128B
  * - 3.45.0 - Add context ioctl stable pstate interface
+ * * 3.46.0 - Add context ioctl stable pstate interface
  */
 #define KMS_DRIVER_MAJOR	3
-#define KMS_DRIVER_MINOR	45
+#define KMS_DRIVER_MINOR	46
 #define KMS_DRIVER_PATCHLEVEL	0
 
 int amdgpu_vram_limit;
-- 
2.25.1


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

* Re: [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing.
  2022-03-01 18:08 ` [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing Andrey Grodzovsky
@ 2022-03-01 18:34   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2022-03-01 18:34 UTC (permalink / raw)
  To: Andrey Grodzovsky; +Cc: Deucher, Alexander, amd-gfx list

On Tue, Mar 1, 2022 at 1:08 PM Andrey Grodzovsky
<andrey.grodzovsky@amd.com> wrote:
>
> This will allow to enable the tests only after latest fix
> after which the tests passed on my system.
>
> I tested on NV21 standalone and Vega 10 and Polaris as
> pair with DRI_PRIME.
>
> It's possible there might be still issues on ASICs i don't
> have at my posession but that that the point of enbling
> the tests finally - if other people during testing will
> encounter errors they will report and I will be able to fix.
>
> The releated merge request for enabling libdrm tests suite  is in
> https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/227
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

Typo in the title: enabliing -> enabling

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 415ecf8b2e05..be4adda8d674 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -100,9 +100,10 @@
>   * - 3.43.0 - Add device hot plug/unplug support
>   * - 3.44.0 - DCN3 supports DCC independent block settings: !64B && 128B, 64B && 128B
>   * - 3.45.0 - Add context ioctl stable pstate interface
> + * * 3.46.0 - Add context ioctl stable pstate interface

Please update the comment here to say something like bump for hotplug
handing.  With the typo and this fixed, series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>


>   */
>  #define KMS_DRIVER_MAJOR       3
> -#define KMS_DRIVER_MINOR       45
> +#define KMS_DRIVER_MINOR       46
>  #define KMS_DRIVER_PATCHLEVEL  0
>
>  int amdgpu_vram_limit;
> --
> 2.25.1
>

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

* Re: [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug.
  2022-03-01 18:07 [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Andrey Grodzovsky
  2022-03-01 18:08 ` [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing Andrey Grodzovsky
@ 2022-03-02  8:37 ` Christian König
  2022-03-02 17:49   ` Andrey Grodzovsky
  1 sibling, 1 reply; 5+ messages in thread
From: Christian König @ 2022-03-02  8:37 UTC (permalink / raw)
  To: Andrey Grodzovsky, amd-gfx; +Cc: Alexander.Deucher

Am 01.03.22 um 19:07 schrieb Andrey Grodzovsky:
> Protect with drm_dev_enter/exit
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

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

Regarding the version bumb you should probably sync up with Alex.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index f522b52725e4..4294f17cedcb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -23,6 +23,7 @@
>    */
>   
>   #include <drm/drm_auth.h>
> +#include <drm/drm_drv.h>
>   #include "amdgpu.h"
>   #include "amdgpu_sched.h"
>   #include "amdgpu_ras.h"
> @@ -339,7 +340,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
>   {
>   	struct amdgpu_ctx *ctx = container_of(ref, struct amdgpu_ctx, refcount);
>   	struct amdgpu_device *adev = ctx->adev;
> -	unsigned i, j;
> +	unsigned i, j, idx;
>   
>   	if (!adev)
>   		return;
> @@ -350,7 +351,12 @@ static void amdgpu_ctx_fini(struct kref *ref)
>   			ctx->entities[i][j] = NULL;
>   		}
>   	}
> -	amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
> +
> +	if (drm_dev_enter(&adev->ddev, &idx)) {
> +		amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
> +		drm_dev_exit(idx);
> +	}
> +
>   	kfree(ctx);
>   }
>   


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

* Re: [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug.
  2022-03-02  8:37 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Christian König
@ 2022-03-02 17:49   ` Andrey Grodzovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Andrey Grodzovsky @ 2022-03-02 17:49 UTC (permalink / raw)
  To: Christian König, amd-gfx; +Cc: Alexander.Deucher

Thanks, already did. Code pushed both here and in libdrm.

Andrey

On 2022-03-02 03:37, Christian König wrote:
> Am 01.03.22 um 19:07 schrieb Andrey Grodzovsky:
>> Protect with drm_dev_enter/exit
>>
>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com> for this one 
> here.
>
> Regarding the version bumb you should probably sync up with Alex.
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> index f522b52725e4..4294f17cedcb 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> @@ -23,6 +23,7 @@
>>    */
>>     #include <drm/drm_auth.h>
>> +#include <drm/drm_drv.h>
>>   #include "amdgpu.h"
>>   #include "amdgpu_sched.h"
>>   #include "amdgpu_ras.h"
>> @@ -339,7 +340,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
>>   {
>>       struct amdgpu_ctx *ctx = container_of(ref, struct amdgpu_ctx, 
>> refcount);
>>       struct amdgpu_device *adev = ctx->adev;
>> -    unsigned i, j;
>> +    unsigned i, j, idx;
>>         if (!adev)
>>           return;
>> @@ -350,7 +351,12 @@ static void amdgpu_ctx_fini(struct kref *ref)
>>               ctx->entities[i][j] = NULL;
>>           }
>>       }
>> -    amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
>> +
>> +    if (drm_dev_enter(&adev->ddev, &idx)) {
>> +        amdgpu_ctx_set_stable_pstate(ctx, 
>> AMDGPU_CTX_STABLE_PSTATE_NONE);
>> +        drm_dev_exit(idx);
>> +    }
>> +
>>       kfree(ctx);
>>   }
>

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

end of thread, other threads:[~2022-03-02 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 18:07 [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Andrey Grodzovsky
2022-03-01 18:08 ` [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing Andrey Grodzovsky
2022-03-01 18:34   ` Alex Deucher
2022-03-02  8:37 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Christian König
2022-03-02 17:49   ` Andrey Grodzovsky

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.