From patchwork Wed Jan 4 13:35:53 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: 9497965 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 59EF060237 for ; Wed, 4 Jan 2017 22:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A2E227BFC for ; Wed, 4 Jan 2017 22:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D2B828339; Wed, 4 Jan 2017 22:27:11 +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 84A2627BFC for ; Wed, 4 Jan 2017 22:27:10 +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 1cOu0E-0004ID-Le; Wed, 04 Jan 2017 22:25:50 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOtl5-0003Q7-Ho for linux-arm-kernel@bombadil.infradead.org; Wed, 04 Jan 2017 22:10:11 +0000 Received: from mail-sn1nam01on0062.outbound.protection.outlook.com ([104.47.32.62] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOlk0-0006Kg-W2 for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 13: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=cSZd6iG0SCjOc4g7r/L/luL+E3bA8FdUn6MWz6ZXMAY=; b=FRNOBBiJr43y2QmNws16KnVYv3A9FyiedII0sX0Bw+Fvls0aa3u2RRaFsmSv4PCVfX61/3pQrzwmZd4FiN3FTe03Rnrn4av31NAmU2Bo+RwJSzAeVUyv/mRkTmUlwianYHxkWfGOpcEiFIP7EocRet7cz0hO2Hu/u4boHtUYyiY= Received: from DM5PR02CA0067.namprd02.prod.outlook.com (10.168.192.29) by CO1PR02MB207.namprd02.prod.outlook.com (10.242.165.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Wed, 4 Jan 2017 13:36:09 +0000 Received: from SN1NAM02FT005.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by DM5PR02CA0067.outlook.office365.com (2603:10b6:3:39::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Wed, 4 Jan 2017 13:36:09 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; 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 SN1NAM02FT005.mail.protection.outlook.com (10.152.72.117) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Wed, 4 Jan 2017 13:36:08 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:54813 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1cOljc-0000vp-9w; Wed, 04 Jan 2017 05:36:08 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cOljc-0002zF-5x; Wed, 04 Jan 2017 05:36:08 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v04DZvrq012257; Wed, 4 Jan 2017 05:35:58 -0800 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cOljR-0002vN-AE; Wed, 04 Jan 2017 05:35:57 -0800 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 13614) id 698BCF20019; Wed, 4 Jan 2017 19:05:56 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , , , Subject: [PATCH v4 2/3] dmaeninge: xilinx_dma: Fix bug in multiple frame stores scenario in vdma Date: Wed, 4 Jan 2017 19:05:53 +0530 Message-ID: <1483536954-27203-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1483536954-27203-1-git-send-email-appanad@xilinx.com> References: <1483536954-27203-1-git-send-email-appanad@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22802.006 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)(39850400002)(39860400002)(39410400002)(2980300002)(438002)(199003)(189002)(5003940100001)(42186005)(4326007)(38730400001)(106466001)(626004)(2906002)(6666003)(63266004)(103686003)(5001770100001)(50226002)(7416002)(47776003)(45336002)(81156014)(36386004)(36756003)(8676002)(81166006)(8936002)(76176999)(50466002)(90966002)(2201001)(46386002)(52956003)(54906002)(2950100002)(48376002)(305945005)(92566002)(33646002)(356003)(5660300001)(189998001)(50986999)(107986001)(921003)(5001870100001)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB207; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT005; 1:96y16DunLk9aeYaCFOYFkjgywwqYUMr2bGMz3dvKwSiAWDbltExvghgtsxK6OnUAk9IMEVgSJioVN7jmklWmOwMxGAyEwbGva9uNRWST/pEAtA+qyk/OplK/DVK3wb6e4uu383lN9zXkPKDXuyt5uPlCTfcU4jhQGk7qz7G/ooM7imhAGH/VeQoFjDNzUpKpvkh9/tyx+T2nc9aIs4/Er+Tbyfr/CMsH54t+7CGFD041dD7ogp9L2IdrcHuBWwJbUhWcNDNu/KMbFLnoPif6eZu50E/pYMicqytDL6/MjbH4e17uLamyZwJjj+cSMC7JwGMgfcuBavjKKuRvJVoZcgPPdAx29KVYIhdEQs43VDHL/P6kES7e0C0VvMsTJ6Cqv9vLIr1TIG/0vfOcHz+xUr3RCVTefdVySndQXFSGIaolL6EyJuuuWvALLUhXOap39VLvWvMSHPKvcP9yKRtj6CZzbwHSXRgrJ+7PS5MTZIV0ngZ9Sa3NBKgXUBV05DyVKqiKC2GfqvjanIxzqFQG/lzMZjsc8hB/0nkEs9LvpWqD4yRaxrngSbrE6SiICg+r40+iW6HEreadGVH1ltIxrC7FzdJXWXoND++V/h0cAQPWvK/mJI/uTvrcFUSqNlyFBbND61XmmYRrH3zif9X9rw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 127b33ba-2079-408f-cea4-08d434a6a440 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CO1PR02MB207; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 3:qNRfv7dlS/+9EljnpKb1z/hwxtjDo8gwpzjBS01WZM0EL8xeaofXuq4v3IbgtkKURvdIivNLaGreOI37r/n5iKIlEaPYcW0sgs8zGOBF5vAeuNSn6WBH94NhAHlPKIOZddWcZGW/1/sfIQxl2LFpFlQMgvDh9GL0pKImSn5LFCH5//HNxcHRb1q6sP/xv9R7wQv3imnMjSa+e45LIzhTHKdan3AutEN+IZKf7c+DFlNHspGZW7LHf7qQhvlvlf1ENf0WkmdPGEF5ELGkdfV+871GZIcN0m7DSRF5h0+UnLc4tNnDt7rD9y8T7VxDX6O9/CG+ra+TbqU/1LLG3Y2WA5kAZuB/6i6gX4d5+LI09Qy2Bz+DNqIXkPXAlmmprpBMI1hvnANZCnfZsxGwTUK8BA==; 25:4q7+1rgMxu2johEN5V6AWGtLwI32Axuy697ucOWE4XQBWAuSlhxZUWGq4r2eQ0zPZ3G1dj3+sNGDrLWE5NiOPGA+1CxwjLjuqq6q7J+sPmyj1I5wKNVkcMgST09ooP7R1QgjX5goxi79RnbtaZvBSP0FNfsJt7hXGjKA8qM5UQcoYFK2x/xV+wgaCTKt//BIXsE2V0xMuwHkCbU3w3m8Jl3A1McdJ32nMVbBXnRj1xc6s+6zEmumDt/m5EDIhDx8+E/PUNGFKnzBPEYJM5u2xq5qoKuNqq8t+o+IhRxF3X3Jf77CjSFqcZ2RIcWdd1YfrtGG211FW1TKGAMjNepMEi8p1E8iaZU1dbkIsvoxgYdZQSHHBzPwpVAdspKQORm4ooXrMmfNaG3lO3YPUThgbYNx9wQTFgxXrx/G1NGYab+Qfl6lPUIzGXfgQIV+5lurrGFieDaBtO+L+81e/HLySw== X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 31:yDyjL5BChc+4J6saq8+RWWwIBtaBR+WJSmiVISZ1HZVdmKotyJHtyyaDXWx1DrifVgtDHUB2OQERbBOBX9RLzpSUvzTsWaSiDHNSjhSXqq6ea+ST81amCnriKEZFGZLTobq8o7/t8/3JwxhmrE4PICyWEtu3TAI8ulvs/l0Tp6QRbQlNp70VEEKm/D3emneN0tBUQjiKs3hQ86mS1eUcdHoAOpfeKZhJYApLfL+972ZvoFDLe8MYE4dMEBt8IyEAI//yy0dQ6Fb2RUhxooMTv4qICs+sIQJDvO/SuNVHzsI=; 20:6ZXssGrvw5IAfj8feB091Cbvq6DxF8b1VGyIYpunoqgSh/FwAFlZ3gv1ju3ee1x+uaRl5WYINEIudJImMVFKEg4yEiKVspUNjVvl82mfydyIjn5GO4X+zD6YLo2YUT7Qd5sICw3UuMTQiltZfi4V4+hfkG7R+YkBL3fPblbU5bcDX2vH3XtCOSSYhDLgP8HqI7odLQLjWM4pfTkwycWMd7E7whU06qGmJ3AUvNUdKQDuwfJx6T6Lls9lKUnaKRQZP8JQKnwFsPiFE22W7cyDipTCmnnaoIKNaF6V6vRTdhP5i+ksA2Wd3z3aJqbwtZV+KKCQr/unTfXQRCx+ohTvrZZvdTy/ZdgG1dhNi0JLAcxXMGrJNihz8OH1NcjNa/+lFaUdo//FZo70Ao4CllwnPHcNfX5SzTV+t20vuXC/e25CVa0g9qKF2hOckhYkd1WlDLvws/22LJB/nCMSLQyIN7KzjLkfeSAbtqrh9mHpEEU5ugczFb1lhWxGmn1BPIba 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)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CO1PR02MB207; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB207; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 4:zQ3LoQqeuxIOVNKeTyZrzTehGOLw1TSDio/frikA6jrGnChQhsj2P0idzEB76rspoE/Rcz6z1yWmChv71d8LBFpzXSP/DXTCe+I6OFQ1XObNxSkXIQot0ZrFw+IfmCP/svmI1ERGbVT+l0XDtKQSAsfgg21FBOIQBz0pYLubC4VQCx3E/wQrTKENtlMg4rqeIw5rvkSwV/s8DqMwA5guFXQpIn53Krr6R94gxDVo8DVEyzgPiI4+tEJbiGx5qnoHYfLhqKCg2RGp+OVzUZ9b4qsieW+pIGIljTn3UU6HVZmRIfwIRYBTgGJ97Eghg9GKs4A0w3HOhK29piO7u2ZLpAqXm3LeMDmx8INtM9x5IoR2pBR4V1hpALnD4czFEofFlLlpJFF1pqa7q+dGUYzXbrMomoZSFlXdChSrBXQCTnqmr4m3SiMHM5e+tbA8hV8slxHh8Yf/WoQshc5D4tkS5K07pYgn3OW9h1rJX5NIa++e6sDu6vQz3Txwbpxu7H/tLuUT2FjTIW91FET58vsE/G4Q4yZ2HZ1P8zF9PdEFu5UzOrVZL1RMcLHizP+KCirPbMFAzi3vGPN6wIQnE9p5EMkOVdJs6S9dgqEW7sdmBmEJ/Nv4m2fqrH1fkVnlK1japu3hPQByvsFgawBAqzXprMSvqMNx29wEAiKFFRHBAO0h70+QadW8s9+Us4v5lIp1YSP6lrU3jkt5136gugxpojv2PAb4mW/9+kpyiCxlQRc= X-Forefront-PRVS: 0177904E6B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR02MB207; 23:imQOODzKIkEA5ibgazcFguEUhEMsnJgbzoLGd9iUqi?= =?us-ascii?Q?k2TWdUJIMujomqFlSnaPAWNTVCMOKVfn4jA2r48ETfZdrAWUY4utPuCBEhVz?= =?us-ascii?Q?UeIGfKIfOG/sbt7WQKrcSyNFbjDEP1rEzGgCJOpk1CUTR21JCXgCZeteg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YmCsnUFJC24fNIce/hEVZxYqST/rQjcJKvhdxjgxGyZL73WK6uEuT8gfcJY3de2ysVrSHY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 7:GOsKq0857aeySh19H2pXjMK44YsRv5AhJUFK1D5hNXsi6E2jdW+x73XX2uPjn5r4FJJkZb0QzJTo1EY+8Vrs4OEpunNG5ueVkO7Aley1bXpFw/0uB/OaPUF7w96lZqmls7TIc2BvhOrLOAYkRMmIgf7HxZVF38huCMRsuBV1eL4dZSKGuVBdf2CHRp9/vZReq5eKcTvKBguLlTcNykeN5cuSoDZo3YguijtFRzuzvJsqrSwb6h+4B7m8MSEBuit9xCyfZT5rIoH9MqZqTL4SsyN/J7Oldm9B+tPSXENln8KS7bC57WmRYwl3IFxx+jCHCaHAkmSzAs6f+biHXvhG/HPQU7Vvch8fDj3hLLSmXsuX1UOEMUpF3MMQW8vBqYPYU2Di29eq8rgdYp7OaGZeck3mWrbWT9QF+0U1/2MGabC+6hb/L4TUB1kF/H/wY7HJsjCK5rb+u8cy7i2z3ziKLA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 13:36:08.5696 (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: CO1PR02MB207 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_083633_245779_9A654E64 X-CRM114-Status: GOOD ( 12.72 ) 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 and 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. Reviewed-by: Jose Abreu Signed-off-by: Kedareswara rao Appana --- 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 | 79 +++++++++++++++------- 2 files changed, 58 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..1f65e09 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-config: Tells Whether Frame Store Configuration is + enabled/disabled in hardware. 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 be7eb41..4fb34da 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_fstoreconfig: 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_fstoreconfig; 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_fstoreconfig && + 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; } @@ -2315,6 +2346,8 @@ 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_fstoreconfig = of_property_read_bool(node, + "xlnx,fstore-config"); err = of_property_read_u32(node, "xlnx,datawidth", &value); if (err) {