From patchwork Sat Jan 14 05:35:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 9516723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4485F607D6 for ; Sat, 14 Jan 2017 05:37:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34BE928249 for ; Sat, 14 Jan 2017 05:37:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 298AA2844B; Sat, 14 Jan 2017 05:37:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F99D28249 for ; Sat, 14 Jan 2017 05:36:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cSH1M-00086c-AI; Sat, 14 Jan 2017 05:36:56 +0000 Received: from mail-eopbgr730083.outbound.protection.outlook.com ([40.107.73.83] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSH0x-0007Vk-5q for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2017 05:36:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JM+cbvi3F61IvFqQdq2UYR3Ugrkhy3/wYUn/tex/PDo=; b=OtBmTstsswrZ95u1TXrQOxX6qRu4TWNi3mAwTh8VyP++83x1StlP6cPo4i4fxPqZV9LD+nZegsRhwgye6ROEmZsxlFUvfpMQGNO1k8NbIquOR0CF4B7rynqZgWJeMAPXbuzptuEzE6XPaxPePA78n7W16Bnpr8A8DsSnSbePx60= Received: from BN6PR02CA0044.namprd02.prod.outlook.com (10.173.146.158) by DM2PR0201MB0765.namprd02.prod.outlook.com (10.160.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Sat, 14 Jan 2017 05:36:05 +0000 Received: from CY1NAM02FT056.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by BN6PR02CA0044.outlook.office365.com (2603:10b6:404:5f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via Frontend Transport; Sat, 14 Jan 2017 05:36:04 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=bestguesspass action=none header.from=xilinx.com; arm.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT056.mail.protection.outlook.com (10.152.74.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Sat, 14 Jan 2017 05:36:03 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:33823 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1cSH0U-0006vb-Mo; Fri, 13 Jan 2017 21:36:02 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cSH0T-0004JU-KH; Fri, 13 Jan 2017 21:36:01 -0800 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cSH0R-0004JJ-Mu; Fri, 13 Jan 2017 21:36:00 -0800 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 13614) id C8225F20014; Sat, 14 Jan 2017 11:05:58 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , , , Subject: [PATCH v6 2/3] dmaeninge: xilinx_dma: Fix bug in multiple frame stores scenario in vdma Date: Sat, 14 Jan 2017 11:05:54 +0530 Message-ID: <1484372155-19423-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1484372155-19423-1-git-send-email-appanad@xilinx.com> References: <1484372155-19423-1-git-send-email-appanad@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22820.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39840400002)(39410400002)(2980300002)(438002)(3190300001)(199003)(189002)(81166006)(8676002)(50986999)(356003)(81156014)(52956003)(2950100002)(2906002)(50226002)(42186005)(6666003)(2201001)(8936002)(33646002)(36386004)(76176999)(305945005)(5001770100001)(27001)(63266004)(626004)(5660300001)(92566002)(90966002)(4326007)(7416002)(45336002)(189998001)(46386002)(106466001)(38730400001)(54906002)(5003940100001)(47776003)(36756003)(103686003)(50466002)(48376002)(921003)(107986001)(2101003)(83996005)(5001870100001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0765; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT056; 1:dloAiMJQi1AcLMaHfP9BYtdzFmAwc+5FgGonyerni9bCE+3JUdDc+AOTzt2rbcUQrDCaMqh6gRuJaq9mLPVxAKQWxx2yOgVNgwGMQwntIsTzTCPF7tIqhGxXxAHFPA2aT3qTdcV4MMJHGtjBOvXxsr9z3iOQQvam29aZYMGamWJ7VSEix9fuKlKizT/ds3lsXuZABM2wCeNmKP4m8oF+3pGWAJj13iAQXQGIOPYfNfIGdifXdgLOS8MmsxpqSQP/Tp9oHgF34UVd3KIRVvzGjvCXXz+qkOSPwSHDxiA7Ja1JtC+zuuUghYuPt5NdoA+CbxAlrsE4v5DUi8dYOUVQlS99/sI/TB4Mvz3j63e0tjWzfiu2RgBjRcfdWeV8wuY2V9GyDz5gKWrTtTv8jUQBuHG2UJUqlsm07F6kY09P+q5mrusdjRmB2nNJ7u9AtCeAMe8CD7abSsxN+eX8x9To4GyLaZbK5Iu1jJOycdHjJJaP+SwmYQBHMIZwNjm5bmSJTn7l8Cw7Zzwp6xN5kFwuAaiZ03vw+i7PMznA/n1UDZi1SmJfr7oAvhKTvmmtoJLDnuyMjHzAmn3Ju47vFdsjWZ8xpf96SrLL2vVISQxAyiFoVghO++y0Hzx4weKfQbop/9hHO+TRf9YrejEWJ6wG5g== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 27b49b9a-452d-47c2-777e-08d43c3f3b25 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM2PR0201MB0765; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0765; 3:40z/ox4xxMstaqNLip9kfr3dxA0/emoxqb4fp80/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96lmtgh1/vovSWvE22s9R36rCU635Ll/l3njVP69ZwSvd+d/H/e7CHFtBw+qFDr79V017Ypqkw==; 20:SaTqabCtnxY5Ca+1pGmSXOBcZEwc1oEn5p+HM7xPqZfXVNrNhdRpoj8E4GlShgAdxRW/eFhqAbef3rHpLxkT+fuQ7X2olJ5JEv5mjE/nuuOPjfn6gdjF0en3nH1TB9ercpaeOvQVXdU5CJfbtxJ12+k4WHX1bsy2Nf2I81JCWTyfOSo7BbNFqa+nHxftvFjCXqbcVSrQvruRv0Tp+mlcqEhpZ6XSk5o8JHoSNuiANdPOrVOjqhAn0HjfENcq2C+n+fmY2DTAYcbY0lWzf5XmQmHVyF84vPkvWpOizP37dDXFYnMoYYL3bLVVrgDuMqa29zzle5foCUnk5y5WSXub79Uv/hJW03AyEJVMrSkoAtPKG7GbNABAhzszoTlHApcgEt4+pmXgJl8pui6EbENMDNuhQeIG/CDnDchI/4HUNpC4Vk/iVfMRjer2ePM86bscPumZ8arzf2iERRgglhpEl99xdPgbU7UvKwWA4kV3QMOyejei/f7hGajf59+VtCng X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13017025)(13023025)(13024025)(13015025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:DM2PR0201MB0765; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0201MB0765; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0765; 4:mRqD3mvwbP7BCspt7fjNzV0ND+ghEvjsvracifA5lWw9Obg1neLhZ2pLuGgH4/yg7SPO2U0hrr9Vxnaikv2vQ+sezK7RT3uLhL+xYMl5rqpAlshqhQVFI78Hrc3vnnnTaVL7iXQqYUVGemhbJ1zpSq6uM4UobNsvTweqBCqVVSBaRVzqWYMASbGK9KDeWXQW8F7GLegMiRrjPP5J/THZq7m/La6C+qzQkcDnoNQOa53Wsin0cqmWnufE6r5XYBx99lRkyi6aMiV5sJL6d7pKZMjVlxFp2khA9V541tHPEY6yj1/y+rORzEoP9WQ4mbhnKytX4Rnbuei05qJSHiPYSNp8PpCGX7g0dgUfLGfJOHBUlicCLUyRQEGvWrcTPdzYW0m8S2pMqVY71BbK5lKen2TWW5hCz7DzlFznfXP11bCLfjctmcrrElTY+m/3l8RDtEf97nC8hap7dBnnQdva4cTCNQ6Fa78ZjqZmt5PlqCkv2n+2Wd7lNmDITujzC9KhmbB1pSLhs3otRMIjuZsHbVHbDRnC1kstLIP7twENu0b65U7bijd1X539EXB/jDFRvDouzoQRX3Sm2vhKRyJOVEIXUSlEUiUi4s/CMOBMjYuUlCMljglL9ePQoUNO7FKLFwkmSLiCjGogmZpnHNL7eO2v3/vWqyUrqirOo2GMvmKfJDqQFr8lbl9sCFZIvkatFssfwwNa866TTInynaF+dsAJ6Z9Wfn40yM5qocUKH/A= X-Forefront-PRVS: 0187F3EA14 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0201MB0765; 23:imrIC3lTWYDHNgGhWg/gHSOgeSdbMcpB3MQDpUp?= =?us-ascii?Q?GBxfsUKOxKnz3JY5rMK9HCcDIvLAb/I/qE1nG2VPaB/T0umKzExgFz8NXXmS?= =?us-ascii?Q?TUouZM049S0zwdgD1QhDAGWQBMhmzbQDqB9FrmNXxpM7a2yehjrbi77BGOAO?= =?us-ascii?Q?k4Fk1Hy/i/d+0trLpq8Qie4duPL315EtBx+IkZeU5vCuFDOT7N16/aw11RP6?= =?us-ascii?Q?IBcpUTYATErOexi265uwN7LYRgp77XFh1xI7a7P5abLVxhmX3FE3KkL9JHmF?= =?us-ascii?Q?oCCwfA4/ESCyC9wLxkSqBo5dHF5e/fHbHIPQypMzaQ3QoJwvAgUtY89tIUEy?= =?us-ascii?Q?G9A90rumK6dqPrXOlX0XzleueQPSIVAK9leA/FfNYb7yCKFBBd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4lW//bbeTTn+Tytx5qRRUcH+K5d9Eic4mJVy5IzyNmvrnG?= =?us-ascii?Q?42Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0765; 6:GpH3lWYav7ihiCCiYdTPnWIte9yE5xMjAVaQbliHv9TX4tpm8D5geKdSwgEeVaKUjzOKbqtu1gIIrUkpQDNc7CU6+SXpf4bXyjkJt9UkCs/hS0RKD3bcY39ga7SfwLGiSb2hchh4ucNDk28au3rvuTMd9jR3gQtJGWGUZs5SqJFj+ry1TT13S51AOzabyDaCyCjTdlv++NFnZUrfl49vwB9/X2cDSf745DKcFiJ7eInw14OpyxywgKs5WjfErLXBVJsdMOO+BZ20oeEJRJRDx9q7NXSFx18yTZggNXps+sH/4BI9YwnaDZSxT9MyyD02Z273M2l66isajqYTad7cXGVOPVB3idpD8pzeNlYQ+zTX9afsL29MIjD0ZXm7xiGy/we+9NNzWOHSzOFOrziCb+fgQSFA7REwJ/pHwR/LzkgPF3SzoFdKH+itX/VUl51VLpQzK/hj49Ia2vzRcSY5pg==; 5:C6iTtlmMNfvl1HaeW7fD3kTJHyYe9ey5RCUZeTnG05fzFk6n86YJCNFzn77ey03rELBKXT9DsHcGPyVc/fv5gFRqLFpqGltHpRJ52zbjBt81Fbc2o0Xs/8sUqQXRulqrHtuhqey5fOCCqqU10Fj8qszsra3UC5sT/OyaNe/ju0M=; 24:ZPtz18nkENv0X8Nl1wKn3JePdUPEpAZwHbKqJn0+mUK0Nej+KJcnuC/XIL/JwbNjsjkYcsQ1PAr3hSEGNPcsfp96YIqKoXTOt/bCzMzl2fo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0765; 7:igsKAO3tpuOP1XkidJz+hgLNLvNYQodOmE6n/XS/cOsS8fIqSZOOp9tzzMkoetwthT/0YcOS/8Wucu7I/ieh+esCcZ/yhTvZBTiaGom5W0go5wmfTlaVqMypNrOk7tsPvaKGL0rJx9o6ktbnU8nxGMe3FQMy650th6/3hWF+3C890YxjlgRsEVxx5DS+99c9vs7Bu5lczP1v6WTtRKt98hWfuuJFE7AyBBDCmKuqVX1EGcq782Cj5zEv/hr+nzMdyh5Czv8K1i7j1jdU7UsHKNj38Pm7U5dRDuV1gQw43eaNARJTooMJO/HTs6NF2Fn2ynptH8/WGC6g9TqxdlCvAwBcqnZIEuZECjn60xrhIqVUS0QKPaDapqYF/VaUwLkUxtoKrCmvHXnUSOY389ZdrD6/G7cGEAgGiNvKVM9vbBbaYPRgITyw11mzXfdzLirbQh56YBLvFXtb5zUvmqB0Jg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2017 05:36:03.1812 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0201MB0765 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_213631_356500_25D2CAB8 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When VDMA is configured for more than one frame in the h/w. For example h/w is configured for n number of frames, user Submits n number of frames and triggered the DMA using issue_pending API. In the current driver flow we are submitting one frame at a time, But we should submit all the n number of frames at one time As the h/w is configured for n number of frames. This patch fixes this issue. Acked-by: Rob Herring Reviewed-by: Jose Abreu Signed-off-by: Kedareswara rao Appana --- Changes for v6: ---> Added Rob Acked-by ---> Updated commit message as suggested by Vinod. Changes for v5: ---> Updated xlnx,fstore-config property to xlnx,fstore-enable and updated description as suggested by Rob. Changes for v4: ---> Add Check for framestore configuration on Transmit case as well as suggested by Jose Abreu. ---> Modified the dev_dbg checks to dev_warn checks as suggested by Jose Abreu. Changes for v3: ---> Added Checks for frame store configuration. If frame store Configuration is not present at the h/w level and user Submits less frames added debug prints in the driver as relevant. Changes for v2: ---> Fixed race conditions in the driver as suggested by Jose Abreu ---> Fixed unnecessray if else checks in the vdma_start_transfer as suggested by Laurent Pinchart. .../devicetree/bindings/dma/xilinx/xilinx_dma.txt | 2 + drivers/dma/xilinx/xilinx_dma.c | 78 +++++++++++++++------- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt index a2b8bfa..e951c09 100644 --- a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt +++ b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt @@ -66,6 +66,8 @@ Optional child node properties: Optional child node properties for VDMA: - xlnx,genlock-mode: Tells Genlock synchronization is enabled/disabled in hardware. +- xlnx,fstore-enable: boolean; if defined, it indicates that controller + supports frame store configuration. Optional child node properties for AXI DMA: -dma-channels: Number of dma channels in child node. diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 5eeea57..edb5b71 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -322,6 +322,7 @@ struct xilinx_dma_tx_descriptor { * @genlock: Support genlock mode * @err: Channel has errors * @idle: Check for channel idle + * @has_fstoreen: Check for frame store configuration * @tasklet: Cleanup work after irq * @config: Device configuration info * @flush_on_fsync: Flush on Frame sync @@ -353,6 +354,7 @@ struct xilinx_dma_chan { bool genlock; bool err; bool idle; + bool has_fstoreen; struct tasklet_struct tasklet; struct xilinx_vdma_config config; bool flush_on_fsync; @@ -990,6 +992,27 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan) if (list_empty(&chan->pending_list)) return; + /* + * Note: When VDMA is built with default h/w configuration + * User should submit frames upto H/W configured. + * If users submits less than h/w configured + * VDMA engine tries to write to a invalid location + * Results undefined behaviour/memory corruption. + * + * If user would like to submit frames less than h/w capable + * On S2MM side please enable debug info 13 at the h/w level + * On MM2S side please enable debug info 6 at the h/w level + * It will allows the frame buffers numbers to be modified at runtime. + */ + if (!chan->has_fstoreen && + chan->desc_pendingcount < chan->num_frms) { + dev_warn(chan->dev, "Frame Store Configuration is not enabled at the\n"); + dev_warn(chan->dev, "H/w level enable Debug info 13 or 6 at the h/w level\n"); + dev_warn(chan->dev, "OR Submit the frames upto h/w Capable\n\r"); + + return; + } + desc = list_first_entry(&chan->pending_list, struct xilinx_dma_tx_descriptor, node); tail_desc = list_last_entry(&chan->pending_list, @@ -1052,25 +1075,38 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan) if (chan->has_sg) { dma_ctrl_write(chan, XILINX_DMA_REG_TAILDESC, tail_segment->phys); + list_splice_tail_init(&chan->pending_list, &chan->active_list); + chan->desc_pendingcount = 0; } else { struct xilinx_vdma_tx_segment *segment, *last = NULL; - int i = 0; + int i = 0, j = 0; if (chan->desc_submitcount < chan->num_frms) i = chan->desc_submitcount; - list_for_each_entry(segment, &desc->segments, node) { - if (chan->ext_addr) - vdma_desc_write_64(chan, - XILINX_VDMA_REG_START_ADDRESS_64(i++), - segment->hw.buf_addr, - segment->hw.buf_addr_msb); - else - vdma_desc_write(chan, - XILINX_VDMA_REG_START_ADDRESS(i++), - segment->hw.buf_addr); - - last = segment; + for (j = 0; j < chan->num_frms; ) { + list_for_each_entry(segment, &desc->segments, node) { + if (chan->ext_addr) + vdma_desc_write_64(chan, + XILINX_VDMA_REG_START_ADDRESS_64(i++), + segment->hw.buf_addr, + segment->hw.buf_addr_msb); + else + vdma_desc_write(chan, + XILINX_VDMA_REG_START_ADDRESS(i++), + segment->hw.buf_addr); + + last = segment; + } + list_del(&desc->node); + list_add_tail(&desc->node, &chan->active_list); + j++; + if (list_empty(&chan->pending_list) || + (i == chan->num_frms)) + break; + desc = list_first_entry(&chan->pending_list, + struct xilinx_dma_tx_descriptor, + node); } if (!last) @@ -1081,20 +1117,14 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan) vdma_desc_write(chan, XILINX_DMA_REG_FRMDLY_STRIDE, last->hw.stride); vdma_desc_write(chan, XILINX_DMA_REG_VSIZE, last->hw.vsize); - } - chan->idle = false; - if (!chan->has_sg) { - list_del(&desc->node); - list_add_tail(&desc->node, &chan->active_list); - chan->desc_submitcount++; - chan->desc_pendingcount--; + chan->desc_submitcount += j; + chan->desc_pendingcount -= j; if (chan->desc_submitcount == chan->num_frms) chan->desc_submitcount = 0; - } else { - list_splice_tail_init(&chan->pending_list, &chan->active_list); - chan->desc_pendingcount = 0; } + + chan->idle = false; } /** @@ -1342,6 +1372,7 @@ static int xilinx_dma_reset(struct xilinx_dma_chan *chan) chan->err = false; chan->idle = true; + chan->desc_submitcount = 0; return err; } @@ -2320,6 +2351,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, has_dre = of_property_read_bool(node, "xlnx,include-dre"); chan->genlock = of_property_read_bool(node, "xlnx,genlock-mode"); + chan->has_fstoreen = of_property_read_bool(node, "xlnx,fstore-enable"); err = of_property_read_u32(node, "xlnx,datawidth", &value); if (err) {