From nobody Mon Sep 15 19:21:48 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 4cQZf5074dz67v2Y; Mon, 15 Sep 2025 19:21:49 +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 4cQZf44rL6z4Ktc; Mon, 15 Sep 2025 19:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757964108; 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=0HOypQaA0WPzT47C6sntgC2fYZogYt10V4YrdfX+4y0=; b=DDs4LeqiHaJboJJvWdzATgl8felho3u0myz2h5FAq5vk/G/oLj/g8tQlb4+PTRHTrKJsOj V54gfUOhLN57TS1xz3z0hOoBuz31TaEFpxVEB7nuDCxKL1b9ZVB0+uziL/utnnqQDXZXAT srnNK4QvUkR7dCzneuxPfIkB8SezDU0AUMtXmZ+droj6D/vfDd9FQq0jdFoUpeQRrXIsmK 6UkPcDNuAfcNbYAe9TYZEgpyE2uXCLT4gJoQVTtIzaMybUnKwXFv7xFCLdTPwY+dqxfy49 oVo680ac9bfXU0y/7VHOhaqMcTLw3iq6BJ0MmOT0JRCF7w3/1oAuFRvoRZwsEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757964108; 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=0HOypQaA0WPzT47C6sntgC2fYZogYt10V4YrdfX+4y0=; b=sA/mJltIf7wTu0AK/Qb0DvqHCcyPe/m1zMI7p9D6SnMsDEhqV0gebU5/WY8y4UPKU9lLzF EDrZLwcyjAZeqDLi9kE3OdJd3xb6sbAfjc98c2gP/EBFstvU9DAlXLDMufxJN0pxE8QGSB E1zCx3kaxwWnnQzmCHgf0veNmMjXnnb83u/OqV6yd58VjU8JZsfAl/kh9maOdp0up1W+ej 2gHR6KfIzHdmOt5LwabFYicsDX3w8nFPNBvnIf6YPz9sLesZLZ7jvdIoPvoYvg8xiWwnfl vR4xjrXRp9pxoolLRVvNURq3jBOVBFOIvbA2YehJdaKeQajPd//PfJsGsL6yyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757964108; a=rsa-sha256; cv=none; b=htMtAsck8Db/3qHUVpWwPJQ36hvSSOmyM7qNE7ONMOGIcJ4klxAOjQEr4d/t/CV+v9wQXU zG66yJuFI5DlCrQJ+pnwb29sZnX7daJIlSXKidVXu2PGLaSuMqrGTpZnVQN/gc90L90Keo m7aVRYccvv5qq4YbHJLWRuyXcbWfjQp9E1ys9f7HNN0UpKmWT0YXa62kPCOCOENHsMe/UT XU1CucA9knNSSrDWSa4PsN5g5koAjeNV/upueoTZT0EbnWty7Xe9aiFzB25IDdEN7qpwHH kKgzb3sykEcV/cO0eu6M7CENGdBvYM07AF2jzzG+rxH1zb6zEhNuXZQdqsGgGQ== 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 4cQZf44RRXz16y2; Mon, 15 Sep 2025 19:21:48 +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 58FJLmW3073319; Mon, 15 Sep 2025 19:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58FJLmgZ073315; Mon, 15 Sep 2025 19:21:48 GMT (envelope-from git) Date: Mon, 15 Sep 2025 19:21:48 GMT Message-Id: <202509151921.58FJLmgZ073315@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: 31eaa0141c49 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 31eaa0141c49128fabfc65f3d282997a8d5e9cdc Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=31eaa0141c49128fabfc65f3d282997a8d5e9cdc commit 31eaa0141c49128fabfc65f3d282997a8d5e9cdc Author: Ruslan Bukin AuthorDate: 2025-03-26 08:09:50 +0000 Commit: Mitchell Horne CommitDate: 2025-09-15 19:20:32 +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 b4aa054cae9d..8390fa9c448c 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 @@ -147,7 +147,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);