get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223456,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223456/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260415110002.2610929-3-anup.patel@oss.qualcomm.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": "https://github.com/riscv/opensbi/commit/{}"
    },
    "msgid": "<20260415110002.2610929-3-anup.patel@oss.qualcomm.com>",
    "list_archive_url": null,
    "date": "2026-04-15T11:00:01",
    "name": "[2/3] 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.2/people/92322/?format=api",
        "name": "Anup Patel",
        "email": "anup.patel@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260415110002.2610929-3-anup.patel@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 499967,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499967/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=499967",
            "date": "2026-04-15T11:00:00",
            "name": "Timer events for OpenSBI",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499967/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223456/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223456/checks/",
    "tags": {},
    "related": [],
    "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=gM+WvXDr;\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=B/KDPOBq;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; 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 4fwdTj5dGmz1yHd\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 21:00:25 +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 1wCxym-000000010VI-1JbF;\n\tWed, 15 Apr 2026 11:00:20 +0000",
            "from mx0a-0031df01.pphosted.com ([205.220.168.131])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCxyk-000000010UX-0vE2\n\tfor opensbi@lists.infradead.org;\n\tWed, 15 Apr 2026 11:00:19 +0000",
            "from pps.filterd (m0279865.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63F97ZnJ1779139;\n\tWed, 15 Apr 2026 11:00:07 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 4dhrw0395t-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:06 +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 63FB03Br029584;\n\tWed, 15 Apr 2026 11:00:03 GMT",
            "from pps.reinject (localhost [127.0.0.1])\n\tby APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4dg5d11e7p-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:03 +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 63FB03aQ029553;\n\tWed, 15 Apr 2026 11:00:03 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 63FB03F4029528\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:03 +0000 (GMT)",
            "by hu-devc-blr-u24-a.qualcomm.com (Postfix, from userid 486687)\n\tid D5BD121ABB; Wed, 15 Apr 2026 16:30:02 +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=js3CbgLP9UCGrEMwerBvCRabNEgPn52qxpyEjACiR90=; b=gM+WvXDrKJgLtG\n\tuazgc8C5poWg4l+Z2bxQPFvMsiI0R63fHcxx8ABvqmgV1/51YBSI6gOtmiMdGNdG9S84J67HhbAGF\n\tvBq+9WHRjNAMy2o4jWqX/p6uWev3e5yBi2njosSy7V3MIrQlGkSMN2XVH+Fd/2H9PxnHTZohlm8MO\n\tVXboGy7AeXfe5xi6XyxuHucagWj+mYUHCg0U1bdt0OFb/Y04MX8cB9V+ztWsjp8X7Bed9Mif5d0i2\n\tyvKo/UYbWxeFVAKCd+q6epSXvygpkCx5he3YJisKoGJDwIG4lvCZ4esIxyPfsY0GQ7+9kAjybXF40\n\tcjz52XY6vEHR0MCYjadQ==;",
            "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=xg8NzOBvasZ\n\tC494zYbUH+KJybfawZ1ddwfn0grOhZoU=; b=B/KDPOBqACXCsksPKWT21K6yBvr\n\tLGolA+Vo9HHrCcXKeCpwK0XhshGrTYw/46A1gdTcyFCZy3gH4zHWFKH2cZrVCQZr\n\tC5AxpN2UlJStbG4d22aisialpY+lyEackwFVVBuix1VeCjHWqWJhq/gDawOhlJFL\n\tOjnToGxT6fRS85sAnHsP7FuSkYlf1usHM0yL+jMhyfgsN/I/X6E8RJTUWqUT8NTu\n\t5Pe+TGdoMS6rt9Vo+WM3KVVpnX1vn6ChFVu/CQvNGiil0/V3HODgV6Yr4K6mQM+O\n\tx7lFWhp+uR+cwoM1ABnIIwv88kvYbW74w8i6VVLR20Yo/mE7PJirIuMRKWA=="
        ],
        "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>",
        "Subject": "[PATCH 2/3] lib: sbi_timer: Introduce per-HART timer state",
        "Date": "Wed, 15 Apr 2026 16:30:01 +0530",
        "Message-ID": "<20260415110002.2610929-3-anup.patel@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260415110002.2610929-1-anup.patel@oss.qualcomm.com>",
        "References": "<20260415110002.2610929-1-anup.patel@oss.qualcomm.com>",
        "MIME-Version": "1.0",
        "X-QCInternal": [
            "smtphost",
            "smtphost"
        ],
        "X-Proofpoint-GUID": "Jrp8PkO-fZApovf7PHzp-B_7x1qR7Rdc",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDE1MDEwMSBTYWx0ZWRfX4Vl8RTODKcSl\n sNzwEer7syGsrAJIeIOEPCQItZ5sUDkHwEbTvYziNcOy/D5Dj8QJ0JRiypskNZUOSI20J99nSMq\n 13otZvlPZbJRAVuBog2776gE3cyR7MwOM7XzMe0/euA8vwk+OCBKagIQ7iz+KcBQ/SJjYckJUqg\n XLEiD3Jh43rcham79FYV/M8GxgKipJF7qLk6I/wWsRfq/ZbFNRPq0z/JOOKOZ13A0eetRuy+5QL\n rZDuydezWzBFJqThTZh/gPfP/xUpZZ8xAKQRz9G8VBu7VSUo6V2LuTte1VE2SJ1xG56OtH0Y/vd\n WQPR+1kYyzfwxz989K+9vff1EP048BPoFxP6POcRe9nMelw/0s/AFaFBnC6WBDe1sBAsTnnwq6t\n Fi5q4dKhXjRPNRwZ4Qf4AhSWZ8jSii1M2lZ85tcyhGI63vZQr5ioONJr5SHB3sHJrt034snNYk4\n EO0JAR8DS3wEd22MqeA==",
        "X-Proofpoint-ORIG-GUID": "Jrp8PkO-fZApovf7PHzp-B_7x1qR7Rdc",
        "X-Authority-Analysis": "v=2.4 cv=YMGvDxGx c=1 sm=1 tr=0 ts=69df6fb7 cx=c_pps\n a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22\n a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=QMJzDYCuMJTWl8ySVGcA:9",
        "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-14_04,2026-04-13_04,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 spamscore=0\n suspectscore=0 clxscore=1015 malwarescore=0 adultscore=0 lowpriorityscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604150101",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260415_040018_267067_4830C271 ",
        "X-CRM114-Status": "GOOD (  13.49  )",
        "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> --- lib/sbi/sbi_timer.c | 44\n +++++++++++++++++++++++++\n    1 file changed, 25 insertions(+), 19 deletions(-)\n Content analysis details:   (-2.7 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                        [205.220.168.131 listed in\n sa-trusted.bondedsender.org]\n  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [205.220.168.131 listed in\n sa-accredit.habeas.com]\n  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                           [205.220.168.131 listed in\n bl.score.senderscore.com]\n -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/, low\n                             trust\n                             [205.220.168.131 listed in list.dnswl.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an 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>\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": [
        "2/3"
    ]
}