From patchwork Wed Jan 3 06:42:09 2018 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: 10141747 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 4875A6034B for ; Wed, 3 Jan 2018 06:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4292628F69 for ; Wed, 3 Jan 2018 06:42:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31FA328F63; Wed, 3 Jan 2018 06:42:56 +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.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8832028F5C for ; Wed, 3 Jan 2018 06:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NiVpFcOGcLQ6GrWxPugTc8zGqUooEAGknZrR607h8/s=; b=ClF58I3mMUpGJ2 sZG+0KvqwFpoLiZ3qwt9W9XtbpKmXWctVOM5RkPPbzmt3iywUTv4EP1LY4U7AIXAg828QZCo2r+Z3 jopy8uTjvb5CuffVvaYklwr+V2UYkMAmYiVJkaEBRsLlb6SSPbTnJPBpveYRMfEFZxNszJp1fNtMF conw9ubq9Y7Z5VSVOpw25TZ03dAZayi5bt2lXvH/S97xVxmzfvfeLrBNtnV7QSQWaU6KSju9yBDBV K1G+ycqmx3mYWmi+Xy0Q7d73G2VxY6RaeCww/5aL87tIgmsdIGxdGv6yJdK/DSlvQbefic4liRFOZ myfXd+Qzw9wYGrma+PcQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eWclG-0006Dg-Fb; Wed, 03 Jan 2018 06:42:50 +0000 Received: from mail-cys01nam02on0089.outbound.protection.outlook.com ([104.47.37.89] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWcki-0005tJ-IO for linux-arm-kernel@lists.infradead.org; Wed, 03 Jan 2018 06:42:20 +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=AhJ7yjLC+RRFYFtN9WqN9AhvbO1mjwMQ8s/br+NDsSU=; b=az2kQCTuVQOJ4UXeybM05ip80fCB9eh8lkI9doAkDHqEjR2dWOOFEAmRB652+4GuDwXWgJFg2/mJX4p0S0+t/HFz4QgLW1/axc5DTIqKASiN4g6Z7EJE5Oiyocm8KXOcoPqWHw0ot638AIRh4+4zStvwyQEIxG1DCumiKwqqHUw= Received: from BLUPR0201CA0017.namprd02.prod.outlook.com (10.163.116.27) by DM5PR02MB3388.namprd02.prod.outlook.com (10.164.153.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Wed, 3 Jan 2018 06:42:02 +0000 Received: from BL2NAM02FT055.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by BLUPR0201CA0017.outlook.office365.com (2a01:111:e400:52e7::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Wed, 3 Jan 2018 06:42:01 +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 BL2NAM02FT055.mail.protection.outlook.com (10.152.77.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 3 Jan 2018 06:42:01 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35396 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1eWckS-0004F2-Q6; Tue, 02 Jan 2018 22:42:00 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eWckS-0006Qt-Nv; Tue, 02 Jan 2018 22:42:00 -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 w036fwPw011742; Tue, 2 Jan 2018 22:41:59 -0800 Received: from [172.23.37.94] (helo=ubuntu.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eWckQ-0006Pm-ED; Tue, 02 Jan 2018 22:41:58 -0800 From: Kedareswara rao Appana To: , , , , , , , , Subject: [PATCH v2 2/4] dmaengine: xilinx_dma: properly configure the SG mode bit in the driver for cdma Date: Wed, 3 Jan 2018 12:12:09 +0530 Message-ID: <1514961731-1916-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514961731-1916-1-git-send-email-appanad@xilinx.com> References: <1514961731-1916-1-git-send-email-appanad@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23568.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)(376002)(396003)(346002)(39380400002)(39860400002)(2980300002)(438002)(189003)(199004)(7696005)(51416003)(81166006)(63266004)(106466001)(50226002)(2950100002)(4326008)(305945005)(6666003)(8936002)(77096006)(5660300001)(48376002)(50466002)(478600001)(2906002)(356003)(39060400002)(36756003)(9786002)(106002)(316002)(54906003)(110136005)(16586007)(76176011)(36386004)(47776003)(59450400001)(2201001)(7416002)(81156014)(8676002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3388; 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; BL2NAM02FT055; 1:pHD3LatHa8R2d3CgrKdLWnr9cyGpe/bGAYpDpAegrNiXZDFv18C1cM4ajT0fvKRzCyt1KQyvTebYAUH24UauuxCppSo7IA/Bg/TI2RccQnfqrI6SWv4VV2+ZcLHesMHE MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec5a636e-c864-49dc-2408-08d552751870 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:DM5PR02MB3388; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 3:QqAi8o2yE1N0ByzXo4P2r70eiBUQmgRvFjSoBZNar1PDPhXm7hE/pqu7z3Tk6B05+ZTHukFPjIy3kCSyU9gTplxRcqlbgdYZw1VxrcaM+yqTg0w7pkkuXs0/nmKOwP9y243l+HdEgK7fphNSAa24rF7GXWcMaLACSLNQ4P7A6VHwSjlqRHn+oqWY+Q1Mkx5T3oQ4TQ2cTYPk1Cl1HwJ5WkCdCTbM/SRRf5Y4ogs9ZIH2wBaU1UoCK6Ic1n/Ojez0PTaAQm03w1FvCk81QLyVBrsMAPWypxcrhy31ooWiVTBI+qm500A074cSCT06esg0ozyvVpMD08TrV0kMyNsoXEmCagW0bNflizaInsk1cLU=; 25:3AKgRUD4Elpk+8aueJdNrUrVzWuJT8nClFBzquqXZsGsuU1ITIgdWyYNPK38dTuufbDMSxDVvK1xPeQtLHxofUQMZflriY4QvO5MWI4zIxiMKaagQuJweU0cDc2p5JEu2K9Kia0d2vfPZFSmnC7AFBYzucJOcy6snTs4oOTTdbzKxsoHqG4ZZbvjaDAvAoDmxSx3Y8g9vL+e77fg826dwzjH5rxlNoFQ3WfJaIP8b6MqeQqGO/NR7TVvhnaK5bHSz6agMMdgdyAT3doo48CsyK+c3tJvUzHwmJTf4I9+XCf7l/8oNOpI+uAdhZK/32G2RWLxfSRKbm6fe81S2h8p8w== X-MS-TrafficTypeDiagnostic: DM5PR02MB3388: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 31:8ArXi4MLoDq/lsclo05ZKrnGiWogn8g/eaj5iRLXYfkx+6i0KvzH70RaETMD0zJ4zyCcAKuFRRUblJrYPqCu2VUKAQjNbo5GFPq1A58vzq/yW8fw2R1eEVWdUNgp19mHLK6P7rf5lLcjJ0kBXJRnEuYufHBaU+ecaLBawI0p5ztgwlIPb+mLoaXSV30zuGKcwljWOWEni9T9QMMCMk5kbw0uxjPjV7vuDTZ+fenAN7c=; 20:5NwBTT/kB1NSQwskh1tErzFqKEa+m6lOeTUaYd8muvsbD2l867ZCpM1ELi6lQlbxRH81/OiSBGHSnZnjQMZTkkUiM+ksbMMAHWGfHwv8b5//Kc9SxEijvI6hT6csjTNhDIlWW0sxHsOJfmFUQbelLtrTX68LQGYX3DD3QefAB8Q8kCjc+XjPSr8qzJgnstbUuonHYJoWze2mepsPts7LsEE9lpLGzmjKvQJBvFXtR3JRm4XrA5DfbtxjRPPwiOB1hDnTGcQQbZcdJyKE1SFIT6yf0On51xr5vO+2lhQqNtr8XASGZNF/fz4U1aPDp/xiSxQcVlbQEyZuNG/lf7lJ8gerA5ZtmIhpMXLRKNwqUyG9ZI8c/9MRpPXcxeHj00RXDZz11vepzTTvY++eezTkDjspQl0si7crOXnMzvw28NGqzXSHiEtNwet7tGkVSQ9LYorgFtpxPa6LbXkCmDsflO7xrlSGKm1mvCyENF7BVQVOi/wEy4uxqUg8ujpyp8LG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:DM5PR02MB3388; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR02MB3388; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 4:oY5udUx6/ecAAtr5TLRarmrqa4lQDGXLk94BVu/hy6wxxHzw3dREFXI0SoNOVYolPPlqeGmzoGOmvKcb4qjhGnxEU06IP8wIsXgXXDBVR9ggEt6//UKSys+/y4YoypIMQbkZzPYlUxIazUwgl9+h9wGibINDU7EdE1RbW16Rcz+9Qi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gyhkIZGs9CNTSmS1jeUsfBy/RMIr2JP5mSBw4nqvx/3qgBvo3P0FuA9fvWrqdi7ULwJKuzeQQY/NM/JyU=; 7:w8vjmA/nMpLt6/M0kjtSYvtNdkKBEi/6MhLxuf0TvQTMC4eyFgXZd5zw13aaaHQJE2LyVjmzz0Qcw8n8UINHEeM93PAxXzGxonOoczylfPNwvjF5W/CtxxykagM8CEw8zYd/mbHGkSMvzqOjyn4LmVaCJlOcw65dhcJg7bVfuenvOh3oEAdmMXGss+pqFOUQGUVvP6sQMgzXzMuOfEiwJLHqbTzS0CAg5JyvcfzNgLtwFD5l9szURBPf6CP1oC6a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2018 06:42:01.5571 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec5a636e-c864-49dc-2408-08d552751870 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: DM5PR02MB3388 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180102_224216_712000_204E7D23 X-CRM114-Status: GOOD ( 10.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, 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 If the hardware is configured for Scatter Gather(SG) mode, and hardware is idle, in the control register SG mode bit must be set to a 0 then back to 1 by the software, to force the CDMA SG engine to use a new value written to the CURDESC_PNTR register, failure to do so could result errors from the dmaengine. This patch updates the same. Signed-off-by: Kedareswara rao Appana --- Changes for v2: --> Improved commit message title and description as suggested by Vinod. drivers/dma/xilinx/xilinx_dma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 21ac954..8467671 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -1204,6 +1204,12 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan) } if (chan->has_sg) { + dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR, + XILINX_CDMA_CR_SGMODE); + + dma_ctrl_set(chan, XILINX_DMA_REG_DMACR, + XILINX_CDMA_CR_SGMODE); + xilinx_write(chan, XILINX_DMA_REG_CURDESC, head_desc->async_tx.phys); @@ -2052,6 +2058,10 @@ static int xilinx_dma_terminate_all(struct dma_chan *dchan) chan->cyclic = false; } + if ((chan->xdev->dma_config->dmatype == XDMA_TYPE_CDMA) && chan->has_sg) + dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR, + XILINX_CDMA_CR_SGMODE); + return 0; }