All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Disable fan control if not supported
@ 2022-03-15 14:08 Elena Sakhnovitch
  2022-03-17 11:28 ` Lazar, Lijo
  0 siblings, 1 reply; 4+ messages in thread
From: Elena Sakhnovitch @ 2022-03-15 14:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Elena Sakhnovitch

On Sienna Cichild, not all platforms use PMFW based fan control. On such
ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon
knobs for fan control also as it is not possible to report or control
fan speed on such platforms through driver.

Signed-off-by: Elena Sakhnovitch  <elena.sakhnovitch@amd.com>
Change-Id: I42f9eb971a61a5ad63327607479fc7e9d9d6914d
---
 .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
index 38f04836c82f..23abb1d1f677 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
@@ -371,6 +371,18 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
 	}
 }
 
+static void sienna_cichlid_check_fan_support(struct smu_context *smu)
+{
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *pptable = table_context->driver_pptable;
+	/* No sort of fan control possible if PPTable has it disabled */
+	smu->adev->pm.no_fan =
+		!(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);
+	if (smu->adev->pm.no_fan)
+		dev_info_once(smu->adev->dev,
+			      "PMFW based fan control disabled");
+}
+
 static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
 {
 	struct smu_table_context *table_context = &smu->smu_table;
@@ -381,6 +393,7 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
 		smu->dc_controlled_by_gpio = true;
 
 	sienna_cichlid_check_bxco_support(smu);
+	sienna_cichlid_check_fan_support(smu);
 
 	table_context->thermal_controller_type =
 		powerplay_table->thermal_controller_type;
@@ -410,7 +423,7 @@ static int sienna_cichlid_append_powerplay_table(struct smu_context *smu)
 	GET_PPTABLE_MEMBER(I2cControllers, &table_member);
 	memcpy(table_member, smc_dpm_table->I2cControllers,
 			sizeof(*smc_dpm_table) - sizeof(smc_dpm_table->table_header));
-	
+
 	return 0;
 }
 
-- 
2.25.1


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

* Re: [PATCH] drm/amd/pm: Disable fan control if not supported
  2022-03-15 14:08 [PATCH] drm/amd/pm: Disable fan control if not supported Elena Sakhnovitch
@ 2022-03-17 11:28 ` Lazar, Lijo
  0 siblings, 0 replies; 4+ messages in thread
From: Lazar, Lijo @ 2022-03-17 11:28 UTC (permalink / raw)
  To: Elena Sakhnovitch, amd-gfx



On 3/15/2022 7:38 PM, Elena Sakhnovitch wrote:
> On Sienna Cichild, not all platforms use PMFW based fan control. On such
> ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon
> knobs for fan control also as it is not possible to report or control
> fan speed on such platforms through driver.
> 
> Signed-off-by: Elena Sakhnovitch  <elena.sakhnovitch@amd.com>
> Change-Id: I42f9eb971a61a5ad63327607479fc7e9d9d6914d
> ---
>   .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c   | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> index 38f04836c82f..23abb1d1f677 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> @@ -371,6 +371,18 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu)
>   	}
>   }
>   
> +static void sienna_cichlid_check_fan_support(struct smu_context *smu)
> +{
> +	struct smu_table_context *table_context = &smu->smu_table;
> +	PPTable_t *pptable = table_context->driver_pptable;
> +	/* No sort of fan control possible if PPTable has it disabled */
> +	smu->adev->pm.no_fan =
> +		!(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);

Nothing like FEATURE_FAN_CONTROL_MASK in smu11_driver_if_sienna_cichlid.h.

Also,

	#define FEATURE_FAN_CONTROL_BIT         32

and FeaturesToRun is uint32_t array.

Thanks,
Lijo

> +	if (smu->adev->pm.no_fan)
> +		dev_info_once(smu->adev->dev,
> +			      "PMFW based fan control disabled");
> +}
> +
>   static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
>   {
>   	struct smu_table_context *table_context = &smu->smu_table;
> @@ -381,6 +393,7 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
>   		smu->dc_controlled_by_gpio = true;
>   
>   	sienna_cichlid_check_bxco_support(smu);
> +	sienna_cichlid_check_fan_support(smu);
>   
>   	table_context->thermal_controller_type =
>   		powerplay_table->thermal_controller_type;
> @@ -410,7 +423,7 @@ static int sienna_cichlid_append_powerplay_table(struct smu_context *smu)
>   	GET_PPTABLE_MEMBER(I2cControllers, &table_member);
>   	memcpy(table_member, smc_dpm_table->I2cControllers,
>   			sizeof(*smc_dpm_table) - sizeof(smc_dpm_table->table_header));
> -	
> +
>   	return 0;
>   }
>   
> 

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

* Re: [PATCH] drm/amd/pm: Disable fan control if not supported
  2021-10-22  7:44 Lijo Lazar
@ 2021-10-22 13:06 ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2021-10-22 13:06 UTC (permalink / raw)
  To: Lijo Lazar
  Cc: amd-gfx list, Deucher, Alexander, Hawking Zhang,
	Harish Kasiviswanathan, Quan, Evan

On Fri, Oct 22, 2021 at 3:44 AM Lijo Lazar <lijo.lazar@amd.com> wrote:
>
> On arcturus, not all platforms use PMFW based fan control. On such
> ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon
> knobs for fan control also as it is not possible to report or control
> fan speed on such platforms through driver.
>
> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> index 082f01893f3d..fd1d30a93db5 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> @@ -436,6 +436,19 @@ static void arcturus_check_bxco_support(struct smu_context *smu)
>         }
>  }
>
> +static void arcturus_check_fan_support(struct smu_context *smu)
> +{
> +       struct smu_table_context *table_context = &smu->smu_table;
> +       PPTable_t *pptable = table_context->driver_pptable;
> +
> +       /* No sort of fan control possible if PPTable has it disabled */
> +       smu->adev->pm.no_fan =
> +               !(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);
> +       if (smu->adev->pm.no_fan)
> +               dev_info_once(smu->adev->dev,
> +                             "PMFW based fan control disabled");
> +}
> +
>  static int arcturus_check_powerplay_table(struct smu_context *smu)
>  {
>         struct smu_table_context *table_context = &smu->smu_table;
> @@ -443,6 +456,7 @@ static int arcturus_check_powerplay_table(struct smu_context *smu)
>                 table_context->power_play_table;
>
>         arcturus_check_bxco_support(smu);
> +       arcturus_check_fan_support(smu);
>
>         table_context->thermal_controller_type =
>                 powerplay_table->thermal_controller_type;
> --
> 2.17.1
>

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

* [PATCH] drm/amd/pm: Disable fan control if not supported
@ 2021-10-22  7:44 Lijo Lazar
  2021-10-22 13:06 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Lijo Lazar @ 2021-10-22  7:44 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Hawking.Zhang, Harish.Kasiviswanathan, Evan.Quan

On arcturus, not all platforms use PMFW based fan control. On such
ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon
knobs for fan control also as it is not possible to report or control
fan speed on such platforms through driver.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
index 082f01893f3d..fd1d30a93db5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
@@ -436,6 +436,19 @@ static void arcturus_check_bxco_support(struct smu_context *smu)
 	}
 }
 
+static void arcturus_check_fan_support(struct smu_context *smu)
+{
+	struct smu_table_context *table_context = &smu->smu_table;
+	PPTable_t *pptable = table_context->driver_pptable;
+
+	/* No sort of fan control possible if PPTable has it disabled */
+	smu->adev->pm.no_fan =
+		!(pptable->FeaturesToRun[0] & FEATURE_FAN_CONTROL_MASK);
+	if (smu->adev->pm.no_fan)
+		dev_info_once(smu->adev->dev,
+			      "PMFW based fan control disabled");
+}
+
 static int arcturus_check_powerplay_table(struct smu_context *smu)
 {
 	struct smu_table_context *table_context = &smu->smu_table;
@@ -443,6 +456,7 @@ static int arcturus_check_powerplay_table(struct smu_context *smu)
 		table_context->power_play_table;
 
 	arcturus_check_bxco_support(smu);
+	arcturus_check_fan_support(smu);
 
 	table_context->thermal_controller_type =
 		powerplay_table->thermal_controller_type;
-- 
2.17.1


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15 14:08 [PATCH] drm/amd/pm: Disable fan control if not supported Elena Sakhnovitch
2022-03-17 11:28 ` Lazar, Lijo
  -- strict thread matches above, loose matches on Subject: below --
2021-10-22  7:44 Lijo Lazar
2021-10-22 13:06 ` Alex Deucher

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.