Skip to contentSkip to conversation

drm/amd/pm: Skip power state allocation

PATCH In review Lijo Lazar 3 participants 3 messages Dec 14, 2021

Subsystems (3)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Skip power state allocation

Power states are not valid for arcturus and aldebaran, no need to allocate memory.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c  | 10 ----------
 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 10 ----------
 2 files changed, 20 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +0 -10
index 05defeee0c87..58bc387fb279 100644
@@ -295,16 +295,6 @@ static int arcturus_allocate_dpm_context(struct smu_context *smu)
 		return -ENOMEM;
 	smu_dpm->dpm_context_size = sizeof(struct smu_11_0_dpm_context);
 
-	smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-				       GFP_KERNEL);
-	if (!smu_dpm->dpm_current_power_state)
-		return -ENOMEM;
-
-	smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-				       GFP_KERNEL);
-	if (!smu_dpm->dpm_request_power_state)
-		return -ENOMEM;
-
 	return 0;
 }
 
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -10
index 6e781cee8bb6..0907da022197 100644
@@ -262,16 +262,6 @@ static int aldebaran_allocate_dpm_context(struct smu_context *smu)
 		return -ENOMEM;
 	smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context);
 
-	smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-						   GFP_KERNEL);
-	if (!smu_dpm->dpm_current_power_state)
-		return -ENOMEM;
-
-	smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-						   GFP_KERNEL);
-	if (!smu_dpm->dpm_request_power_state)
-		return -ENOMEM;
-
 	return 0;
 }
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

Best Regards,
Kevin
________________________________
From: Lazar, Lijo <[email protected]>
Sent: Tuesday, December 14, 2021 3:12 PM
To: [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: Skip power state allocation

Power states are not valid for arcturus and aldebaran, no need to allocate memory.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c  | 10 ----------
 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 10 ----------
 2 files changed, 20 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +0 -10
index 05defeee0c87..58bc387fb279 100644
@@ -295,16 +295,6 @@ static int arcturus_allocate_dpm_context(struct smu_context *smu)
                 return -ENOMEM;
         smu_dpm->dpm_context_size = sizeof(struct smu_11_0_dpm_context);
 
-       smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-                                      GFP_KERNEL);
-       if (!smu_dpm->dpm_current_power_state)
-               return -ENOMEM;
-
-       smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-                                      GFP_KERNEL);
-       if (!smu_dpm->dpm_request_power_state)
-               return -ENOMEM;
-
         return 0;
 }
 
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -10
index 6e781cee8bb6..0907da022197 100644
@@ -262,16 +262,6 @@ static int aldebaran_allocate_dpm_context(struct smu_context *smu)
                 return -ENOMEM;
         smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context);
 
-       smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-                                                  GFP_KERNEL);
-       if (!smu_dpm->dpm_current_power_state)
-               return -ENOMEM;
-
-       smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-                                                  GFP_KERNEL);
-       if (!smu_dpm->dpm_request_power_state)
-               return -ENOMEM;
-
         return 0;
 }
 

--
2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Lijo Lazar

[AMD Official Use Only]

Quoted 72 lines

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Tuesday, December 14, 2021 3:13 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: Skip power state allocation

Power states are not valid for arcturus and aldebaran, no need to allocate memory.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c  | 10 ----------
 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 10 ----------
 2 files changed, 20 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +0 -6
index 05defeee0c87..58bc387fb279 100644
@@ -295,16 +295,6 @@ static int arcturus_allocate_dpm_context(struct
 smu_context *smu)
 		return -ENOMEM;
 	smu_dpm->dpm_context_size = sizeof(struct
 smu_11_0_dpm_context);
 
-	smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct
 smu_power_state),
-				       GFP_KERNEL);
-	if (!smu_dpm->dpm_current_power_state)
-		return -ENOMEM;
-
-	smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct

smu_power_state),

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +0 -4
-				       GFP_KERNEL);
-	if (!smu_dpm->dpm_request_power_state)
-		return -ENOMEM;
-
 	return 0;
 }
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -6
index 6e781cee8bb6..0907da022197 100644
@@ -262,16 +262,6 @@ static int aldebaran_allocate_dpm_context(struct
 smu_context *smu)
 		return -ENOMEM;
 	smu_dpm->dpm_context_size = sizeof(struct
 smu_13_0_dpm_context);
 
-	smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct
 smu_power_state),
-						   GFP_KERNEL);
-	if (!smu_dpm->dpm_current_power_state)
-		return -ENOMEM;
-
-	smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct

smu_power_state),

drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -5
-						   GFP_KERNEL);
-	if (!smu_dpm->dpm_request_power_state)
-		return -ENOMEM;
-
 	return 0;
 }
 
--

2.25.1