linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
@ 2021-01-07  2:59 Nathan Lynch
  2021-02-05 13:15 ` Nathan Lynch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nathan Lynch @ 2021-01-07  2:59 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, brking

dlpar_configure_connector() has two problems in its handling of
ibm,configure-connector's return status:

1. When the status is -2 (busy, call again), we call
   ibm,configure-connector again immediately without checking whether
   to schedule, which can result in monopolizing the CPU.
2. Extended delay status (9900..9905) goes completely unhandled,
   causing the configuration to unnecessarily terminate.

Fix both of these issues by using rtas_busy_delay().

Fixes: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/dlpar.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 16e86ba8aa20..f6b7749d6ada 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -127,7 +127,6 @@ void dlpar_free_cc_nodes(struct device_node *dn)
 #define NEXT_PROPERTY   3
 #define PREV_PARENT     4
 #define MORE_MEMORY     5
-#define CALL_AGAIN	-2
 #define ERR_CFG_USE     -9003
 
 struct device_node *dlpar_configure_connector(__be32 drc_index,
@@ -168,6 +167,9 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
 
 		spin_unlock(&rtas_data_buf_lock);
 
+		if (rtas_busy_delay(rc))
+			continue;
+
 		switch (rc) {
 		case COMPLETE:
 			break;
@@ -216,9 +218,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
 			last_dn = last_dn->parent;
 			break;
 
-		case CALL_AGAIN:
-			break;
-
 		case MORE_MEMORY:
 		case ERR_CFG_USE:
 		default:
-- 
2.29.2


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

* Re: [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
  2021-01-07  2:59 [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status Nathan Lynch
@ 2021-02-05 13:15 ` Nathan Lynch
  2021-02-05 19:46 ` [PATCH] powerpc/pseries/dlpar: handle ibm,configure-connector " Tyrel Datwyler
  2021-02-10 12:57 ` [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector " Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Lynch @ 2021-02-05 13:15 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, brking, Laurent Dufour, Scott Cheloha

Nathan Lynch <nathanl@linux.ibm.com> writes:
> dlpar_configure_connector() has two problems in its handling of
> ibm,configure-connector's return status:
>
> 1. When the status is -2 (busy, call again), we call
>    ibm,configure-connector again immediately without checking whether
>    to schedule, which can result in monopolizing the CPU.
> 2. Extended delay status (9900..9905) goes completely unhandled,
>    causing the configuration to unnecessarily terminate.
>
> Fix both of these issues by using rtas_busy_delay().
>
> Fixes: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>

Just following up and adding some people to cc in hopes of getting some
review for this.


> ---
>  arch/powerpc/platforms/pseries/dlpar.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 16e86ba8aa20..f6b7749d6ada 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -127,7 +127,6 @@ void dlpar_free_cc_nodes(struct device_node *dn)
>  #define NEXT_PROPERTY   3
>  #define PREV_PARENT     4
>  #define MORE_MEMORY     5
> -#define CALL_AGAIN	-2
>  #define ERR_CFG_USE     -9003
>  
>  struct device_node *dlpar_configure_connector(__be32 drc_index,
> @@ -168,6 +167,9 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
>  
>  		spin_unlock(&rtas_data_buf_lock);
>  
> +		if (rtas_busy_delay(rc))
> +			continue;
> +
>  		switch (rc) {
>  		case COMPLETE:
>  			break;
> @@ -216,9 +218,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
>  			last_dn = last_dn->parent;
>  			break;
>  
> -		case CALL_AGAIN:
> -			break;
> -
>  		case MORE_MEMORY:
>  		case ERR_CFG_USE:
>  		default:
> -- 
> 2.29.2

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

* Re: [PATCH] powerpc/pseries/dlpar: handle ibm,configure-connector delay status
  2021-01-07  2:59 [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status Nathan Lynch
  2021-02-05 13:15 ` Nathan Lynch
@ 2021-02-05 19:46 ` Tyrel Datwyler
  2021-02-10 12:57 ` [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector " Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Tyrel Datwyler @ 2021-02-05 19:46 UTC (permalink / raw)
  To: Nathan Lynch, linuxppc-dev; +Cc: brking

On 1/6/21 6:59 PM, Nathan Lynch wrote:
> dlpar_configure_connector() has two problems in its handling of
> ibm,configure-connector's return status:
> 
> 1. When the status is -2 (busy, call again), we call
>    ibm,configure-connector again immediately without checking whether
>    to schedule, which can result in monopolizing the CPU.
> 2. Extended delay status (9900..9905) goes completely unhandled,
>    causing the configuration to unnecessarily terminate.
> 
> Fix both of these issues by using rtas_busy_delay().
> 
> Fixes: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>

Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>


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

* Re: [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
  2021-01-07  2:59 [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status Nathan Lynch
  2021-02-05 13:15 ` Nathan Lynch
  2021-02-05 19:46 ` [PATCH] powerpc/pseries/dlpar: handle ibm,configure-connector " Tyrel Datwyler
@ 2021-02-10 12:57 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Nathan Lynch; +Cc: tyreld, brking

On Wed, 6 Jan 2021 20:59:00 -0600, Nathan Lynch wrote:
> dlpar_configure_connector() has two problems in its handling of
> ibm,configure-connector's return status:
> 
> 1. When the status is -2 (busy, call again), we call
>    ibm,configure-connector again immediately without checking whether
>    to schedule, which can result in monopolizing the CPU.
> 2. Extended delay status (9900..9905) goes completely unhandled,
>    causing the configuration to unnecessarily terminate.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
      https://git.kernel.org/powerpc/c/768d70e19ba525debd571b36e6d0ab19956c63d7

cheers

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

end of thread, other threads:[~2021-02-10 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07  2:59 [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status Nathan Lynch
2021-02-05 13:15 ` Nathan Lynch
2021-02-05 19:46 ` [PATCH] powerpc/pseries/dlpar: handle ibm,configure-connector " Tyrel Datwyler
2021-02-10 12:57 ` [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector " Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).