From patchwork Sat Jan 7 06:45:29 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: 9502863 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 0781060212 for ; Sat, 7 Jan 2017 06:46:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E94B12850E for ; Sat, 7 Jan 2017 06:46:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDCBF2851E; Sat, 7 Jan 2017 06:46:42 +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 46B572850E for ; Sat, 7 Jan 2017 06:46:42 +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 1cPkly-0004AZ-RX; Sat, 07 Jan 2017 06:46:38 +0000 Received: from mail-dm3nam03on0043.outbound.protection.outlook.com ([104.47.41.43] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cPklV-0003MQ-83 for linux-arm-kernel@lists.infradead.org; Sat, 07 Jan 2017 06:46:11 +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=bidCoPuCzTDIaPDuKhgRIcE4GmcuLyiwzsTSvna3L08=; b=ZbJJ6RwROd2P5GACudZyZibOxZ8FZ5vhOmsf8H7wNOu5bcYScqfjbJqs0qjMwcT9v6g03IQWuf4EO8ssUqd96FqTHjfhEYNmrT/885IghzeJHu0Lc9UnbeyLtp3LsUjKquUjfVdfSx2bEGw8mnr2ItImZDzvFGTCQdeF1fGbQgM= Received: from BY2PR02CA0056.namprd02.prod.outlook.com (10.141.216.46) by CY4PR02MB2775.namprd02.prod.outlook.com (10.175.59.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Sat, 7 Jan 2017 06:45:44 +0000 Received: from BL2NAM02FT036.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::201) by BY2PR02CA0056.outlook.office365.com (2a01:111:e400:2c40::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7 via Frontend Transport; Sat, 7 Jan 2017 06:45:44 +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 BL2NAM02FT036.mail.protection.outlook.com (10.152.77.154) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Sat, 7 Jan 2017 06:45:42 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:43661 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1cPkl2-0008TN-MT; Fri, 06 Jan 2017 22:45:40 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cPkl2-0001AD-Id; Fri, 06 Jan 2017 22:45:40 -0800 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cPkkx-00019Q-6I; Fri, 06 Jan 2017 22:45:35 -0800 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 13614) id 28C8AF20019; Sat, 7 Jan 2017 12:15:34 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , , , Subject: [PATCH v5 2/3] dmaeninge: xilinx_dma: Fix bug in multiple frame stores scenario in vdma Date: Sat, 7 Jan 2017 12:15:29 +0530 Message-ID: <1483771530-8545-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1483771530-8545-1-git-send-email-appanad@xilinx.com> References: <1483771530-8545-1-git-send-email-appanad@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22806.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)(39850400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(438002)(3190300001)(189002)(199003)(42186005)(46386002)(103686003)(2201001)(54906002)(5003940100001)(7416002)(48376002)(38730400001)(2950100002)(50466002)(90966002)(47776003)(5660300001)(76176999)(356003)(50986999)(626004)(2906002)(52956003)(33646002)(189998001)(81156014)(8936002)(92566002)(305945005)(5001770100001)(106466001)(36756003)(81166006)(4326007)(6666003)(63266004)(50226002)(8676002)(45336002)(36386004)(921003)(107986001)(2101003)(5001870100001)(1121003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB2775; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT036; 1:F9acJEVVX1b9DpZVSJP0sq0+KObks/N42j1pspi4gIx6pZDqu9ZRMBQXlVhzEZU5B+jdHdOqHlaAXrSQdEiwaTjOMi3MKPfFh/QHBpa0jdd+ftEXEn1sfDQ9TfwuVytZidUbc9g3j0yPrFf9vtS6JMylSh0BkiVT+UWfgXtowRMfZhRxuudpYWZm3j4bVOofGABJvqo3NY5hctmibPHE/xej6IrA4hQA0d6cvSHWPGdQPwQOr952Gd+ZQf7C6uQNSMKrwaQTBJKRZM37vnY7AOKtAaAh/upuMDUOfK8+EPet9TAX1Mz67ydhKOGm5IVKQdGg1P4GBJ9Lv//hzwI0k9qKcTVLYUKzGcy6ex0yY8hasecHn4i8RB4EbMVkFMOTOj+fkUd/RY6kOi5/QN7cOY8sZY0f1Sh662S4Lj/Xwqp6G9Be+saKTHNbNKw63bdxLrZgRjU/S53nfbkxcT9CDo6K9xCd5HvI2f6Zc0EjYXrKEPqEsbccgDQCLFiK29gP9eo8B+Oc9MLLzi/r35bf7ciDMTN72G4Bcz/S3JPYcWWwjZdb0q3UlavibFFBrj6m6JialyQw4/kv2AQ4RJEyCFrAiC7v2cvA1lhYv4V+S5VceLdNdvU9j9J0Z1aI7h0kpHsLf7WW61et+sfFtZsT1Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2628a491-cba6-4c12-b012-08d436c8cd23 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY4PR02MB2775; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2775; 3:KKo0vd/ueJ8q12Ba7Lusjj4t8qjhYrLpo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vJcYvYkmAmlzivbh7rFr283ecfUwGJYKuKETbsajylGp+5zoX7oJP66OsLBVgiy80Xsbqy/Naf+YShMn+rGdzJgxUiOUCN6maOGb2m1C1/K/mtTLWCWM32tQvRX3Wfaa2F4hSZxSGyIfwn5i1JZE+2SrGynHCzXmkewC7O2KZrosRWxy0yY3OdcGw== X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2775; 31:8nWwyqaggxkfIMZ2vzQwlyH3yCeRHlkQh35mlsqnBHZyr4n6OVZDe4qT2BN44TlNCQyKYFU5In4jmOJPWohLo33rK85k0TwIhvZvhSMBGxs6GDH2Yn45kyDjJ3BGaSewkutkCyDVoVY/Uyy61dYOAQm0GBj2qNpbVFVkK/I0zMI7vVcbEL/rdhNirjgOeOYFxwF52J+9Xqjspl3hupoSxXhWrvko814p9h1uzD6En0XWxSEibqB5jyUUdvDLn4+Z93QN+S4/RiOeFEJtVsbujPykykjh2X3tluXUUne9mF0=; 20:da9he/fGCiPIJNjIZ3czuMDI05Kw6dALdwA9VqgJNGz8VY2lVt1CdaeVulCbmJqCc+yMTHSLZZPgHgThG7j7veamun33mGLv/SUINBaW6khYEZ8YZGM36G0DDH2uGhPSGONDTvu02q0A9hWy4mZapvAu7NLgiPbDoKz9xTff+MWSiOEyEjNNcM6f05A36KGdp4Lw70HowVDOOImI3vNyKMmQGbJTsoJHP+ljj+mn6LOSk9b3b9RTyVt3HYPewmsoNncqsuvmm8xJYTKHyx2+5PUNIFGl8KrG1CaH2+HeRiZV/gjlJbHX5zykxkEfLj5KIJC2n0UnBlFAMw/V5gwXS5gv0GwwLgSUNRpv2XWu9sxL6kIh700UeBr1bz9KwlB8dLJG5+hph8DB23wRhjDZ07JUCnXTFyQXl5X6pSI/onSM/60s+TY5++NPssG4QnbTT/nGRMq59KtR9rO3E57TidIySMbhUYCif87P8lSMpNm5Kz/UOQD7jzSjMxqUw/DT 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)(13024025)(13023025)(13015025)(13017025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY4PR02MB2775; BCL:0; PCL:0; RULEID:; SRVR:CY4PR02MB2775; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2775; 4:fx6Uhc/ki+UYxdImkBC6e6oIejaiIdkOj1KO5+ImyXSI6hWmFPcwMky27nfUhl5bR009+ornrAVH4tiUibXSnWMg3I21RYJYgpGOqeHM43Ex3p+c/SGBt7ML3oZBgOIm3T1WX3jBbboK2aDd4L96eEDvpXZWfv7X63Zsn0Jq7YDZS1oXbOQZyjKx701SlpmGjYds481Pkn9GgwTVz5ndBnmRT+IPKrsMGvstuaqjDLCFOe35SAQXgzuOThoXy+mxEQp9olYGhgFLCxinJNQBwp0ZjZzK2WMZfAaQNzQX69Ky4q8iZKSJM/MgVlFFTAZiBv70cudWGPuo+96FwJnjo1tw2H24LiQKhHw5DTFJfTF+C6VvKEGLl1woVV8fI+3Xfw5//sHwLVpCA+XT64lfuR+KWIdBFpKARmuJMuZzFxhv/eZ6g00/1i+98DT216S/HLtwkB1xhF4hWP1rXCNIYXtLaOiLgVZsSdBPI8DBCKFvMBb1q7rU69U3C/hcmDkukuDbPpZAzpbTTe8SKU6OLGtCX4xCuF/pZtS5Xw2AOFwZZlPJfqoeQlps5KOL02SfoP0VBnMEDKa7BgK0aA2ck9RJeV3I9Yo1j10UCV3+9f6Wpg/UDb/jDmvarPw2xF7dVkxYEYdDWA2IF288jUYfvHoUnvRUxSARwSzJ7h6TmQgWHnxuHefpcSTjqx9HFCZRYSYQLo4naH+oIA8RumhdEAlAHoYV2xpGyllhKt6oMB0= X-Forefront-PRVS: 018093A9B5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR02MB2775; 23:PPwd442YXvaSt8xE1/WN34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1K0QCaDWUBwRloA8FhCbQRIcuAOiSFFQ5mqJO8e5Wtb0Yy4NDlFNNs5HVnCVzH8zAJwhHR6YLLZBlpoxHoJZM1OZiNfN0UFf7j6l4BeIQVzw/FO49DME6ZcpoFUjQt21EjWqISimHaBZt58j74hDucONs=; 24:q6P1lpMfvysfs7ad5Az/vNEV+rvg+YeMluxLBqT6Hy1bhq/J7oH8AI+Ptrzn4V16WW6heTvSa2MhCKLSRBySbu85X39G4GCCRfNiJxjUsYM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2775; 7:VOKc9Ljem5e2Zd5/7/2wrI9+c8si5iDu/+/fNLx9Eqr8iM+QSxPNCuEzCQF+EGZLOqaY17PDxIhiqzN//ZVBLHIP/Uxy11ErDW0vJNPdbDm2iRscfxDUaE1IpELMejLTYFJhZsUqJ0UdSeSurXDrboSXMQ/z/foFYHqVXALjppyW4wTUKSUmoC97fC8T/ahQjToZfi5PX32Wuxvm6kGBabQr4Dsn5FVOXmH7a+iAv3caD0HmeNAT2AG6eU0UZh7Ypj2fV8rAljjsZbs5NpgfRtv2PhJHd4bxqnX/WdpG1kk+BB57bYhQph7GJRLEnDAL86QwRdgrm4BIOXKXpdY+3I9HJzty3Iy0wLD0QZ56fl9TpAKSQIQtiV1HkUhHOivw78/lisD3P9iWUjnJgEN1gX+17YRTFFuDAgk5rbdRt0GAsSl6/0NiDTjGP3LO5xGQE7sYwtJRlu2uaF6aRFSnbg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2017 06:45:42.1297 (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: CY4PR02MB2775 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170106_224609_481628_80B3969E X-CRM114-Status: UNSURE ( 9.39 ) 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 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 Acked-by: Rob Herring --- 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 be7eb41..0e9c02e 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; } @@ -2315,6 +2346,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) {