AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO
@ 2023-08-09 19:09 Alex Deucher
  2023-08-09 19:09 ` [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alex Deucher @ 2023-08-09 19:09 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

We need the domains in amdgpu_drm.h for the kernel driver to manage
the pool, but we don't want userspace using it until the code
is ready.  So reject for now.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 693b1fd1191a..ca4d2d430e28 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -289,6 +289,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 	uint32_t handle, initial_domain;
 	int r;
 
+	/* reject DOORBELLs until userspace code to use it is available */
+	if (args->in.domains & AMDGPU_GEM_DOMAIN_DOORBELL)
+		return -EINVAL;
+
 	/* reject invalid gem flags */
 	if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
 		      AMDGPU_GEM_CREATE_NO_CPU_ACCESS |
-- 
2.41.0


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

* [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland"
  2023-08-09 19:09 [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
@ 2023-08-09 19:09 ` Alex Deucher
  2023-08-10 15:20 ` [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
  2023-08-11 14:02 ` Felix Kuehling
  2 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2023-08-09 19:09 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

This reverts commit e490d60a2f76bff636c68ce4fe34c1b6c34bbd86.

This causes hangs on SI when DC is enabled.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2755
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 02e69ccff3ba..d6d9e3b1b2c0 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -6925,6 +6925,23 @@ static int si_dpm_enable(struct amdgpu_device *adev)
 	return 0;
 }
 
+static int si_set_temperature_range(struct amdgpu_device *adev)
+{
+	int ret;
+
+	ret = si_thermal_enable_alert(adev, false);
+	if (ret)
+		return ret;
+	ret = si_thermal_set_temperature_range(adev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+	if (ret)
+		return ret;
+	ret = si_thermal_enable_alert(adev, true);
+	if (ret)
+		return ret;
+
+	return ret;
+}
+
 static void si_dpm_disable(struct amdgpu_device *adev)
 {
 	struct rv7xx_power_info *pi = rv770_get_pi(adev);
@@ -7609,6 +7626,18 @@ static int si_dpm_process_interrupt(struct amdgpu_device *adev,
 
 static int si_dpm_late_init(void *handle)
 {
+	int ret;
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	if (!adev->pm.dpm_enabled)
+		return 0;
+
+	ret = si_set_temperature_range(adev);
+	if (ret)
+		return ret;
+#if 0 //TODO ?
+	si_dpm_powergate_uvd(adev, true);
+#endif
 	return 0;
 }
 
-- 
2.41.0


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

* Re: [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO
  2023-08-09 19:09 [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
  2023-08-09 19:09 ` [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
@ 2023-08-10 15:20 ` Alex Deucher
  2023-08-11 13:46   ` Alex Deucher
  2023-08-11 14:02 ` Felix Kuehling
  2 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2023-08-10 15:20 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx

Ping?

On Wed, Aug 9, 2023 at 3:10 PM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> We need the domains in amdgpu_drm.h for the kernel driver to manage
> the pool, but we don't want userspace using it until the code
> is ready.  So reject for now.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 693b1fd1191a..ca4d2d430e28 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -289,6 +289,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>         uint32_t handle, initial_domain;
>         int r;
>
> +       /* reject DOORBELLs until userspace code to use it is available */
> +       if (args->in.domains & AMDGPU_GEM_DOMAIN_DOORBELL)
> +               return -EINVAL;
> +
>         /* reject invalid gem flags */
>         if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
>                       AMDGPU_GEM_CREATE_NO_CPU_ACCESS |
> --
> 2.41.0
>

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

* Re: [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO
  2023-08-10 15:20 ` [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
@ 2023-08-11 13:46   ` Alex Deucher
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2023-08-11 13:46 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx

Ping?

On Thu, Aug 10, 2023 at 11:20 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> Ping?
>
> On Wed, Aug 9, 2023 at 3:10 PM Alex Deucher <alexander.deucher@amd.com> wrote:
> >
> > We need the domains in amdgpu_drm.h for the kernel driver to manage
> > the pool, but we don't want userspace using it until the code
> > is ready.  So reject for now.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > index 693b1fd1191a..ca4d2d430e28 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > @@ -289,6 +289,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
> >         uint32_t handle, initial_domain;
> >         int r;
> >
> > +       /* reject DOORBELLs until userspace code to use it is available */
> > +       if (args->in.domains & AMDGPU_GEM_DOMAIN_DOORBELL)
> > +               return -EINVAL;
> > +
> >         /* reject invalid gem flags */
> >         if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
> >                       AMDGPU_GEM_CREATE_NO_CPU_ACCESS |
> > --
> > 2.41.0
> >

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

* Re: [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO
  2023-08-09 19:09 [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
  2023-08-09 19:09 ` [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
  2023-08-10 15:20 ` [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
@ 2023-08-11 14:02 ` Felix Kuehling
  2 siblings, 0 replies; 7+ messages in thread
From: Felix Kuehling @ 2023-08-11 14:02 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx

Am 2023-08-09 um 15:09 schrieb Alex Deucher:
> We need the domains in amdgpu_drm.h for the kernel driver to manage
> the pool, but we don't want userspace using it until the code
> is ready.  So reject for now.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

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


> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 693b1fd1191a..ca4d2d430e28 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -289,6 +289,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>   	uint32_t handle, initial_domain;
>   	int r;
>   
> +	/* reject DOORBELLs until userspace code to use it is available */
> +	if (args->in.domains & AMDGPU_GEM_DOMAIN_DOORBELL)
> +		return -EINVAL;
> +
>   	/* reject invalid gem flags */
>   	if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
>   		      AMDGPU_GEM_CREATE_NO_CPU_ACCESS |

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

* [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland"
@ 2024-02-26 22:47 Alex Deucher
  2024-02-26 22:56 ` Wang, Yang(Kevin)
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2024-02-26 22:47 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

This reverts commit e490d60a2f76bff636c68ce4fe34c1b6c34bbd86.

This causes hangs on SI when DC is enabled and errors on driver
reboot and power off cycles.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3216
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2755
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index e145d53a794ba..a586e0b7c47d1 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -6927,6 +6927,23 @@ static int si_dpm_enable(struct amdgpu_device *adev)
 	return 0;
 }
 
+static int si_set_temperature_range(struct amdgpu_device *adev)
+{
+	int ret;
+
+	ret = si_thermal_enable_alert(adev, false);
+	if (ret)
+		return ret;
+	ret = si_thermal_set_temperature_range(adev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+	if (ret)
+		return ret;
+	ret = si_thermal_enable_alert(adev, true);
+	if (ret)
+		return ret;
+
+	return ret;
+}
+
 static void si_dpm_disable(struct amdgpu_device *adev)
 {
 	struct rv7xx_power_info *pi = rv770_get_pi(adev);
@@ -7610,6 +7627,18 @@ static int si_dpm_process_interrupt(struct amdgpu_device *adev,
 
 static int si_dpm_late_init(void *handle)
 {
+	int ret;
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	if (!adev->pm.dpm_enabled)
+		return 0;
+
+	ret = si_set_temperature_range(adev);
+	if (ret)
+		return ret;
+#if 0 //TODO ?
+	si_dpm_powergate_uvd(adev, true);
+#endif
 	return 0;
 }
 
-- 
2.43.2


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

* RE: [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland"
  2024-02-26 22:47 [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
@ 2024-02-26 22:56 ` Wang, Yang(Kevin)
  0 siblings, 0 replies; 7+ messages in thread
From: Wang, Yang(Kevin) @ 2024-02-26 22:56 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx@lists.freedesktop.org; +Cc: Deucher, Alexander

[AMD Official Use Only - General]

Reviewed-by: Yang Wang <kevinyang.wang@amd.com>

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Tuesday, February 27, 2024 6:47 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland"

This reverts commit e490d60a2f76bff636c68ce4fe34c1b6c34bbd86.

This causes hangs on SI when DC is enabled and errors on driver reboot and power off cycles.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3216
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2755
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index e145d53a794ba..a586e0b7c47d1 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -6927,6 +6927,23 @@ static int si_dpm_enable(struct amdgpu_device *adev)
        return 0;
 }

+static int si_set_temperature_range(struct amdgpu_device *adev) {
+       int ret;
+
+       ret = si_thermal_enable_alert(adev, false);
+       if (ret)
+               return ret;
+       ret = si_thermal_set_temperature_range(adev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+       if (ret)
+               return ret;
+       ret = si_thermal_enable_alert(adev, true);
+       if (ret)
+               return ret;
+
+       return ret;
+}
+
 static void si_dpm_disable(struct amdgpu_device *adev)  {
        struct rv7xx_power_info *pi = rv770_get_pi(adev); @@ -7610,6 +7627,18 @@ static int si_dpm_process_interrupt(struct amdgpu_device *adev,

 static int si_dpm_late_init(void *handle)  {
+       int ret;
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+       if (!adev->pm.dpm_enabled)
+               return 0;
+
+       ret = si_set_temperature_range(adev);
+       if (ret)
+               return ret;
+#if 0 //TODO ?
+       si_dpm_powergate_uvd(adev, true);
+#endif
        return 0;
 }

--
2.43.2


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

end of thread, other threads:[~2024-02-26 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 19:09 [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
2023-08-09 19:09 ` [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
2023-08-10 15:20 ` [PATCH] drm/amdgpu: don't allow userspace to create a doorbell BO Alex Deucher
2023-08-11 13:46   ` Alex Deucher
2023-08-11 14:02 ` Felix Kuehling
  -- strict thread matches above, loose matches on Subject: below --
2024-02-26 22:47 [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" Alex Deucher
2024-02-26 22:56 ` Wang, Yang(Kevin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox