From patchwork Wed Jan 4 06:54:06 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: 9496155 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 4170B60413 for ; Wed, 4 Jan 2017 06:57:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33A0126C9B for ; Wed, 4 Jan 2017 06:57:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2812526E81; Wed, 4 Jan 2017 06:57:36 +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=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18DD426C9B for ; Wed, 4 Jan 2017 06:57:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOfTQ-0006nR-UL; Wed, 04 Jan 2017 06:55:00 +0000 Received: from mail-sn1nam02on0087.outbound.protection.outlook.com ([104.47.36.87] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOfT7-0006dq-VY for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 06:54:43 +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=pD3GY7/aEfBK5pZ63MJ/9u7HLqrFgrSFxk2nJsKx73Y=; b=qS4peFTiU5cwZaM7ynI5KCzCOUP/FA5GEaicPkrLTdA5KcwkPZK1Ynci0kkcFnEGMstjAaEWPw11j+gc2AEKcc1anMP/3U2Z+rwTh4upzYfSQ7iyIGrZG9tSKR0T9M0C76H5UHC0AbdAGOuV3FAwMWvt4m300apa+kbhfIjMPVU= Received: from BN1PR02CA0039.namprd02.prod.outlook.com (10.141.56.39) by DM5PR02MB2778.namprd02.prod.outlook.com (10.175.85.149) 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 06:54:19 +0000 Received: from BL2NAM02FT027.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BN1PR02CA0039.outlook.office365.com (2a01:111:e400:2a::39) 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 06:54:19 +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 BL2NAM02FT027.mail.protection.outlook.com (10.152.77.160) 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 06:54:18 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42659 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1cOfSk-0005cv-9T; Tue, 03 Jan 2017 22:54:18 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cOfSk-0005AF-6C; Tue, 03 Jan 2017 22:54:18 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v046sCDG007325; Tue, 3 Jan 2017 22:54:12 -0800 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cOfSd-00053n-IV; Tue, 03 Jan 2017 22:54:12 -0800 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 13614) id AA8E4F20012; Wed, 4 Jan 2017 12:24:10 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , , , Subject: [PATCH v3 2/3] dmaeninge: xilinx_dma: Fix bug in multiple frame stores scenario in vdma Date: Wed, 4 Jan 2017 12:24:06 +0530 Message-ID: <1483512847-25710-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1483512847-25710-1-git-send-email-appanad@xilinx.com> References: <1483512847-25710-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-22800.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)(39860400002)(39850400002)(39410400002)(39840400002)(2980300002)(438002)(189002)(199003)(38730400001)(5660300001)(54906002)(2906002)(4326007)(47776003)(90966002)(42186005)(92566002)(48376002)(5003940100001)(81166006)(626004)(106466001)(45336002)(33646002)(46386002)(8936002)(7416002)(50226002)(2950100002)(103686003)(6666003)(36756003)(81156014)(8676002)(5001770100001)(356003)(50986999)(305945005)(2201001)(50466002)(36386004)(52956003)(63266004)(189998001)(76176999)(921003)(107986001)(5001870100001)(2101003)(83996005)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB2778; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT027; 1:+EyuUbTLgxD6DPPYSJcxmrSZKPEfShfbwg9BRwJNaLcWD874Tcr2C4H350lzXJn9ilkEbB6NzWdQPO4c55MlwKvJqFWc+v+B4IGsB9Lxq/c6F9xvDFFy+SEKqt5uHAqOLeFEKyJpZ/5j25SUHLflVAu6VWZA3asqdr0UyZv4FoYr6XUVvxHE2k9BE9w8iZ7wZhFQHOlMu6mBmzhgHxp8UHFxzAZ4IXWJrMwnHJzb/P6M/UBUiY4TJ+GWDDlomThxn/UVc/5q6OBtfdzk8ajU5xwlECDgktBlyqn5qL89aEPREsJLQwXMDf9w9fus4buWwJ24SwMAaiXB4FX1wJc8v4GcZrpDirUi3Encycy9vVBcBCj4iZIKoq2I8RcDsWw/o/Z5YB+4F/GKXOtPlaYmCytvYcIwMPDIY0vwhL2E3GcM406rVczkWzoCEpyq0hK68fP/T4MqXH+QzTQJprNlYo+1MIzMEd1ZMR13s9U30PLN/YgskjtmCDv7Re8B5ofq68vUBkzji5znLLEFDxXGUXAzMFyOfGkDCKUvz8KJv22j/rUgysfaaq4CBtbMgnWu3h5GAVjXL1ll/PjVscItV4xmXB2Ea+S5IdKVtZs9tB4OKcXdJLcEVC7GqqKYrz2idrvP7PNDvihLndihNbQQIw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1c2d7ddd-73c1-4f64-0480-08d4346e818f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM5PR02MB2778; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2778; 3:Kdgss8TQw2iI7ygJx8l5Efp3Ads2k/cuNMnxVKkZKA28YzMRpIh8NhYE7xpg09jlEW+emgQlFnTtJed4q5zffQIy7TTIBLL1Pye0NjiCte0f6YG5vDeby0cNfvkdpbWy0yJ6RubHxYbFwrnBn1UTMYJcudDsfb+aVUlY3KrrHiJ4nq++RurEp2pUaC1X53uH454ZIR1ja5RVD6TSBTW2wAykCGMACRvLyTGtAocRSUN5BG6Wwz1gYGOqrw8fTBjIKfZLjRWOyYue7pmbeR7y/0RMhui1bOVIBjOanlb8ewAEeltDifZWtP69XbeH0OJ18v/eE55Pbhr6CquTqXyxVcPaoui4hXQzAR0md7qa2/CqTr28M2rvZmZ8RmKr7PH1NPIGX6IysPtIFrchKfcisw==; 25:roIfAbX4d1WbITvQgEV3IgP2y/pKekdj3d8Wnmx21Rsq+zLnm2AnAtMMd9HGAV1g7wAiV7oMLCHeHBxy2Z/MZgulHLXNC4mN/Gavkr8dGCpnL+6xNmglpCuw0QAm5tzUTbPipe3f6hobnBw9hhx/F/O0J9Dc/dCcXS2DDM+ezfepcduCVi30SftGhCtLNPsBsLLtDFJi6NW5OxmKE2RRfg4qaDgAtLq3szVOzA7ZdBGiE8SJt/kDFpjftmI+ZO6jDmc//+5Puiz1SABsFR+TNUXUu5iefrhprT2B3MHmt3lvq+tXezdHl9RSYEZksvosgHkNjStluh41aXoBOJxLP+Voz44Rn5KRw/xoiJA5TitV6oKKeYXgkjP/2VfoECSWKCi9xd5eog3VntS26w8C0f2jrtUo3At6Kch66tLoANzIlmU2NxrqEYowEUj3VDRUTKdbJbiordaWGtd3Svl1xw== X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2778; 31:wddUF7qE4ATPmL6wXRSQqhSjTBbfLrj9ECP8tCTKa9/RBELZq5DEqUovRCWszxfP45CKY6PtkqDUcYFD2ZnyUFjojNPGwkignmws9Zo83F5XKfy/+V9YFJwyTydnwYY9pyqWH1Rc+m9h9gGJcXTp/NtYX8KvsdH6B+M4StZYJT4LUrtskCnsb2571wT19sGWNBjqmo64toySAxi5OQL1StW4MwQPajsjhtkfh2o4Al6ZyJ1tBgWRWlWjvAMOdPfVL77mKeKc9w0XlNo5eQkv0AxYSHf2hu7rM87GDpJmiko=; 20:LFdkEW5t5OPbisNtzVxLW5KdPwlO2TBnwxpmR8eaZb9K+XuGKDh87DlKbNJQLGCp6KYdLjPbyNGSBebJXGT1r8Qkfzu6uTUzPRu2V1E9eaK+jQ7yRQ4N1Yktn9Z44RywqMs3/bl2IuXjsC7B8w3TiXBQQ6DBQurHJguwl3Sap2Xfg6UWHQAeNMKr58lbZycpsDY93AbgHcrK+znab86yzPGVpb2sNZqs4plCq8ysz2MSCbWODKs65aonFD7YyO0K286zoxYFV5+DVRV94ucQFwzVZUUi9zMZdY8J6p/K7iQ/Hyse7rxknTRQ0Zvi0O/qXgRo6MB1wGdCZTGo9vd/644oEsmiGL7ARQpK5llcTkqh/+hIE30idVxmRHtZG/5grcWOwkon8ILs77YMY76p9NJcEjENC4l1MnHPZ9OZ1+az701xMf66Lc2RiVYmI28f1IQwI5UZb9tZpeQCCf6kgiyCaksozmpMVpTVAEyo9Og9MBBLk+r6BXI5glPUnItF 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)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:DM5PR02MB2778; BCL:0; PCL:0; RULEID:; SRVR:DM5PR02MB2778; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2778; 4:a5q8cEWOCaMH10NDRWKV8gbOlw8p/KSPGqngOb4GRgeX3cggcyVPcAtmwWqW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adata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2778; 7:JjOmT3uK3H7DD7PLbZ9nyZig1lWYqZtalmwrpqnZz/NWkGTqjhY0SToCc7YHKnXI2jh/PG+d7Zl797/F0DTSsRvE/O5mGYpB5MWPbtHbgYk6hR05qpL+b+BNzTphVbb9l1ZzWaEnRp879uxlTR5//BepGSb7NrG4LSTZxVEYw4Q0KzVDNFi/YTvsf8zw1133nsVeiE+4NUFZciVNnqubdRAbkG/hKH3Xj8YCzfHPxqVS8L+SyUOtvhGaYCFhen9bFWSOelF2qAAtVcdHfqvQwsAJpZVnIsdfm43I6utqAfHuTIJrKq6HfLILR1BXXXgRtu7LroHvV7s+Z09C0Vk3QxAyh7WXctOdrUdNdMj0b7ezs+nXaHcPjA3ciY2+f8E2jwoQe3j412slXYWQtrhQukMKnGicX+0YjDeRt+Vqvnsh+WHnEx7lYM2Ul7I48XAsYqA2EZTcqtLtFtlAW5hgNA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 06:54:18.8106 (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: DM5PR02MB2778 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170103_225442_238395_E4EA43A5 X-CRM114-Status: GOOD ( 13.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 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. Signed-off-by: Kedareswara rao Appana --- 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..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..7cd8e08 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,26 @@ 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 + * On the S2MM(recv) side 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 + * It will allows the frame buffers numbers to be modified at runtime. + */ + if (!chan->has_fstoreconfig && chan->direction == DMA_DEV_TO_MEM && + chan->desc_pendingcount < chan->num_frms) { + dev_dbg(chan->dev, "Frame Store Configuration is not enabled at the"); + dev_dbg(chan->dev, " H/w level enable Debug info 13 at the h/w level"); + dev_dbg(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 +1074,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 +1116,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 +1371,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 +2345,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) {