get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2228117/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2228117,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228117/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260425104048.2335262-3-anup.patel@oss.qualcomm.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/67/?format=api",
        "name": "OpenSBI development",
        "link_name": "opensbi",
        "list_id": "opensbi.lists.infradead.org",
        "list_email": "opensbi@lists.infradead.org",
        "web_url": "https://github.com/riscv/opensbi",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260425104048.2335262-3-anup.patel@oss.qualcomm.com>",
    "date": "2026-04-25T10:40:46",
    "name": "[v2,2/4] lib: sbi_timer: Introduce per-HART timer state",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "086fa940e372a38265083d86c5190db00a2d0539",
    "submitter": {
        "id": 92322,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92322/?format=api",
        "name": "Anup Patel",
        "email": "anup.patel@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260425104048.2335262-3-anup.patel@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 501434,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501434/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=501434",
            "date": "2026-04-25T10:40:44",
            "name": "Timer events for OpenSBI",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/501434/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228117/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228117/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xRs8jnaF;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=Z8Gbw/WK;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=temperror (SPF Temporary Error: DNS Timeout)\n smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133;\n helo=bombadil.infradead.org;\n envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2mbK441lz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 20:41:11 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wGaRY-0000000ELsc-2YxJ;\n\tSat, 25 Apr 2026 10:41:00 +0000",
            "from mx0b-0031df01.pphosted.com ([205.220.180.131])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wGaRV-0000000ELr9-3LYK\n\tfor opensbi@lists.infradead.org;\n\tSat, 25 Apr 2026 10:40:59 +0000",
            "from pps.filterd (m0279872.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63P3jk9B1016045;\n\tSat, 25 Apr 2026 10:40:54 GMT",
            "from apblrppmta01.qualcomm.com\n (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4drp07gpwp-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tSat, 25 Apr 2026 10:40:53 +0000 (GMT)",
            "from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1])\n\tby APBLRPPMTA01.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63PAeoCJ005578;\n\tSat, 25 Apr 2026 10:40:50 GMT",
            "from pps.reinject (localhost [127.0.0.1])\n\tby APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4drpph2c8a-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tSat, 25 Apr 2026 10:40:50 +0000 (GMT)",
            "from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com\n [127.0.0.1])\n\tby pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 63PAen9F005547;\n\tSat, 25 Apr 2026 10:40:49 GMT",
            "from hu-devc-blr-u24-a.qualcomm.com (hu-anuppate-blr.qualcomm.com\n [10.131.36.165])\n\tby APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 63PAenX8005539\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tSat, 25 Apr 2026 10:40:49 +0000 (GMT)",
            "by hu-devc-blr-u24-a.qualcomm.com (Postfix, from userid 486687)\n\tid 1A25922156; Sat, 25 Apr 2026 16:10:49 +0530 (+0530)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=EkhEgsDBKD/LmwMlqeEosUv9te7ongkxUR6qjn0nZvs=; b=xRs8jnaFRZiG7j\n\tDbJEDo2IOJEutL4RAWFerWylBXDWoE81lpGSTxaNTR52aU/vuTkVDR+jNt12c4IJLJxy8kt0rq8do\n\toNlEoloK8XPPqfoaqTLlEREAs65D0Ba9uZs4maQr6vCQeJ2AEqvoxe9jf1xbQ/VIybtyMxmW4qCHu\n\t9NfvtBWce6+g3AlxHPbhwvWbG2IPINKrgeAjBoKGsYGdae8nIfvsX+ERHS8wpNf7kXnE7zzfMzeO/\n\thK8PlcunwF8Np2uama79QEQJWHKCbCKDh6hA7pmjYBEMb1SlrTzBAAsFgwYJ4ET6sPBfv4p19dot4\n\tlwsoLa4UXYer8P8Dlm8Q==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=qcppdkim1; bh=bdVNLAvS8kI\n\tZG65WAf/ka3JRbXSVXlCPnkMd/09MrEw=; b=Z8Gbw/WKJmzwDUF5jdLT1Pr/bMb\n\tgW2Zt9Je3lu2eUvhoBiYDV+4svhmMDmpXqo+iKGuioo9m3achifrLCco76SXkelZ\n\t1pUEzxEnGAgZJ0QqVCkHN6gQ0SQNDgppjfbhBuNb9QGwg+CXpnmV+np1DAqBXKp4\n\tji3lgt2lMLcv/0gqqEI68GLjeVb2CiRC0wv/dYJkzYdGgdtR7lFCfA7XkeXo6ROC\n\tgTkSTOK+iVwFrSZetgBjGf4QjTHxihavLNCFUVBdt5XjaNXJ7yM6iw1Y1MHqiRcd\n\tXDUIoEfLcCa3q3qrJAESZO+IoVI4NgAIxfVVEoVlx/RO9SJQzkIDBZjFvRQ=="
        ],
        "From": "Anup Patel <anup.patel@oss.qualcomm.com>",
        "To": "Atish Patra <atish.patra@linux.dev>",
        "Cc": "Andrew Jones <andrew.jones@oss.qualcomm.com>,\n        Samuel Holland <samuel.holland@sifive.com>,\n        Anup Patel <anup@brainfault.org>, opensbi@lists.infradead.org,\n        Anup Patel <anup.patel@oss.qualcomm.com>,\n        Nicholas Piggin <npiggin@gmail.com>",
        "Subject": "[PATCH v2 2/4] lib: sbi_timer: Introduce per-HART timer state",
        "Date": "Sat, 25 Apr 2026 16:10:46 +0530",
        "Message-ID": "<20260425104048.2335262-3-anup.patel@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260425104048.2335262-1-anup.patel@oss.qualcomm.com>",
        "References": "<20260425104048.2335262-1-anup.patel@oss.qualcomm.com>",
        "MIME-Version": "1.0",
        "X-QCInternal": [
            "smtphost",
            "smtphost"
        ],
        "X-Authority-Analysis": "v=2.4 cv=K8QS2SWI c=1 sm=1 tr=0 ts=69ec9a35 cx=c_pps\n a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22\n a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8\n a=3A821fTzlExcq4CWNVkA:9",
        "X-Proofpoint-ORIG-GUID": "YFvDzMGOGqNZLfAYSAgyeaspWA-pGV-v",
        "X-Proofpoint-GUID": "YFvDzMGOGqNZLfAYSAgyeaspWA-pGV-v",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDI1MDEwNiBTYWx0ZWRfX46QvK4UAisyC\n G/pdGsWSVPLx4wErrxJS5JKIji6wXQHuXByiBFTmZsSjfartG4RRTvQUFQoy6QsrSVG2a0r9jWr\n Ab2vV0hqC/9s+qepRc4/cEQ92b9Htqo3t0Pl9X7MBEy620tb6n36PSMsBrYuoJYB85td3rIfyr3\n LcFRImsmih0RvyCm2nXl/DwNS7yYKkXDf9Y7E5l9FwWcWtCgmddV0v9/GVBAWJyeyQHm/ex0MJj\n /2IE/DH1DOa6CKnZJh9ClzWfRwanwdZbRegs0mPGx4nT07whw6CacD4iu6sXi3LXQJIMW2kkoNJ\n /TlN0iQt/kOXYiZxnuiJyrDuillX2f5EM+G4qElZSmwXXO+0EFBU9R+RdGpTQQTJQsuabpiQTLP\n xBl0XZmZBjxQyFR5GL4xIDEDoHQc4aoiL8CVtkUYzahjRNhn5J+yd5DPI8vzmw8erVuWy98rCX5\n Zr6evAkxYZgy49XuQIQ==",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-25_02,2026-04-21_02,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n clxscore=1011 impostorscore=0 spamscore=0 malwarescore=0 phishscore=0\n priorityscore=1501 adultscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604250106",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260425_034057_963210_793BB9C8 ",
        "X-CRM114-Status": "GOOD (  13.01  )",
        "X-Spam-Score": "-2.7 (--)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Currently,\n only time_delta is per-HART so introduce per-HART\n    timer state for having more per-HART timer information. Signed-off-by:\n Anup\n    Patel <anup.patel@oss.qualcomm.com> Reviewed-by: Nicholas Piggin\n <npiggin@gmail.com>\n    --- lib/sbi/sbi_timer.c | 44 +++++++++++++++++++++++++ 1 file changed, 25\n    in [...]\n Content analysis details:   (-2.7 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/, low\n                             trust\n                             [205.220.180.131 listed in list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]",
        "X-BeenThere": "opensbi@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<opensbi.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/opensbi/>",
        "List-Post": "<mailto:opensbi@lists.infradead.org>",
        "List-Help": "<mailto:opensbi-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"opensbi\" <opensbi-bounces@lists.infradead.org>",
        "Errors-To": "opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Currently, only time_delta is per-HART so introduce per-HART timer\nstate for having more per-HART timer information.\n\nSigned-off-by: Anup Patel <anup.patel@oss.qualcomm.com>\nReviewed-by: Nicholas Piggin <npiggin@gmail.com>\n---\n lib/sbi/sbi_timer.c | 44 +++++++++++++++++++++++++-------------------\n 1 file changed, 25 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/sbi/sbi_timer.c b/lib/sbi/sbi_timer.c\nindex 4088a597..9806c033 100644\n--- a/lib/sbi/sbi_timer.c\n+++ b/lib/sbi/sbi_timer.c\n@@ -18,7 +18,11 @@\n #include <sbi/sbi_scratch.h>\n #include <sbi/sbi_timer.h>\n \n-static unsigned long time_delta_off;\n+struct timer_state {\n+\tu64 time_delta;\n+};\n+\n+static unsigned long timer_state_off;\n static u64 (*get_time_val)(void);\n static const struct sbi_timer_device *timer_dev = NULL;\n \n@@ -98,35 +102,37 @@ u64 sbi_timer_value(void)\n \n u64 sbi_timer_virt_value(void)\n {\n-\tu64 *time_delta = sbi_scratch_offset_ptr(sbi_scratch_thishart_ptr(),\n-\t\t\t\t\t\t time_delta_off);\n+\tstruct timer_state *tstate = sbi_scratch_thishart_offset_ptr(timer_state_off);\n \n-\treturn sbi_timer_value() + *time_delta;\n+\treturn sbi_timer_value() + tstate->time_delta;\n }\n \n u64 sbi_timer_get_delta(void)\n {\n-\tu64 *time_delta = sbi_scratch_offset_ptr(sbi_scratch_thishart_ptr(),\n-\t\t\t\t\t\t time_delta_off);\n+\tstruct timer_state *tstate = sbi_scratch_thishart_offset_ptr(timer_state_off);\n \n-\treturn *time_delta;\n+\treturn tstate->time_delta;\n }\n \n void sbi_timer_set_delta(ulong delta)\n {\n-\tulong *time_delta = sbi_scratch_offset_ptr(sbi_scratch_thishart_ptr(),\n-\t\t\t\t\t\t   time_delta_off);\n+\tstruct timer_state *tstate = sbi_scratch_thishart_offset_ptr(timer_state_off);\n \n-\t*time_delta = delta;\n+#if __riscv_xlen == 32\n+\ttstate->time_delta &= ~0xffffffffUL;\n+\ttstate->time_delta |= (u32)delta;\n+#else\n+\ttstate->time_delta = delta;\n+#endif\n }\n \n #if __riscv_xlen == 32\n void sbi_timer_set_delta_upper(ulong delta_upper)\n {\n-\tulong *time_delta = sbi_scratch_offset_ptr(sbi_scratch_thishart_ptr(),\n-\t\t\t\t\t\t   time_delta_off);\n+\tstruct timer_state *tstate = sbi_scratch_thishart_offset_ptr(timer_state_off);\n \n-\t*(time_delta + 1) = delta_upper;\n+\ttstate->time_delta &= 0xffffffffUL;\n+\ttstate->time_delta |= (u64)delta << 32;\n }\n #endif\n \n@@ -176,13 +182,13 @@ void sbi_timer_set_device(const struct sbi_timer_device *dev)\n \n int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot)\n {\n-\tu64 *time_delta;\n \tconst struct sbi_platform *plat = sbi_platform_ptr(scratch);\n+\tstruct timer_state *tstate;\n \tint ret;\n \n \tif (cold_boot) {\n-\t\ttime_delta_off = sbi_scratch_alloc_offset(sizeof(*time_delta));\n-\t\tif (!time_delta_off)\n+\t\ttimer_state_off = sbi_scratch_alloc_offset(sizeof(*tstate));\n+\t\tif (!timer_state_off)\n \t\t\treturn SBI_ENOMEM;\n \n \t\tif (sbi_hart_has_csr(scratch, SBI_HART_CSR_TIME))\n@@ -192,12 +198,12 @@ int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot)\n \t\tif (ret)\n \t\t\treturn ret;\n \t} else {\n-\t\tif (!time_delta_off)\n+\t\tif (!timer_state_off)\n \t\t\treturn SBI_ENOMEM;\n \t}\n \n-\ttime_delta = sbi_scratch_offset_ptr(scratch, time_delta_off);\n-\t*time_delta = 0;\n+\ttstate = sbi_scratch_offset_ptr(scratch, timer_state_off);\n+\ttstate->time_delta = 0;\n \n \tif (timer_dev && timer_dev->warm_init) {\n \t\tret = timer_dev->warm_init();\n",
    "prefixes": [
        "v2",
        "2/4"
    ]
}