From nobody Mon Sep 15 19:34:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cQZx746Jmz67wSp; Mon, 15 Sep 2025 19:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQZx73DQFz4MqL; Mon, 15 Sep 2025 19:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757964891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iBvMIypVFbq2BGP+q7FJ1GNvfFt9tD0g0g8/sr/0gM4=; b=o/7bakfISDge/zte+0PgBMypGYUGVKNTGdmaJzwF2i0IKGMdU1y3mdK3ks3fz1eCr9VG8w ao250bVoqpM24CFLUOeVLLYgtaeMyAHEa6kwsd2oOnXRCmsqBRHBj2gOvLfbGkSzI0U0Rn laCsjVuj4SZPxcMB1dhrzZC/by/GsCfx26ZTPVlp6aF7Hg7cXo6gKArJEAAbBZBYqzIZAs 0wzYwgqrdp1dFvWCovaCX73ovZtBvKigKHvBffpvtjBaxpQKUFmoqLgs7r/XssqidqnqwH beNjWCz6zNFgF0h+MfGfSUInA8rZwVPpzaNnIBuQJAjzfywrhpGF5Fav0ubbaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757964891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iBvMIypVFbq2BGP+q7FJ1GNvfFt9tD0g0g8/sr/0gM4=; b=QSpYFZEtZ4bWGV3GIJpSr+aKhQnK3HW8SL7J4qmHx2iKY6w0xTk7oZr4qzdxwMOi7g/ViP op4kr6OSS1rhTlS2SnWs/25STHk0m1fkaGCbuNMJkLIDiZ+mijLFz/Lafkc6/P0bYRveea B8mpVUUchXsLgv+zelFj7YQqd+NanveFHt4hgwlCEOnMG8b59hS9HCj1x92kvqgUbTxtGA +DKmkajRS6WwEVOEEhgTpcc1igcja1S0ZErcDmMZpKD0gdNkCgfABIf17BRxY0M8AbJKXf FVzN3YiNKFlcmwMcXZtiImAT9KOeUOUygLxf5mHja1J7NtDSt1oTDwIWS+UeFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757964891; a=rsa-sha256; cv=none; b=I66i5vzJJnoQ4JhHRhqGGwKs9s+jjF4nqaiDKl7lNAsAdGIoKBfyShoC+iegsllWTSXVpn COGt3eZgGdFDmoPDoKtUbMcB+IRyihW0DpJ+RiJsJoiMkFVWFY7svdzDQRoyYZxfWAxs4Z IdXXEJUwPXimcrZsy/SjYWIvCOVt2Z2DaNXkRF81O4eu6vdE8cLa56zksTLWnD9pgR8CeK YzCmbAnlodSW1jSRInwQMsao5UEWwXoaAnlqOjx/aflFYLh0JGBJnQ80EVE7QvZg2oq0d4 kT+CFl3FTnyxQSvEWK1/dpixaaFJC2bL6dFSy0+LvsHH3K4SRYEDispM0ikH/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cQZx72kQsz16wZ; Mon, 15 Sep 2025 19:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58FJYph7093028; Mon, 15 Sep 2025 19:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58FJYpj8093024; Mon, 15 Sep 2025 19:34:51 GMT (envelope-from git) Date: Mon, 15 Sep 2025 19:34:51 GMT Message-Id: <202509151934.58FJYpj8093024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8302f09d844c - stable/13 - riscv timer: fix interrupt handling. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8302f09d844cdf2c942af57ee7babea127675990 Auto-Submitted: auto-generated The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8302f09d844cdf2c942af57ee7babea127675990 commit 8302f09d844cdf2c942af57ee7babea127675990 Author: Ruslan Bukin AuthorDate: 2025-03-26 08:09:50 +0000 Commit: Mitchell Horne CommitDate: 2025-09-15 19:32:17 +0000 riscv timer: fix interrupt handling. Based on the spec the STIP bit of SIP register is read-only. To clear STIP bit from supervisor we have to do an SBI call to firmware. Upon reception of SBI request, the machine-mode firmware clears the STIP bit in the MIP register. This fixes operation on Codasip A730. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D49487 (cherry picked from commit 6d58c670060a17817fa0c8ebf4e7543c3d2b4523) --- sys/riscv/riscv/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/riscv/riscv/timer.c b/sys/riscv/riscv/timer.c index f7657130ff70..122591960101 100644 --- a/sys/riscv/riscv/timer.c +++ b/sys/riscv/riscv/timer.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2024 Ruslan Bukin + * Copyright (c) 2015-2025 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -145,7 +145,7 @@ riscv_timer_intr(void *arg) if (has_sstc) csr_write(stimecmp, -1UL); else - csr_clear(sip, SIP_STIP); + sbi_set_timer(-1UL); if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg);