Skip to content

Commit b7d5333

Browse files
nathanlynchmpe
authored andcommitted
powerpc/pseries/setup: add missing RTAS retry status handling
The ibm,get-system-parameter RTAS function may return -2 or 990x, which indicate that the caller should try again. pSeries_cmo_feature_init() ignores this, making it possible to fail to detect cooperative memory overcommit capabilities during boot. Move the RTAS call into a conventional rtas_busy_delay()-based loop, dropping unnecessary clearing of rtas_data_buf. Signed-off-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5d08633 commit b7d5333

File tree

1 file changed

+12
-8
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+12
-8
lines changed

arch/powerpc/platforms/pseries/setup.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -941,21 +941,25 @@ void pSeries_coalesce_init(void)
941941
*/
942942
static void __init pSeries_cmo_feature_init(void)
943943
{
944+
const s32 token = rtas_token("ibm,get-system-parameter");
944945
char *ptr, *key, *value, *end;
945946
int call_status;
946947
int page_order = IOMMU_PAGE_SHIFT_4K;
947948

948949
pr_debug(" -> fw_cmo_feature_init()\n");
949-
spin_lock(&rtas_data_buf_lock);
950-
memset(rtas_data_buf, 0, RTAS_DATA_BUF_SIZE);
951-
call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
952-
NULL,
953-
CMO_CHARACTERISTICS_TOKEN,
954-
__pa(rtas_data_buf),
955-
RTAS_DATA_BUF_SIZE);
956950

957-
if (call_status != 0) {
951+
do {
952+
spin_lock(&rtas_data_buf_lock);
953+
call_status = rtas_call(token, 3, 1, NULL,
954+
CMO_CHARACTERISTICS_TOKEN,
955+
__pa(rtas_data_buf),
956+
RTAS_DATA_BUF_SIZE);
957+
if (call_status == 0)
958+
break;
958959
spin_unlock(&rtas_data_buf_lock);
960+
} while (rtas_busy_delay(call_status));
961+
962+
if (call_status != 0) {
959963
pr_debug("CMO not available\n");
960964
pr_debug(" <- fw_cmo_feature_init()\n");
961965
return;

0 commit comments

Comments
 (0)