From nobody Wed Nov 12 13:16:20 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=1571319820; cv=none; d=zoho.com; s=zohoarc; b=H2Jhs6n/4H2IdaJMRF6aiI6uBDZMr0tUE/zRlfUGwZyRaku+I5PpEuOU3gSsNFsApFrxWv9FEvw8DKMcUp/VVu2dmCiuXiuwvUM7UFQ88a95LPeSfTAq/90oS1Np7bCuiwK2rb/B2eYo6IzOh8c6/h2Uybw85ksemU9JaWEjHW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571319820; 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=We+bFOtG4HDLIryRINVpil47T9Rtk94/5StL1YZ+S34=; b=DiZJH1w+IZJPP3Vlz/WDeUSg2UwDobyPuJ599sowvXX+iSdglLhH2Hl62sMbLYBj5sLHT8BJk+trO5kMvUQkhdFb/4r2+F8mE3a/jsRlTr84AqBvXds22ArWsfbPQolDY9hhGk7Berl039MVfBtwep6nXgkpMYj0ekxe5EQa3vc= 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 1571319820035960.6696640804179; Thu, 17 Oct 2019 06:43:40 -0700 (PDT) Received: from localhost ([::1]:48210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL642-0007GQ-Ea for importer@patchew.org; Thu, 17 Oct 2019 09:43:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34919) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5ib-0004z3-0s for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5iZ-0000Mj-R5 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:28 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:52265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5iZ-0000M0-Kh for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:27 -0400 Received: by mail-wm1-x343.google.com with SMTP id r19so2561941wmh.2 for ; Thu, 17 Oct 2019 06:21:27 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:21:25 -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=We+bFOtG4HDLIryRINVpil47T9Rtk94/5StL1YZ+S34=; b=sm1p9J+UWdsFztZfvPafIqHp2g6sBQ3CVtW5d4OPtsJq308+fAxTstwTvA4uuqnsLC aQ1LmsWEwBfrG3VMCwn2/thu2B6190edOQFAB1sVWUBsjGo2asNeHPFx0EFCwq8Ney4g XGoDtiR6bfs0rNWHJXcV/vJukRmlgq2NSKyZMH/8z/V1Ph8G4V+maAwPDniB+iDivv1k LpuXMKskq/LnWcxPWQ4TXS1/UzOQtXTduyWlNX3EPADLkS/NWaB0pp7So4Mt1DlIxw2C +QZBdTlZeDo7oKeB48B/jXV46K3tJ34qx9I4FprX2Zrfqa/i5RBaEybb3hnRtE/pZqOP Pggg== 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=We+bFOtG4HDLIryRINVpil47T9Rtk94/5StL1YZ+S34=; b=Xvf4AvdvBaUlvFuljEla3NLzUWqMV7jUhwIWaNQ6NVRdR5a/suFNqiuxYWZ806ovRx 9EqTBDVQyIy7Ow4yGpt5nZHqqtPqpj5YHTXcLTjBLPByZa2yOZBdoHK30gyoaKvgX9Vm Pg680cNkKIm3qA8+eQS4LsKFK97VaGoY5dVd98NEVN1B5/gNkgXiELStp1pyXzMP90W6 wmuEa4bne/lnQNnpko5aNLRT+PlMM3aJwyjYlSVu5U6mo0x8LfHO2BK9UOlhv+qFla1B V4i1mhMVhrZWKjJxBZ/te7pZ0kaPqskDNL17kKcGFNSiMr4xEhAvYLlZEQpE22qicgNR 0J9Q== X-Gm-Message-State: APjAAAXk52MrqoqNNomh/AHBDnz1vR+OXa6MZj9sa90+vI7Rn0bf7dlw lsu/X+ajpQSsUKfw9v4SHz3KISse3KsQbQ== X-Google-Smtp-Source: APXvYqwEI0440tYtGdgGBI9YcKj1Qvj1PCUIVxCQpQ6XRG5iY3PFrVJZcSx5cEIA4veWpBJDnPenYw== X-Received: by 2002:a7b:c3d2:: with SMTP id t18mr3069113wmj.66.1571318486414; Thu, 17 Oct 2019 06:21:26 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 1/3] hw/net/fsl_etsec/etsec.c: Switch to transaction-based ptimer API Date: Thu, 17 Oct 2019 14:21:20 +0100 Message-Id: <20191017132122.4402-2-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::343 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 fsl_etsec 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/net/fsl_etsec/etsec.h | 1 - hw/net/fsl_etsec/etsec.c | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h index 09d05c21338..7951c3ad65f 100644 --- a/hw/net/fsl_etsec/etsec.h +++ b/hw/net/fsl_etsec/etsec.h @@ -141,7 +141,6 @@ typedef struct eTSEC { uint16_t phy_control; =20 /* Polling */ - QEMUBH *bh; struct ptimer_state *ptimer; =20 /* Whether we should flush the rx queue when buffer becomes available.= */ diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index d9b3e8c691e..717de76569a 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -34,7 +34,6 @@ #include "etsec.h" #include "registers.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "qemu/module.h" =20 /* #define HEX_DUMP */ @@ -195,9 +194,11 @@ static void write_dmactrl(eTSEC *etsec, =20 if (!(value & DMACTRL_WOP)) { /* Start polling */ + ptimer_transaction_begin(etsec->ptimer); ptimer_stop(etsec->ptimer); ptimer_set_count(etsec->ptimer, 1); ptimer_run(etsec->ptimer, 1); + ptimer_transaction_commit(etsec->ptimer); } } =20 @@ -391,10 +392,10 @@ static void etsec_realize(DeviceState *dev, Error **e= rrp) object_get_typename(OBJECT(dev)), dev->id, e= tsec); qemu_format_nic_info_str(qemu_get_queue(etsec->nic), etsec->conf.macad= dr.a); =20 - - etsec->bh =3D qemu_bh_new(etsec_timer_hit, etsec); - etsec->ptimer =3D ptimer_init_with_bh(etsec->bh, PTIMER_POLICY_DEFAULT= ); + etsec->ptimer =3D ptimer_init(etsec_timer_hit, etsec, PTIMER_POLICY_DE= FAULT); + ptimer_transaction_begin(etsec->ptimer); ptimer_set_freq(etsec->ptimer, 100); + ptimer_transaction_commit(etsec->ptimer); } =20 static void etsec_instance_init(Object *obj) --=20 2.20.1 From nobody Wed Nov 12 13:16:20 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=1571320336; cv=none; d=zoho.com; s=zohoarc; b=H4iwuq1qOG3l39RvsiPYhhR5Rk8vz+6E5atrI+6LrWaetkc6/+4XqF22yn6+UCbZZKbpxm/RYVzemKAtm40WqYJLQdh8kZr6EhgXXwig7JPKz4EunVrDRdIMsOv5VElW00JxCmETxti/J4as3/I9XrZf1njuyln0kwlttHIKdnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571320336; 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=DQC4XpSmd8PGYvkUObRMkiwdpTVp4qnrLAv8MVPjMfc=; b=fRA/4jF9p6WSjLDTp6vz0rL46oV8HjaWvtprzQKtGgPA++bYixwPDlWnEiYqzrKqs4qY9cKm5FVLrenVOqWoaub3zPjBG3vQuReVt1h8QEzDWXNwJgqr5/h5dnY96WguV34kcApPvNI67wyypzjBY3/mdjUW55h7ilH3KMG/At0= 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 1571320336888673.4332994939483; Thu, 17 Oct 2019 06:52:16 -0700 (PDT) Received: from localhost ([::1]:48420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL6CN-0007xv-11 for importer@patchew.org; Thu, 17 Oct 2019 09:52:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34962) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5ic-00051M-HC for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5ib-0000Ox-5x for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:30 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:34289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5ia-0000NA-Vz for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:21:29 -0400 Received: by mail-wm1-x342.google.com with SMTP id y135so7032247wmc.1 for ; Thu, 17 Oct 2019 06:21:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:21:27 -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=DQC4XpSmd8PGYvkUObRMkiwdpTVp4qnrLAv8MVPjMfc=; b=BXoRk4ipvCCHTzB5RH6mflZFBLDZYC2GIPWZuUYfvFaTPwMcEDViqdxSZo+QUkPufI niPgKR7Skh6NKKRwAtfthFcSPc38C0OgDt06iA89Z1tXnDJyBOgXt+wW40OIQI3Dmlj3 RkcRAWLWjpy6ltoaZrrE8UPBa6VAOdrY+CspInsGbIPB5RC3iXBmRcaNWOhiXDKsNdrU 93GaLbwRDIQIfnctVCd7SouAj71maxDOBx5purizGDt4zWlOiZpYJyQnW/ExQx9v5uWh kFWSMiRc1wtBny+TFLKicoCBYmdO5sfN6YplLZmDpSxFgM6/5tdNEUVYA9O7PmQvFpqB 6NQQ== 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=DQC4XpSmd8PGYvkUObRMkiwdpTVp4qnrLAv8MVPjMfc=; b=RvrOjGWk1C7dL9pzyd8OxFCi4pLbUagFnMcqq2hljDBTATcFNDuzF2M1w7YRCsgWJ5 cb4PkXhNcLfzqahGjNXqAI4+JrkhoQFHdtjBJMYgnnQb13BQmyI+yqf9opUo/tkpH5Pd KfUPOeP6dHTsHtO1KHf4ngwdnG2VLt4TppsQHG9UZ5PU6Su3NG56NryHG4Hiebsimsu4 pI/7+UdXtrLfM4zJqIo20A7Rtjo4UBx24hOzMT9/bBDtB4oYsWuW7tLHr/aC8MJ7b6AO MKraLjKwigLPprpVk80Sfhf4I+9xdwT76w0Hjx8BkXUdJrbo50g8zxdy2POaB/fpe/TJ 4IvQ== X-Gm-Message-State: APjAAAXOSueYP2dyia+5jSzJGjkW/FdkTzE9PyCXM8CIqYJd6gZWALKj 5QqUHi5Jz6/kH2JKDBf1yVaX40nnd8pAKA== X-Google-Smtp-Source: APXvYqxW/k0kSnsy2TV3ex98SGBPoAJS1zfNU5j5xKsAp0Lr/7nMlCQmKXphXax43zgqOzs7kJQR+Q== X-Received: by 2002:a7b:c444:: with SMTP id l4mr2915340wmi.49.1571318487648; Thu, 17 Oct 2019 06:21:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/3] hw/timer/xilinx_timer.c: Switch to transaction-based ptimer API Date: Thu, 17 Oct 2019 14:21:21 +0100 Message-Id: <20191017132122.4402-3-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_timer 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/timer/xilinx_timer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 92dbff304d9..7191ea54f58 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -28,7 +28,6 @@ #include "hw/ptimer.h" #include "hw/qdev-properties.h" #include "qemu/log.h" -#include "qemu/main-loop.h" #include "qemu/module.h" =20 #define D(x) @@ -52,7 +51,6 @@ =20 struct xlx_timer { - QEMUBH *bh; ptimer_state *ptimer; void *parent; int nr; /* for debug. */ @@ -134,6 +132,7 @@ timer_read(void *opaque, hwaddr addr, unsigned int size) return r; } =20 +/* Must be called inside ptimer transaction block */ static void timer_enable(struct xlx_timer *xt) { uint64_t count; @@ -174,8 +173,11 @@ timer_write(void *opaque, hwaddr addr, value &=3D ~TCSR_TINT; =20 xt->regs[addr] =3D value & 0x7ff; - if (value & TCSR_ENT) + if (value & TCSR_ENT) { + ptimer_transaction_begin(xt->ptimer); timer_enable(xt); + ptimer_transaction_commit(xt->ptimer); + } break; =20 default: @@ -220,9 +222,10 @@ static void xilinx_timer_realize(DeviceState *dev, Err= or **errp) =20 xt->parent =3D t; xt->nr =3D i; - xt->bh =3D qemu_bh_new(timer_hit, xt); - xt->ptimer =3D ptimer_init_with_bh(xt->bh, PTIMER_POLICY_DEFAULT); + xt->ptimer =3D ptimer_init(timer_hit, xt, PTIMER_POLICY_DEFAULT); + ptimer_transaction_begin(xt->ptimer); ptimer_set_freq(xt->ptimer, t->freq_hz); + ptimer_transaction_commit(xt->ptimer); } =20 memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "xlnx.xps-ti= mer", --=20 2.20.1 From nobody Wed Nov 12 13:16:20 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