From patchwork Wed Oct 19 13:09:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ~axelheider X-Patchwork-Id: 13015344 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 199A7C3A59D for ; Fri, 21 Oct 2022 19:48:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olxSY-0006CB-Vp; Fri, 21 Oct 2022 15:13:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oltrg-0006WG-D6 for qemu-devel@nongnu.org; Fri, 21 Oct 2022 11:23:19 -0400 Received: from mail-b.sr.ht ([173.195.146.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oltrd-0002WN-MR for qemu-devel@nongnu.org; Fri, 21 Oct 2022 11:23:15 -0400 Authentication-Results: mail-b.sr.ht; dkim=none Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 6F86711EFC5; Fri, 21 Oct 2022 15:23:11 +0000 (UTC) From: ~axelheider Date: Wed, 19 Oct 2022 15:09:50 +0200 Subject: [PATCH qemu.git] target/imx: reload cmp timer outside of the reload ptimer transaction MIME-Version: 1.0 Message-ID: <166636579128.26670.11954825054446993916-0@git.sr.ht> X-Mailer: git.sr.ht To: qemu-devel@nongnu.org Cc: axelheider@gmx.de Received-SPF: pass client-ip=173.195.146.151; envelope-from=outgoing@sr.ht; helo=mail-b.sr.ht X-Spam_score_int: 2 X-Spam_score: 0.2 X-Spam_bar: / X-Spam_report: (0.2 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_REPLYTO=2.095, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 21 Oct 2022 15:07:05 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~axelheider Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Axel Heider Signed-off-by: Axel Heider --- See https://gitlab.com/qemu-project/qemu/-/issues/1263 When running the seL4 tests (https://docs.sel4.systems/projects/sel4test), on the sabrelight platform the timer test fails (and thus it's disabled by default). Investigation has shown that the arm/imx6 EPIT timer interrupt does not fire properly, instead of a second in can take up to a minute to finally see the interrupt. hw/timer/imx_epit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c index 2bf8c754b2..0b13c1eab0 100644 --- a/hw/timer/imx_epit.c +++ b/hw/timer/imx_epit.c @@ -276,9 +276,12 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value, ptimer_set_count(s->timer_reload, s->lr); } + // commit s->timer_reload before imx_epit_reload_compare_timer + // as timer_reload is read in imx_epit_reload_compare_timer + ptimer_transaction_commit(s->timer_reload); + imx_epit_reload_compare_timer(s); ptimer_transaction_commit(s->timer_cmp); - ptimer_transaction_commit(s->timer_reload); break; case 3: /* CMP */