From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAB66C35247 for ; Mon, 3 Feb 2020 17:42:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52B1B2051A for ; Mon, 3 Feb 2020 17:42:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=megamailservers.eu header.i=@megamailservers.eu header.b="g+vyjUW3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52B1B2051A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=o2online.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyfkA-0002qj-85 for qemu-devel@archiver.kernel.org; Mon, 03 Feb 2020 12:42:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42405) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyfj3-0002Jc-Cp for qemu-devel@nongnu.org; Mon, 03 Feb 2020 12:41:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyfj2-0003KH-E9 for qemu-devel@nongnu.org; Mon, 03 Feb 2020 12:41:33 -0500 Received: from mail1454c50.megamailservers.eu ([91.136.14.54]:52974 helo=mail266c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyfiz-0002vb-Cm; Mon, 03 Feb 2020 12:41:30 -0500 X-Authenticated-User: 017626146082@o2online.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1580744483; bh=UEdoKkBekSSPy6Qva+zTYSGw/Rf/PxDmGz4nNClJIFw=; h=From:To:Cc:Subject:Date:From; b=g+vyjUW3mtpmUo7qWoMTJkoXtilP06Y4BQASpVpatLAQRs/rwHKcr+BITr4d4Vqxg pVSZBhaU7EgQwvWvtI2Smg4p1pZuXOR3LtWBODobZ+zbFu3hWOe88/LLOgNqWyZMrJ s7MjQusGqd/zgbsCYqzZMF+hxoPxZUClHLwHNO5A= Feedback-ID: rsta2@o2online. Received: from desktop2.localnet (178-21-1-177.ilmprovider.net [178.21.1.177]) (authenticated bits=0) by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 013FfLPU022990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 3 Feb 2020 15:41:23 +0000 From: Rene Stange To: Philippe =?ISO-8859-1?Q?Mathieu=2DDaud=E9?= Subject: [PATCH v2 2/2] bcm2835_dma: Re-initialize xlen in TD mode Date: Mon, 03 Feb 2020 16:40:51 +0100 Message-ID: <5397138.k0qeMALlIp@desktop2> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-CTCH-RefID: str=0001.0A0B0201.5E383F23.0053, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=PNJxBsiC c=1 sm=1 tr=0 a=oFQkuSNlBNCQRuITVo1IXg==:117 a=oFQkuSNlBNCQRuITVo1IXg==:17 a=kj9zAlcOel0A:10 a=SvY40l2xVmRt99U1V6QA:9 a=CjuIK1q_8ugA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.14.54 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: Peter Maydell , qemu-arm , qemu-devel , Andrew Baumann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" TD (two dimensions) DMA mode did not work, because the xlen variable has not been re-initialized before each additional ylen run through in bcm2835_dma_update(), which has been fixed. Signed-off-by: Rene Stange --- hw/dma/bcm2835_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c index 667d951a6f..ccff5ed55b 100644 --- a/hw/dma/bcm2835_dma.c +++ b/hw/dma/bcm2835_dma.c @@ -54,7 +54,7 @@ static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c) { BCM2835DMAChan *ch = &s->chan[c]; - uint32_t data, xlen, ylen; + uint32_t data, xlen, xlen_td, ylen; int16_t dst_stride, src_stride; if (!(s->enable & (1 << c))) { @@ -82,6 +82,7 @@ static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c) dst_stride = 0; src_stride = 0; } + xlen_td = xlen; while (ylen != 0) { /* Normal transfer mode */ @@ -117,6 +118,7 @@ static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c) if (--ylen != 0) { ch->source_ad += src_stride; ch->dest_ad += dst_stride; + xlen = xlen_td; } } ch->cs |= BCM2708_DMA_END; -- 2.16.4