From patchwork Thu Apr 20 10:04:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 675601 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp221381wrs; Thu, 20 Apr 2023 03:07:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJWPN8OXi/YArrLO+xMwlMEQ2Dz5isWkqkSmIXnglJVGZEH3MZ0RWfWxr+YTzqQyqubyTt X-Received: by 2002:a05:6214:2aa4:b0:5ef:5481:595 with SMTP id js4-20020a0562142aa400b005ef54810595mr2656516qvb.0.1681985262696; Thu, 20 Apr 2023 03:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681985262; cv=none; d=google.com; s=arc-20160816; b=IdjAWf/6wRWizjqDknwNxJ4mmVj1SMXbKGlk+UDUFW04mwvVioRcrGm9Ws0ZGrIHva 7TB+RmrLbNEkepaIz7OEBddh5j9FFOHdKN22FF46d567hhpP4x/CONVV5RrZygz4mnPQ KVTshbawF7wuPIwgOhclgaNvN7v1wNoRx7rSImydJBJNOEn6ZeCWIVr3FE2gDglsPe5R Mp4tImTin6AiuIiXHeU0B/5VfTMetwtC/mk49SHRNyOHFJANRc1pceGmRvfTwGBR1D3G nLbbmbWMILh6LFBnj8BUDNA41Q+4VARvhl2ETA7Cn5OGZDORXBgAlc2Ai5ves3urXkik j9Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=EjMl5vexxEGO4PAe7d3muxw4Zdgc0H+6hNltDpoCeUI=; b=nFEoBaP8AkWbbJKoOcST0fSTgmvJkjiN3qsw6eoPNWvr0KhK3CD3Jg05ziqEAF9Df6 iHB8tNP0C3d2u6xj/bXIjYs3x850p4lTs1cXw5bhlphacLW03B0q8AJQfBUMgVh7rAox qbEdw4c3eBS9u5z6DaRL/K/0rywmqiEs+gNrNDq4Epwh2yW11/0tH/9KA8pGAhLiDLuQ UraNsdqsWa18zxHVP6DiykuT47BrolBoysstMqvi8xQJqDz4Vn3GYjOJJFx0Bf4sCbQJ 32Jb81sFjWKCNRPusOG5JKD6j06a2mD3j/BE16qDI9MGxapBfzv1t4DzOubPKzL7LzDZ EiRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nZ8QkaA0; 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 v5-20020a05620a0f0500b0074adb0497absi868388qkl.554.2023.04.20.03.07.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Apr 2023 03:07:42 -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=nZ8QkaA0; 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 1ppRAF-0000do-AE; Thu, 20 Apr 2023 06:05:19 -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 1ppRA7-0000Yj-B1 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 06:05:11 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppRA1-0003qM-Lq for qemu-devel@nongnu.org; Thu, 20 Apr 2023 06:05:10 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f178da219bso5163925e9.1 for ; Thu, 20 Apr 2023 03:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681985104; x=1684577104; 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=EjMl5vexxEGO4PAe7d3muxw4Zdgc0H+6hNltDpoCeUI=; b=nZ8QkaA0KGbsoYwPS/sZMHgyZUNCcRCbzjik1qTAXyPxuGuU1LkGzns6KNvx0oddkp oIBkpsTuqx63C8QZVIP827tn6p049F9m5BQLlN9QvOzVAcdKaufitfXooVcMMS1iRks+ K/z/qvMQpCtNsGSoyw6zI7/lO3MYP4rQzsA8k9H/5/rpEmtwRMJtbUI25T2kGupkJ3NQ RK+4mPF9f4PpMXEgviQtbEaoDWGnYia5+oRLRkCIU+Ylo/HG3RCFz+5VxKMO0epNvBRI RRgXIJ7k1Vx2DLenGy57Rc3XfyBAdHvgteRutnAozDgKHsAVO/EWXmsX2D9SKJuVnpiF FUJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985104; x=1684577104; 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=EjMl5vexxEGO4PAe7d3muxw4Zdgc0H+6hNltDpoCeUI=; b=L64rcE2xXgKX0Wiy4jVwqr6iRyPobH0E5Zl1MaTBKK9LQLv45SGoAU3b1NQa7d6P8v SSaN+K3xvr6UDasq0q3zyTphLyHbBnkivQvhpMa0JFLcxBGuKMSwe3OyCPzNRIZABhOz Y0gGYZSSQqI0Rr5+fMdbudJb4WgyEMUbImR0aKc7mJ+wNQuR/yAFzKeKNuO6mEaBD2bu ieCiSt+LpEp0X5uxYszNZdMdNViTMotadvX5Q5LnbE+6Ck6eetqkGPyzsflNgX3M59h7 NEbehiLP3au29xxSfd8VF19j018f9BHVuxhgo7vkI1UV7Sb489lALomyfquxoSd5ttG2 ei3w== X-Gm-Message-State: AAQBX9d2UpdeYoOpCDiHdTcQRgmADSKeWoHXEGvnlkWq+SZaFgNVUPID Xov71GetqfQABe3bpZJo6M/I+3QI7g1GEJTSG6M= X-Received: by 2002:adf:e3ca:0:b0:2ef:ab51:15c2 with SMTP id k10-20020adfe3ca000000b002efab5115c2mr904602wrm.15.1681985103532; Thu, 20 Apr 2023 03:05:03 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id o2-20020a5d58c2000000b002fe522117fdsm1556388wrf.36.2023.04.20.03.05.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:05:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/21] hw/timer/imx_epit: fix limit check Date: Thu, 20 Apr 2023 11:04:43 +0100 Message-Id: <20230420100456.944969-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230420100456.944969-1-peter.maydell@linaro.org> References: <20230420100456.944969-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Axel Heider Fix the limit check. If the limit is less than the compare value, the timer can never reach this value, thus it will never fire. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1491 Signed-off-by: Axel Heider Message-id: 168070611775.20412.2883242077302841473-2@git.sr.ht Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/imx_epit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c index 0821c62cd1c..640e4399c24 100644 --- a/hw/timer/imx_epit.c +++ b/hw/timer/imx_epit.c @@ -179,7 +179,7 @@ static void imx_epit_update_compare_timer(IMXEPITState *s) * the compare value. Otherwise it may fire at most once in the * current round. */ - is_oneshot = (limit >= s->cmp); + is_oneshot = (limit < s->cmp); if (counter >= s->cmp) { /* The compare timer fires in the current round. */ counter -= s->cmp;