All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor()
@ 2021-05-04  2:53 Nathan Lynch
  2021-05-04 12:42 ` Laurent Dufour
  2021-06-26 10:37 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Lynch @ 2021-05-04  2:53 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, ldufour

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")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/dlpar.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 3ac70790ec7a..b1f01ac0c29e 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -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;
 
-- 
2.30.2


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

* Re: [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor()
  2021-05-04  2:53 [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor() Nathan Lynch
@ 2021-05-04 12:42 ` Laurent Dufour
  2021-06-26 10:37 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Dufour @ 2021-05-04 12:42 UTC (permalink / raw)
  To: Nathan Lynch, linuxppc-dev; +Cc: tyreld

Le 04/05/2021 à 04:53, Nathan Lynch a écrit :
> Instead of making bare calls to get-sensor-state, use
> rtas_get_sensor(), which correctly handles busy and extended delay
> statuses.

Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> Fixes: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>   arch/powerpc/platforms/pseries/dlpar.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 3ac70790ec7a..b1f01ac0c29e 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -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;
>   
> 


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

* Re: [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor()
  2021-05-04  2:53 [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor() Nathan Lynch
  2021-05-04 12:42 ` Laurent Dufour
@ 2021-06-26 10:37 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-06-26 10:37 UTC (permalink / raw)
  To: linuxppc-dev, Nathan Lynch; +Cc: tyreld, ldufour

On Mon, 3 May 2021 21:53:29 -0500, Nathan Lynch wrote:
> Instead of making bare calls to get-sensor-state, use
> rtas_get_sensor(), which correctly handles busy and extended delay
> statuses.

Applied to powerpc/next.

[1/1] powerpc/pseries/dlpar: use rtas_get_sensor()
      https://git.kernel.org/powerpc/c/bfb0c9fcf5870036e54081b28cae2af5f9ee7088

cheers

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

end of thread, other threads:[~2021-06-26 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04  2:53 [PATCH] powerpc/pseries/dlpar: use rtas_get_sensor() Nathan Lynch
2021-05-04 12:42 ` Laurent Dufour
2021-06-26 10:37 ` Michael Ellerman

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.