Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224892/?format=api
{ "id": 2224892, "url": "http://patchwork.ozlabs.org/api/patches/2224892/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260419065039.23495-1-adri.vero.dev@gmail.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260419065039.23495-1-adri.vero.dev@gmail.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260419065039.23495-1-adri.vero.dev@gmail.com/", "date": "2026-04-19T06:50:39", "name": "[v2] powerpc/fadump: Add timeout to RTAS busy-wait loops", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f3770918cb1d51b5c88b17fae6e0a76cec5c5cf4", "submitter": { "id": 93190, "url": "http://patchwork.ozlabs.org/api/people/93190/?format=api", "name": "Adriano Vero", "email": "adri.vero.dev@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260419065039.23495-1-adri.vero.dev@gmail.com/mbox/", "series": [ { "id": 500498, "url": "http://patchwork.ozlabs.org/api/series/500498/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=500498", "date": "2026-04-19T06:50:39", "name": "[v2] powerpc/fadump: Add timeout to RTAS busy-wait loops", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/500498/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224892/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/2224892/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19842-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=FMT/txXI;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19842-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2a00:1450:4864:20::42c\"", "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=FMT/txXI;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com\n (client-ip=2a00:1450:4864:20::42c; helo=mail-wr1-x42c.google.com;\n envelope-from=adri.vero.dev@gmail.com; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fz7W86rXGz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 19 Apr 2026 22:40:19 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fz7W44ZPmz2yrZ;\n\tSun, 19 Apr 2026 22:40:16 +1000 (AEST)", "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n [IPv6:2a00:1450:4864:20::42c])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fz0Kk73d0z2xJT\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 19 Apr 2026 17:16:42 +1000 (AEST)", "by mail-wr1-x42c.google.com with SMTP id\n ffacd0b85a97d-43cfde3c3f3so2189709f8f.3\n for <linuxppc-dev@lists.ozlabs.org>;\n Sun, 19 Apr 2026 00:16:42 -0700 (PDT)", "from fedora.homenet.telecomitalia.it\n (host-80-117-127-126.pool80117.interbusiness.it. [80.117.127.126])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43fe4cc0f31sm18865676f8f.12.2026.04.19.00.16.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 19 Apr 2026 00:16:38 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776583004;\n\tcv=none;\n b=JZBkSotvNGACThBcE7kFsOkWJvvbVzwZ2GhhwqqInu+dMqGpSW6llDdEE6MtoyyHIzh83OPXFDcU0NJP3sg198UowEqxHwrDqf12KC9U8mMcSQ/y9E3hmSHOCN4RE2utIGiyoArvihN0zsXyhdPji63yw2OxdysaOlCm3+gypNZrQbVaa5jKEvKl/Jos4/Ax1b8YD9VfPcu5iiIJ0Xt14kKhFWqWFpYuZHGmImgGkWBNrU2QiLxDxayKh+Ty9HOCLBN+VzRowlzR5ep7UECWwZ/L/Ek2iWnZnm6htCgvXhI5LLzoNkDJQcpk9Lpz95THfPupT/o3CSZNAu13WdUQUA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1776583004; c=relaxed/relaxed;\n\tbh=e633J0iM4T36U0Ykk5jiq+vFzcuBQkCCmEghwzPCf5A=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=onSQk4PLozH3UMIy+jJkmmrEHFntHGb4RvqW3uFsLvWzuJudI+7NGXuHYDGArY33ryjlDG13kw95veinNhGQi5qEUMeM7puLHGgnjUeLd6sPQkpccj0OzAMdOCnPQ82SEE0iFDBJgMuBOizHdnc6ENgEQ/Ar5SXget6beuMkEtC4kvAtVwol2UiDaiaW+hJZdy+5T3SpADOqD+UzieVabXQXS/HGo6G48QxlukEGBlMMZxXJpKEGM8GKqmG1UHL7Ukt+9Ebsp6by88bSrtzu4GvKC+leCLisRAY7+SLei1QOvjI/5murkKuLDNW8i+moCeO1uZxvppRnSNZbvOjlug==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=FMT/txXI; dkim-atps=neutral;\n spf=pass (client-ip=2a00:1450:4864:20::42c; helo=mail-wr1-x42c.google.com;\n envelope-from=adri.vero.dev@gmail.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776582999; x=1777187799;\n darn=lists.ozlabs.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=e633J0iM4T36U0Ykk5jiq+vFzcuBQkCCmEghwzPCf5A=;\n b=FMT/txXIJv8Ccvzw017IqnNJ2Vo5KLE+DDbvp834RNMO5uVq6Jh7IZ+PQPXu+FXudV\n /3xJ2r9Zg6WcEPgECKpj5TsiD9Y4AvZFu9FpzTEBlutKxWdOr0Gp2UYGHxb7fwMvTzMx\n Xubb3YyvD1ySFXL8x8bSPfkUdP25Q69iwPySlepAtjI+cd1EGFw7bSljZB6KDj5v2+f/\n d3Eml4N01djQMH76/ZoWx18p15eUOAsC74Iwm4FtG72cFX7w3P+tCoR4grc7eUsB1ZpG\n qJg/S14MWGPIYBtQsoExB46rFY0Kb9Z2IOjVuLFpJMOzaZsFVDy/E9n0E/aCaIbHjPFS\n msmA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776582999; x=1777187799;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=e633J0iM4T36U0Ykk5jiq+vFzcuBQkCCmEghwzPCf5A=;\n b=QvAlzNebWAo59LpmnYOhSSjG9dkS9Hn0y6xyU6LiJLKAF9XGnE4XaRxaNIgQtacuOF\n ak4tjmx7iB3WaiIE3aHocV9eBmPRIkDjl2YeVUyjRug3GZuunbVUyNvqOvUZ35sndc4R\n nP/KfvzuDAgdFOkVVsiuya/V2tVd+4+hLRp+cAuwXINb4GeCdhuRS4UFKRhznER8HjzG\n SgNLR1/h1xEStxjfUCCKpEkUEP6QFScJBmrSy3i4/OBd7JJhnj7XljXqawHLtU/CJECZ\n W+MpX4uf3rRqIoqKuHxp/jg4rTqbKIW+b3PqwGhlb7MTH+u035QJxdZhBM+rvJ/z1DpO\n OtZA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ8jZCg46+JoRR3nKb8OvpipQFGnYzAs3qg8J3NiCr7EZDNFm9xP5TEsIimkXqj/TyL0dlPIiQLZAfS5+s4=@lists.ozlabs.org", "X-Gm-Message-State": "AOJu0Yx77Bk/ooTV3fE3PpEbRvGbOTME8jAE+14IkfCogfVeUW1lsQ5O\n\tACjyqNwqyYbovliBTfGW0DmcUd4FZfs/4w0Lap/6kijmdPcXXcnEDbWFMbntPGOnsRw=", "X-Gm-Gg": "AeBDiev0FNHbFoKxS7k6i03i532nkC4eEWZhp5Fmi3fdpbI/5CJIA5p8ThoNAO5Rw60\n\tWEzirEjuQzPQseKJvFe6zr4l68NGp3BlhFSAjwdJBWhTf3KpOwZOV+jBcrUO51rQCEGjtKPagLJ\n\tusxzkSbVmeVB/HoI7aqbUFyx/1vUJewcZ1WAVpKfHv98GEQTUSMWlAQFw0IPBZBLt1FU8bSyUlO\n\t2WuZS97ldebIIVKT36sQMCmTpgryNYFV2baTPqmdlxjou1gGJaa72WNPnxzNRNnnYrl2oPeDkQi\n\td84nX9tdGINZ6Mq7/pSysyqmtt/Q/hZYlbHvauyna+cSrnaXmRG/gqSjcdtN1m0yQaEHrps1s+3\n\tLi7geowJl3XLpQux4qAWzvoZ143m4WLVHKj6KunD/yEES1R3KtNYYwMHH9adGpXGtCLtHub9B2B\n\tm21AEv/iyAYWP84h/gPRe0jKA3FEThdpVkVPMWSAxsbJ4zC9n1FQgZIQ7SlwmSMLVus1q4mENf/\n\tLIsr9HDE+M7ethquHNc9svSNk569CS7rKPE/T/VRr9lNuOLWfo5bakfmaFwvwqDiRS3", "X-Received": "by 2002:a05:6000:40df:b0:43d:7af0:3a93 with SMTP id\n ffacd0b85a97d-43fe3e14f29mr13287642f8f.34.1776582998733;\n Sun, 19 Apr 2026 00:16:38 -0700 (PDT)", "From": "Adriano Vero <adri.vero.dev@gmail.com>", "To": "maddy@linux.ibm.com,\n\tmpe@ellerman.id.au,\n\tsourabhjain@linux.ibm.com", "Cc": "npiggin@gmail.com,\n\tchleroy@kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\tAdriano Vero <adri.vero.dev@gmail.com>", "Subject": "[PATCH v2] powerpc/fadump: Add timeout to RTAS busy-wait loops", "Date": "Sun, 19 Apr 2026 08:50:39 +0200", "Message-ID": "<20260419065039.23495-1-adri.vero.dev@gmail.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260406061542.22354-1-litaliano00.contact@gmail.com>", "References": "<20260406061542.22354-1-litaliano00.contact@gmail.com>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "The ibm,configure-kernel-dump RTAS call sites in\nrtas_fadump_register(), rtas_fadump_unregister(), and\nrtas_fadump_invalidate() polled indefinitely while firmware returned\na busy status. A misbehaving or hung firmware could stall these paths\nforever, blocking fadump registration at boot or preventing clean\nteardown.\n\nIntroduce rtas_fadump_call(), a helper that wraps the common\nbusy-wait pattern shared by all three sites. The helper accumulates\nthe total delay and returns -ETIMEDOUT if firmware keeps returning a\nbusy status beyond RTAS_FADUMP_MAX_WAIT_MS (60 seconds). A pr_debug()\nmessage is emitted on each busy iteration to aid diagnosis when the\ntimeout is hit.\n\nSigned-off-by: Adriano Vero <adri.vero.dev@gmail.com>\n---\n arch/powerpc/platforms/pseries/rtas-fadump.c | 80 ++++++++++++--------\n arch/powerpc/platforms/pseries/rtas-fadump.h | 6 ++\n 2 files changed, 53 insertions(+), 33 deletions(-)", "diff": "diff --git a/arch/powerpc/platforms/pseries/rtas-fadump.c b/arch/powerpc/platforms/pseries/rtas-fadump.c\nindex eceb32893..3bb4ac2ab 100644\n--- a/arch/powerpc/platforms/pseries/rtas-fadump.c\n+++ b/arch/powerpc/platforms/pseries/rtas-fadump.c\n@@ -179,9 +179,42 @@ static u64 rtas_fadump_get_bootmem_min(void)\n \treturn RTAS_FADUMP_MIN_BOOT_MEM;\n }\n \n+/*\n+ * Helper to make an ibm,configure-kernel-dump RTAS call with a bounded\n+ * busy-wait loop. Returns the RTAS return code on completion, or\n+ * -ETIMEDOUT if firmware keeps returning a busy status beyond\n+ * RTAS_FADUMP_MAX_WAIT_MS milliseconds.\n+ */\n+static int rtas_fadump_call(struct fw_dump *fadump_conf, int operation,\n+\t\t\t void *fdm_ptr, unsigned int fdm_size,\n+\t\t\t const char *op_name)\n+{\n+\tunsigned int wait_time, total_wait = 0;\n+\tint rc;\n+\n+\tdo {\n+\t\trc = rtas_call(fadump_conf->ibm_configure_kernel_dump, 3, 1,\n+\t\t\t NULL, operation, fdm_ptr, fdm_size);\n+\t\twait_time = rtas_busy_delay_time(rc);\n+\t\tif (wait_time) {\n+\t\t\tpr_debug(\"Firmware busy during fadump %s, waiting %ums (total %ums)\\n\",\n+\t\t\t\t op_name, wait_time, total_wait);\n+\t\t\tif (total_wait >= RTAS_FADUMP_MAX_WAIT_MS) {\n+\t\t\t\tpr_err(\"Timed out waiting for firmware to complete fadump %s\\n\",\n+\t\t\t\t op_name);\n+\t\t\t\treturn -ETIMEDOUT;\n+\t\t\t}\n+\t\t\ttotal_wait += wait_time;\n+\t\t\tmdelay(wait_time);\n+\t\t}\n+\t} while (wait_time);\n+\n+\treturn rc;\n+}\n+\n static int rtas_fadump_register(struct fw_dump *fadump_conf)\n {\n-\tunsigned int wait_time, fdm_size;\n+\tunsigned int fdm_size;\n \tint rc, err = -EIO;\n \n \t/*\n@@ -192,16 +225,10 @@ static int rtas_fadump_register(struct fw_dump *fadump_conf)\n \tfdm_size = sizeof(struct rtas_fadump_section_header);\n \tfdm_size += be16_to_cpu(fdm.header.dump_num_sections) * sizeof(struct rtas_fadump_section);\n \n-\t/* TODO: Add upper time limit for the delay */\n-\tdo {\n-\t\trc = rtas_call(fadump_conf->ibm_configure_kernel_dump, 3, 1,\n-\t\t\t\tNULL, FADUMP_REGISTER, &fdm, fdm_size);\n-\n-\t\twait_time = rtas_busy_delay_time(rc);\n-\t\tif (wait_time)\n-\t\t\tmdelay(wait_time);\n-\n-\t} while (wait_time);\n+\trc = rtas_fadump_call(fadump_conf, FADUMP_REGISTER, &fdm, fdm_size,\n+\t\t\t \"register\");\n+\tif (rc == -ETIMEDOUT)\n+\t\treturn -ETIMEDOUT;\n \n \tswitch (rc) {\n \tcase 0:\n@@ -234,19 +261,12 @@ static int rtas_fadump_register(struct fw_dump *fadump_conf)\n \n static int rtas_fadump_unregister(struct fw_dump *fadump_conf)\n {\n-\tunsigned int wait_time;\n \tint rc;\n \n-\t/* TODO: Add upper time limit for the delay */\n-\tdo {\n-\t\trc = rtas_call(fadump_conf->ibm_configure_kernel_dump, 3, 1,\n-\t\t\t\tNULL, FADUMP_UNREGISTER, &fdm,\n-\t\t\t\tsizeof(struct rtas_fadump_mem_struct));\n-\n-\t\twait_time = rtas_busy_delay_time(rc);\n-\t\tif (wait_time)\n-\t\t\tmdelay(wait_time);\n-\t} while (wait_time);\n+\trc = rtas_fadump_call(fadump_conf, FADUMP_UNREGISTER, &fdm,\n+\t\t\t sizeof(struct rtas_fadump_mem_struct), \"unregister\");\n+\tif (rc == -ETIMEDOUT)\n+\t\treturn -ETIMEDOUT;\n \n \tif (rc) {\n \t\tpr_err(\"Failed to un-register - unexpected error(%d).\\n\", rc);\n@@ -259,19 +279,13 @@ static int rtas_fadump_unregister(struct fw_dump *fadump_conf)\n \n static int rtas_fadump_invalidate(struct fw_dump *fadump_conf)\n {\n-\tunsigned int wait_time;\n \tint rc;\n \n-\t/* TODO: Add upper time limit for the delay */\n-\tdo {\n-\t\trc = rtas_call(fadump_conf->ibm_configure_kernel_dump, 3, 1,\n-\t\t\t\tNULL, FADUMP_INVALIDATE, fdm_active,\n-\t\t\t\tsizeof(struct rtas_fadump_mem_struct));\n-\n-\t\twait_time = rtas_busy_delay_time(rc);\n-\t\tif (wait_time)\n-\t\t\tmdelay(wait_time);\n-\t} while (wait_time);\n+\trc = rtas_fadump_call(fadump_conf, FADUMP_INVALIDATE,\n+\t\t\t (void *)fdm_active,\n+\t\t\t sizeof(struct rtas_fadump_mem_struct), \"invalidate\");\n+\tif (rc == -ETIMEDOUT)\n+\t\treturn -ETIMEDOUT;\n \n \tif (rc) {\n \t\tpr_err(\"Failed to invalidate - unexpected error (%d).\\n\", rc);\ndiff --git a/arch/powerpc/platforms/pseries/rtas-fadump.h b/arch/powerpc/platforms/pseries/rtas-fadump.h\nindex c109abf6b..65fdab7b5 100644\n--- a/arch/powerpc/platforms/pseries/rtas-fadump.h\n+++ b/arch/powerpc/platforms/pseries/rtas-fadump.h\n@@ -41,6 +41,12 @@\n #define MAX_SECTIONS\t\t\t\t10\n #define RTAS_FADUMP_MAX_BOOT_MEM_REGS\t\t7\n \n+/*\n+ * Maximum time to wait for firmware to respond to an\n+ * ibm,configure-kernel-dump RTAS call before giving up.\n+ */\n+#define RTAS_FADUMP_MAX_WAIT_MS\t\t\t60000U\n+\n /* Kernel Dump section info */\n struct rtas_fadump_section {\n \t__be32\trequest_flag;\n", "prefixes": [ "v2" ] }