Skip to contentSkip to conversation

powerpc/pseries/dlpar: use rtas_get_sensor()

PATCH Applied Nathan Lynch 3 participants 3 messages May 4, 2021 – Jun 26, 2021 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/pseries/dlpar: use rtas_get_sensor()

Instead of making bare calls to get-sensor-state, use rtas_get_sensor(), which correctly handles busy and extended delay statuses.

Fixes ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
---
 arch/powerpc/platforms/pseries/dlpar.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/powerpc/platforms/pseries/dlpar.c +3 -6
index 3ac70790ec7a..b1f01ac0c29e 100644
@@ -289,8 +289,7 @@ int dlpar_acquire_drc(u32 drc_index)
 {
 	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-		       DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
 	if (rc || dr_status != DR_ENTITY_UNUSABLE)
 		return -1;
 
@@ -311,8 +310,7 @@ int dlpar_release_drc(u32 drc_index)
 {
 	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-		       DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
 	if (rc || dr_status != DR_ENTITY_PRESENT)
 		return -1;
 
@@ -333,8 +331,7 @@ int dlpar_unisolate_drc(u32 drc_index)
 {
 	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-				DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
 	if (rc || dr_status != DR_ENTITY_PRESENT)
 		return -1;
 
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw

Le 04/05/2021 à 04:53, Nathan Lynch a écrit :

Quoted 3 lines

Instead of making bare calls to get-sensor-state, use rtas_get_sensor(), which correctly handles busy and extended delay statuses.

Quoted 41 lines
Fixes ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
---
  arch/powerpc/platforms/pseries/dlpar.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
arch/powerpc/platforms/pseries/dlpar.c +3 -6
index 3ac70790ec7a..b1f01ac0c29e 100644
@@ -289,8 +289,7 @@ int dlpar_acquire_drc(u32 drc_index)
  {
  	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-		       DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
  	if (rc || dr_status != DR_ENTITY_UNUSABLE)
  		return -1;
 
@@ -311,8 +310,7 @@ int dlpar_release_drc(u32 drc_index)
  {
  	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-		       DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
  	if (rc || dr_status != DR_ENTITY_PRESENT)
  		return -1;
 
@@ -333,8 +331,7 @@ int dlpar_unisolate_drc(u32 drc_index)
  {
  	int dr_status, rc;
 
-	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
-				DR_ENTITY_SENSE, drc_index);
+	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
  	if (rc || dr_status != DR_ENTITY_PRESENT)
  		return -1;