From patchwork Tue Oct 25 16:39:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 618118 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3517287pvb; Tue, 25 Oct 2022 09:43:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wyI2IIedNWGJJcADBbmHFNS4Tda1oWwX66615e5dL2N6WxMeiwKlvmSZCjc8OmvzLQ0Pq X-Received: by 2002:ac8:7dcc:0:b0:39c:c344:68df with SMTP id c12-20020ac87dcc000000b0039cc34468dfmr33716169qte.170.1666716205990; Tue, 25 Oct 2022 09:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666716205; cv=none; d=google.com; s=arc-20160816; b=aHPB/y8TPNhPYkZlQvggR6eaTtEJnHZbxBeD9q4P1qLHVxLI+v6LF3GOHO+C3Ep8Uv aL/hStUrQ5VecxoDSC15yYvd3zoFjWqiFQcL81zl+HKE3D+5PNTPfyKoFcqXlEi/I/bm IWMv58nceds0c76s3BTVXBMlBXnL73fo8AylxcTaXKan4hakcUeS9X79dhutIp10gldz 9VKLZK6upILazQ3IP5vNu7kWYoaqDXMxlQ1ktQviIELaUZ/JhiTLi71UkfXVXSJOOkIO NLSQFr8qXc8J2F5R4L3i9KLsLo8QB2ydORiNXONUK0Lb2JftfNrI6MFT8Vnhudfrnerl aLAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=vyKoVIaZ14z5rmK2eOBlHnplzEcKxB4jMXPTjeFMRWo=; b=V1EnrwIig07Jlm6daPAQWQleLkRPHtVEiv0AlRj/DTwKIu4zywAxLZj4JWnu7D/Fx6 uYJ9YdQdNN5rlnf6pAg2h9bGWB4oEbwY0Da5F38tzvQSN5FKiMGgsu+ItvEqlKReO0+7 wluvZzsc53iuLUU1yUindoDF+pe0yOJLN7YI6f8N8d1CKzaDNCR+ASmf4wQH0K805DlG H6QBxuO4e6EKYrP6SpQH3FNREqPQwfoW9FnSJAQASqKPs671/crfxZySMu6Gr/eSo58r nOnq+7f0LrLziw9zk1uSF91njTmEQMxWuppacGbojEiciodysBZNs8Bpw+1SGMmpahOj lsUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f7582MHa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bp19-20020a05620a459300b006eebf6f2e6asi2164007qkb.409.2022.10.25.09.43.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Oct 2022 09:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f7582MHa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onMyL-0005Pe-ID; Tue, 25 Oct 2022 12:40:13 -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 1onMyJ-0005Oi-KF for qemu-devel@nongnu.org; Tue, 25 Oct 2022 12:40:12 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onMyD-0001Q3-6U for qemu-devel@nongnu.org; Tue, 25 Oct 2022 12:40:11 -0400 Received: by mail-wr1-x42f.google.com with SMTP id h9so10986469wrt.0 for ; Tue, 25 Oct 2022 09:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vyKoVIaZ14z5rmK2eOBlHnplzEcKxB4jMXPTjeFMRWo=; b=f7582MHa9Cux2cSBMZEregsz/Mwwj9fOVC3WM58/cOz6ZlaaWRGbqHO84l72g3kZrk 8cHz7WYPe39uyPQ/gm0KANcDbSd3AODjh+TXG8KpmdpiuujU6H1HQrr5mLV/x/UFl9wG Mtu5yq32tojIkHcQHrWPP4VZb07O7glS1FJgD3xb9YkQ3zxShGVEx3ruJ9ZWDYUs4v6e SdfzXMTHDE/I/lS4ozJYnEtqXwUzZqwV+SKQtHlH2bt/ZaoimQ16Uy2XdnT7V54/XKXH jcMKBvoX4QE4Ub1kaFDjRy4mR8pCNIzQBn7i3BLMCGJJkggZjMozvEva1cR8H/B8cSIJ 0vHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vyKoVIaZ14z5rmK2eOBlHnplzEcKxB4jMXPTjeFMRWo=; b=ooozL9lv7vtMGnDCDWg0Rp+EfHHtTYLSIWpGB8xZH4w6pew5QHhCS2hZYVDqfaFs+M tHsprxNUIl+niuqvWmc2laPrxdbJTVkcFI4dLY0I9HIBavxiPTZvva1EEArP/ycAg9ZV TW18buTQ00ACVwgGNdyIpCZttvESsgks2XTpRGZFEYgajVjF+WZvX4LuNSwZw3GniXyi PmW6f3af2eoC0EQw/fpNnZhJOkWfhv4F6+S0zhtL+A4jKus2Aa9SPsm6oEY74H7ZB3gN 5DwUqrFSPxfVyNHJRhnaKWDHI14/pth/ncYCNNCIihB6tFLAxaAbGCycgzqkofAEQ03M 9k6g== X-Gm-Message-State: ACrzQf3/uPwh/IzIYVroBkqnHIcfpoXYMU3kSa6mi2oOPOMhNDH15B7P NJg7S/NDjLQzboLDjlhystxuAN5ZySmPzQ== X-Received: by 2002:a05:6000:15cf:b0:230:ba81:cefc with SMTP id y15-20020a05600015cf00b00230ba81cefcmr26121432wry.544.1666716001783; Tue, 25 Oct 2022 09:40:01 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id z12-20020a05600c220c00b003cd9c26a0basm2971084wml.40.2022.10.25.09.40.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 09:40:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/30] target/imx: reload cmp timer outside of the reload ptimer transaction Date: Tue, 25 Oct 2022 17:39:28 +0100 Message-Id: <20221025163952.4131046-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025163952.4131046-1-peter.maydell@linaro.org> References: <20221025163952.4131046-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Axel Heider When running seL4 tests (https://docs.sel4.systems/projects/sel4test) on the sabrelight platform, the timer tests fail. The arm/imx6 EPIT timer interrupt does not fire properly, instead of a e.g. second in can take up to a minute to finally see the interrupt. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1263 Signed-off-by: Axel Heider Message-id: 166663118138.13362.1229967229046092876-0@git.sr.ht Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/imx_epit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c index 2bf8c754b21..ec0fa440d72 100644 --- a/hw/timer/imx_epit.c +++ b/hw/timer/imx_epit.c @@ -275,10 +275,15 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value, /* If IOVW bit is set then set the timer value */ ptimer_set_count(s->timer_reload, s->lr); } - + /* + * Commit the change to s->timer_reload, so it can propagate. Otherwise + * the timer interrupt may not fire properly. The commit must happen + * before calling imx_epit_reload_compare_timer(), which reads + * s->timer_reload internally again. + */ + 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 */