From nobody Wed Nov 12 15:02:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571320553; cv=none; d=zoho.com; s=zohoarc; b=aJJe5V6f6PPs1Xr25ZBybxQ1U6jtI6BuHVtV2AfPK8wJSgbncVbT+rPlCr/UdV61Fldk/uikkWBv62xt6R22oUKwUX+i+oUWO6HF8C2fvWrXpQ40hWZ7Oa0/T1zb9jLydR5LSVBzUp88vHd4u7dAvEknEX083p9PUc3o3oyCcXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571320553; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KWHu+m1O+EERA4S9NNTm+FIYK5BZF9JX07P8U3F6Cyk=; b=KQngVc+rnAisioxbinbJ/kHB942jGAGr3yQZtFvNQjDI2xPb3X+OwzQNkDSLGSHQ9NvQ0idvmsm5nZciJbhtB/L8KVgbEFPQz2XoBAZiWxrV2oBNY/tj1Z2vTh998F4tlIycW/k0aNuCUobzkpQ/YTcoFeYaHdz0f0jA12N4CX8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571320553104963.4498370832284; Thu, 17 Oct 2019 06:55:53 -0700 (PDT) Received: from localhost ([::1]:48490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL6Fn-0003mI-Bv for importer@patchew.org; Thu, 17 Oct 2019 09:55:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35002) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5id-00053N-LK for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5ic-0000Pp-F8 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:31 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:55474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5ic-0000PD-79 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:30 -0400 Received: by mail-wm1-x342.google.com with SMTP id a6so2535214wma.5 for ; Thu, 17 Oct 2019 06:21:30 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id e9sm11543164wme.3.2019.10.17.06.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KWHu+m1O+EERA4S9NNTm+FIYK5BZF9JX07P8U3F6Cyk=; b=iuGkR5zCFL4filGYWyr6lIL6j5aQJ/Bxt6aRGY5pOq+xT7IEWp8369nt/MTC1yiN7h AZi6Sl8AsceN6aONXZ2s9fXrqRLyDVvmkXD0/Qtck7e07xwjTSylbb87zArPWTsiakUv T8BGsgJ2ILhHgqC/MQSyveu3o/i3NZQem/3jU9SCgBaJRNC2mwNVISy37Vv1ZJ7OSrjH kX5bDe2FXD2QmhTIzTfxQQUBcqalUpdri0pTxo7VwNgPqFugSBm5HNelZAgJIoxPaLR0 INMp3EZDvG7LDpUF4n+jG+lxAUGtnc5o4SzOz66wfiqAqyrXdWqoj0MXiVlahB31ohOm 9t1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KWHu+m1O+EERA4S9NNTm+FIYK5BZF9JX07P8U3F6Cyk=; b=S9O9YohQbHTKacbFGRyIn7VLAhAJREz971coMYn+AZF7bAmQGSfEh295JuFb8XFRAb 1ZKqtXbycbOzs3HtFTokv4Ef4CsySSUMkotmWFj1o6xsw3mYA+Bm+Z2I8Smcj9/G+sx3 +ExD8KHUiCr/f1/rROrWf/OJkUgkWawnDsw2aTGi4ep5EH1t+uzcbWSpdcHUhUVWoQqr 8eK08UDQyzPDmmtqcuP563/uwCto4n6hNEixlyq+UeThjGvTvLiK86YLDOyu3BdaeWKN VOQhoYIvLFcUR+HdxhRSj9B+T+V2JuYRF3njaFuYXu5ju0g7mfaR7uYBAyiDPf8wVjre NUzQ== X-Gm-Message-State: APjAAAU/3Ncgoa4pkRzN+owFGoyYAhmgdPYcoQJh+ZjZcEqT02dMxJ+2 lJQypj/X0U1MDTinJL5WihIxgM00d3+m9w== X-Google-Smtp-Source: APXvYqyO68O8sT8SfsWQwNqGoXsIoG9yk6awNeiYKx/xMQU4OcRBgfNCTH6ZtIqi3UJRicKuI28peQ== X-Received: by 2002:a7b:c011:: with SMTP id c17mr2959378wmb.95.1571318488967; Thu, 17 Oct 2019 06:21:28 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 3/3] hw/dma/xilinx_axidma.c: Switch to transaction-based ptimer API Date: Thu, 17 Oct 2019 14:21:22 +0100 Message-Id: <20191017132122.4402-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017132122.4402-1-peter.maydell@linaro.org> References: <20191017132122.4402-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Alistair Francis , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, "Edgar E. Iglesias" , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Switch the xilinx_axidma code away from bottom-half based ptimers to the new transaction-based ptimer API. This just requires adding begin/commit calls around the various places that modify the ptimer state, and using the new ptimer_init() function to create the timer. Signed-off-by: Peter Maydell Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/dma/xilinx_axidma.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index e035d1f7504..fb3a978e282 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -31,7 +31,6 @@ #include "hw/ptimer.h" #include "hw/qdev-properties.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "qemu/module.h" =20 #include "hw/stream.h" @@ -104,7 +103,6 @@ enum { }; =20 struct Stream { - QEMUBH *bh; ptimer_state *ptimer; qemu_irq irq; =20 @@ -242,6 +240,7 @@ static void stream_complete(struct Stream *s) unsigned int comp_delay; =20 /* Start the delayed timer. */ + ptimer_transaction_begin(s->ptimer); comp_delay =3D s->regs[R_DMACR] >> 24; if (comp_delay) { ptimer_stop(s->ptimer); @@ -255,6 +254,7 @@ static void stream_complete(struct Stream *s) s->regs[R_DMASR] |=3D DMASR_IOC_IRQ; stream_reload_complete_cnt(s); } + ptimer_transaction_commit(s->ptimer); } =20 static void stream_process_mem2s(struct Stream *s, StreamSlave *tx_data_de= v, @@ -551,9 +551,10 @@ static void xilinx_axidma_realize(DeviceState *dev, Er= ror **errp) struct Stream *st =3D &s->streams[i]; =20 st->nr =3D i; - st->bh =3D qemu_bh_new(timer_hit, st); - st->ptimer =3D ptimer_init_with_bh(st->bh, PTIMER_POLICY_DEFAULT); + st->ptimer =3D ptimer_init(timer_hit, st, PTIMER_POLICY_DEFAULT); + ptimer_transaction_begin(st->ptimer); ptimer_set_freq(st->ptimer, s->freqhz); + ptimer_transaction_commit(st->ptimer); } return; =20 --=20 2.20.1