Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3543862pxb; Mon, 1 Mar 2021 12:52:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyawCCC2OE1yYsdNUxKWCPOgSMMEN/ggd1U4iNo/vj82GZqriNIlZITlTD0F4Oiry2rn5/K X-Received: by 2002:a17:906:4f96:: with SMTP id o22mr17178479eju.511.1614631953721; Mon, 01 Mar 2021 12:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614631953; cv=none; d=google.com; s=arc-20160816; b=l6N9JR3NGbgdWhOxYirBEk1AbEdsClflxFR9L5PsX1PiDzzMpor7lsyEw2LZIVWFZq TZfyiq6TkzqmUkFPPNq7xcID6X7wed0bu3ymOdV8/lXbGm6LZh5tvgqC7M3E2GquBQFW +U6bUvRrG9xJRi8tBjth58yml6QvmlLY8y/71bo6Q0sLlP0mr8tlwlvQtjGWbtebga/G LvkYjmxxpxeuKTCdL8HrfbKtX3mP62K3hjRN9lXZ7OmJjbogo/uIpZyDILikGHO3Houv BkcH4ik1uLUeK1e1cmiXF/WowroMCNXK5oPfHENkUzqxpu14P46U4affOTfFcG6pfIPO xjxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qwceiKTMpfiDN1vx7HCh/yC+Rrmaq4r2BO45q8rOfRE=; b=GgnRpAoNvxTwrWWDUWrtpubu9oNRf6CTTum3R5Tq0YVLw3LzjO9CtuDXEXMdGXSOtn GWVseQRgCpqDhjNDlggBUiXR3zn3abTjuPF1KNxnok+8T5h+4vDjYVKT5bR/a9hOZFj1 iQILP7YvaGGF24FBSNlXmU6/E54LGCc88oA6VgDSJHOO7wVvqKxvdL+rL4Pdb/o0GzgR 7KKI6Xq7WEOZ4qTZSx7Ke1lIEBb3JoWAHWwiZqC8PAj7KdipAsir0QU3KMG7I5ZY4iBk cgam46c9vqurbT4Qk2htN+eWB+ywqAp7bo2CqrCCZpioz7lauhk8PIAR2RS7vYWI8S9P t4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tBBD3MZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si12134752ejr.574.2021.03.01.12.52.10; Mon, 01 Mar 2021 12:52:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tBBD3MZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243852AbhCAUsg (ORCPT + 99 others); Mon, 1 Mar 2021 15:48:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:35320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236704AbhCARIk (ORCPT ); Mon, 1 Mar 2021 12:08:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC89165019; Mon, 1 Mar 2021 16:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616934; bh=/JeN3MiUz8mnPID3TksMkvGLfya8EPfL0g0jDHGNesM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBBD3MZ82NuWWB92acNwGvdieoGz252jDDnC06YDeiA0cxN2Xoe1coZvhwGIkiRNg nrbxz3b0FpWfi/MYlEX5dHbBZxtnfQNZCW5UchOGSFRaGiowX6kTVsO+lGzc3fTVnB 7pNAGphphZrXRSFlnc50odJA/nACr5tn0EpalYkc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Tyrel Datwyler , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 145/247] powerpc/pseries/dlpar: handle ibm, configure-connector delay status Date: Mon, 1 Mar 2021 17:12:45 +0100 Message-Id: <20210301161038.772488771@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Lynch [ 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 Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210107025900.410369-1-nathanl@linux.ibm.com Signed-off-by: Sasha Levin --- 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 c5ffcadab7302..90fd03b9d3c25 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -132,7 +132,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, @@ -173,6 +172,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; @@ -221,9 +223,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.27.0