]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
powerpc/pseries/dlpar: handle ibm, configure-connector delay status
authorNathan Lynch <nathanl@linux.ibm.com>
Thu, 7 Jan 2021 02:59:00 +0000 (20:59 -0600)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:32 +0000 (18:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1918974
[ Upstream commit 768d70e19ba525debd571b36e6d0ab19956c63d7 ]

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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210107025900.410369-1-nathanl@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/powerpc/platforms/pseries/dlpar.c

index 16e86ba8aa2099d1356f941c8e1549f14a152dbf..f6b7749d6ada7c5e9643078d955b54b1d15f119f 100644 (file)
@@ -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: