From nobody Tue Feb 10 04:15:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1588264372; cv=none; d=zohomail.com; s=zohoarc; b=MmPAiLGj3SReyucS2PD7XvuvkzbpbJEd9biUcSSXDM3gl7zAZx3R6BJL7ZVdQhmJljSW34FcmQQF7brmR1YOY2Ttsr6XHoP8SjBLj3ekcQ1YBnBfe/4rRbZDs9YL+33c+KsG246FCxca0+Dh4xomkTY5GjR8TIuN18IE4lxBaQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588264372; 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=zPUxzOtPNu1fe6DQ31CH/IJkXZJ41diGLg/8g0TM01Q=; b=DAXDPcW84kLf2gildJv5Wfq9UZ5DJbcunGQo31NCOWTCI0NFlZmm2GNPOcrTLl6eYqgA3QXt8QKut+1tykYjZBh84QCABL2pFDuhhw86dnnclY268/mqtrgfxfn2mzrryrCfNEVSDBHz1/W6SzVjCsaHD86ugEyz/0BAj7DBA5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1588264372826907.1103235866319; Thu, 30 Apr 2020 09:32:52 -0700 (PDT) Received: from localhost ([::1]:35562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUC7H-0006gM-GE for importer@patchew.org; Thu, 30 Apr 2020 12:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48628) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUC07-0004zH-0G for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:26:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUBzZ-0002TY-NA for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:25:26 -0400 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:35984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUBzZ-0002Nl-8H; Thu, 30 Apr 2020 12:24:53 -0400 Received: by mail-lf1-x142.google.com with SMTP id w14so1754783lfk.3; Thu, 30 Apr 2020 09:24:52 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id y22sm74264lfg.92.2020.04.30.09.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 09:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zPUxzOtPNu1fe6DQ31CH/IJkXZJ41diGLg/8g0TM01Q=; b=XDZoj706sfilJrlYBVD7FpNCu/SZKuAcP15OGZY7RXiPEVP0pvgwHJLY+CYZ0OlERa KBXXcHiUspRR0h2pbuAgtdfxujBjzT/xQw+dA0exo0ErOWosU+6HuK1KAR9Ho2kAYiDX fI4gjemU9yiRXKOsjGo5m8Qosmz4ZjzfMWJI09W99G/2/aqzmRrbq7DnexpUbeSB97hF 75tWsubItWhVgvm9b4kTLiJ7gQVX1q928heJii+DDcKg/R/CUbFGsn4mUkVtGsT09ddQ qTqXh0vMcA0JVQ9bGTZKBTi+2xxvhUfMyEdCouq+a3rd8CdKydaNlzkBi2A6SHt/rwTD KwMg== 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=zPUxzOtPNu1fe6DQ31CH/IJkXZJ41diGLg/8g0TM01Q=; b=kGTu1k6+1gqN4jZv0x+c8zchdx0wteNA5AQFdAmfvPLuGX81eQvY7hOhUwJeZZk6J9 TdyoYcK1jGuxntVh2AtKEiaZvrkbqJN5QaVUtD2B3Bu8DIEUfYD91FR2T6K6JHViJGC5 0/l4ecJk6k2HDboD2q79O71mfmi9+E54arhk+siUa4etVoBzghtabcJ2mS7CSO6/k4h1 BxcBEwu/Yj0mTzQSvs7huxFy8ARPc74VG9e2azx3q+8LFuWa1p1EJlVS2ppwmb0Mugpa ItbEfdMVUroJgthhK/5om5z7G0QkfUJ+2Z6ible6q+FETXdCWbH9sEgSIwKuEGcWj2is NiFA== X-Gm-Message-State: AGi0PuZZbNdQ8AFbVt857ZrBbKm36knNadA0WHoucQ8nJGr54DqHtqgo I1LmfF6hBEAM2ayxXORsxcgbEjKJ84A= X-Google-Smtp-Source: APiQypKa17ljhc6s7yByIeJR1qoEdsq5qsqlHDMWcPsDElLbQYXt/Mt/TZ6CvPv/vQ91iqac3ugx9A== X-Received: by 2002:a05:6512:3ef:: with SMTP id n15mr2456368lfq.2.1588263891061; Thu, 30 Apr 2020 09:24:51 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 8/9] hw/dma/xilinx_axidma: s2mm: Support stream fragments Date: Thu, 30 Apr 2020 18:24:38 +0200 Message-Id: <20200430162439.2659-9-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430162439.2659-1-edgar.iglesias@gmail.com> References: <20200430162439.2659-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::142; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x142.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::142 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: damien.hedde@greensocs.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, jasowang@redhat.com, alistair@alistair23.me, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, figlesia@xilinx.com 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" From: "Edgar E. Iglesias" Add support for stream fragments. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/dma/xilinx_axidma.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 101d32a965..87be9cade7 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -110,6 +110,7 @@ struct Stream { =20 int nr; =20 + bool sof; struct SDesc desc; unsigned int complete_cnt; uint32_t regs[R_MAX]; @@ -174,6 +175,7 @@ static void stream_reset(struct Stream *s) { s->regs[R_DMASR] =3D DMASR_HALTED; /* starts up halted. */ s->regs[R_DMACR] =3D 1 << 16; /* Starts with one in compl threshold. = */ + s->sof =3D true; } =20 /* Map an offset addr into a channel index. */ @@ -321,12 +323,11 @@ static void stream_process_mem2s(struct Stream *s, St= reamSlave *tx_data_dev, } =20 static size_t stream_process_s2mem(struct Stream *s, unsigned char *buf, - size_t len) + size_t len, bool eop) { uint32_t prev_d; unsigned int rxlen; size_t pos =3D 0; - int sof =3D 1; =20 if (!stream_running(s) || stream_idle(s)) { return 0; @@ -352,16 +353,16 @@ static size_t stream_process_s2mem(struct Stream *s, = unsigned char *buf, pos +=3D rxlen; =20 /* Update the descriptor. */ - if (!len) { + if (eop) { stream_complete(s); memcpy(s->desc.app, s->app, sizeof(s->desc.app)); s->desc.status |=3D SDESC_STATUS_EOF; } =20 - s->desc.status |=3D sof << SDESC_STATUS_SOF_BIT; + s->desc.status |=3D s->sof << SDESC_STATUS_SOF_BIT; s->desc.status |=3D SDESC_STATUS_COMPLETE; stream_desc_store(s, s->regs[R_CURDESC]); - sof =3D 0; + s->sof =3D eop; =20 /* Advance. */ prev_d =3D s->regs[R_CURDESC]; @@ -426,8 +427,7 @@ xilinx_axidma_data_stream_push(StreamSlave *obj, unsign= ed char *buf, size_t len, struct Stream *s =3D &ds->dma->streams[1]; size_t ret; =20 - assert(eop); - ret =3D stream_process_s2mem(s, buf, len); + ret =3D stream_process_s2mem(s, buf, len, eop); stream_update_irq(s); return ret; } --=20 2.20.1