Skip to contentSkip to conversation

drm/amd/powerplay: add smu_smc_read_sensor support for arcturus

PATCH In review Wang, Kevin(Yang) 3 participants 4 messages Aug 16, 2019 – Aug 20, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/powerplay: add smu_smc_read_sensor support for arcturus

the bellow patch refine the sensor read sequence, but missed to add arcuturs support. (arcuturs_ppt.c)

drm/amd/powerplay: change smu_read_sensor sequence in smu

---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +4 -1
index fcf623cf5d2c..850b2a1ef329 100644
@@ -1012,6 +1012,9 @@ static int arcturus_read_sensor(struct smu_context *smu,
 	PPTable_t *pptable = table_context->driver_pptable;
 	int ret = 0;
 
+	if(!data || !size)
+		return -EINVAL;
+
 	switch (sensor) {
 	case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
 		*(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1036,7 +1039,7 @@ static int arcturus_read_sensor(struct smu_context *smu,
 		*size = 4;
 		break;
 	default:
-		return -EINVAL;
+		ret = smu_smc_read_sensor(smu, sensor, data, size);
 	}
 
 	return ret;
Signature · 6 lines
2.22.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive

Without this patch, there will be missing many sensor support on arcturus. Better to declare this in descriptions or patch header.
With that fixed, the patch is reviewed-by: Evan Quan <[email protected]>

Regards,
Evan

Quoted 45 lines

-----Original Message-----
From: Wang, Kevin(Yang) <[email protected]>
Sent: Friday, August 16, 2019 3:22 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>; Huang, Ray <[email protected]>; Feng, Kenneth <[email protected]>; Wang, Kevin(Yang) <[email protected]>
Subject: [PATCH] drm/amd/powerplay: add smu_smc_read_sensor support for arcturus

the bellow patch refine the sensor read sequence, but missed to add arcuturs support. (arcuturs_ppt.c)

drm/amd/powerplay: change smu_read_sensor sequence in smu

---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -0
index fcf623cf5d2c..850b2a1ef329 100644
@@ -1012,6 +1012,9 @@ static int arcturus_read_sensor(struct smu_context
 *smu,
 	PPTable_t *pptable = table_context->driver_pptable;
 	int ret = 0;
 
+	if(!data || !size)
+		return -EINVAL;
+
 	switch (sensor) {
 	case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +1 -1
 		*(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1036,7 +1039,7 @@ static int arcturus_read_sensor(struct smu_context
 *smu,
 		*size = 4;
 		break;
 	default:
-		return -EINVAL;
+		ret = smu_smc_read_sensor(smu, sensor, data, size);
 	}
 
Quoted 3 lines

return ret;
--
2.22.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 16 lines · Kevin(Yang)

the bellow patch refine the sensor read sequence, but missed to add arcuturs support. (arcuturs_ppt.c)

drm/amd/powerplay: change smu_read_sensor sequence in smu

---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +0 -0
index fcf623cf5d2c..850b2a1ef329 100644

drivers/gpu/drm/amd/powerplay/arcturus_ppt.c static int arcturus_read_sensor(struct smu_context *smu, · line 1015

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +1 -0
@@ -1012,6 +1012,9 @@ static int arcturus_read_sensor(struct smu_context *smu,
        PPTable_t *pptable = table_context->driver_pptable;
        int ret = 0;
 
+       if(!data || !size)

Please add a space between if the if and the (. E.g., if (!data || !size)

Alex

Quoted 17 lines
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -2
+               return -EINVAL;
+
        switch (sensor) {
        case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
                *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1036,7 +1039,7 @@ static int arcturus_read_sensor(struct smu_context *smu,
                *size = 4;
                break;
        default:
-               return -EINVAL;
+               ret = smu_smc_read_sensor(smu, sensor, data, size);
        }
 
        return ret;
--

2.22.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

________________________________
From: Alex Deucher <[email protected]>
Sent: Monday, August 19, 2019 11:33 PM
To: Wang, Kevin(Yang) <[email protected]>
Cc: [email protected] <[email protected]>; Feng, Kenneth <[email protected]>; Quan, Evan <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: add smu_smc_read_sensor support for arcturus

Quoted 16 lines · Kevin(Yang)

the bellow patch refine the sensor read sequence, but missed to add arcuturs support. (arcuturs_ppt.c)

drm/amd/powerplay: change smu_read_sensor sequence in smu

---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +0 -0
index fcf623cf5d2c..850b2a1ef329 100644

drivers/gpu/drm/amd/powerplay/arcturus_ppt.c static int arcturus_read_sensor(struct smu_context *smu, · line 1015

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +1 -0
@@ -1012,6 +1012,9 @@ static int arcturus_read_sensor(struct smu_context *smu,
        PPTable_t *pptable = table_context->driver_pptable;
        int ret = 0;
 
+       if(!data || !size)

Please add a space between if the if and the (. E.g., if (!data || !size)

Alex

[kevin]:
thanks, i will correct it.

Quoted 17 lines
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -2
+               return -EINVAL;
+
        switch (sensor) {
        case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
                *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1036,7 +1039,7 @@ static int arcturus_read_sensor(struct smu_context *smu,
                *size = 4;
                break;
        default:
-               return -EINVAL;
+               ret = smu_smc_read_sensor(smu, sensor, data, size);
        }
 
        return ret;
--

2.22.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx