Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbeACFKo (ORCPT + 1 other); Wed, 3 Jan 2018 00:10:44 -0500 Received: from mail-by2nam01on0046.outbound.protection.outlook.com ([104.47.34.46]:38208 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750989AbeACFKm (ORCPT ); Wed, 3 Jan 2018 00:10:42 -0500 From: Appana Durga Kedareswara Rao To: Vinod Koul CC: "dan.j.williams@intel.com" , "michal.simek@xilinx.com" , "lars@metafoo.de" , "akinobu.mita@gmail.com" , "joabreu@synopsys.com" , "mike.looijmans@topic.nl" , "kedare06@gmail.com" , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Thread-Topic: [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Thread-Index: AQHTekQmF0pylURrRECzupyr8UWgUKNhmcWAgAATzcA= Date: Wed, 3 Jan 2018 05:10:35 +0000 Message-ID: References: <1513851098-15787-1-git-send-email-appanad@xilinx.com> <1513851098-15787-3-git-send-email-appanad@xilinx.com> <20180103035845.GG18649@localhost> In-Reply-To: <20180103035845.GG18649@localhost> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=appanad@xilinx.com; x-originating-ip: [182.72.145.30] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR02MB1691;7:5dP5ky6zV106iZi1fipKjliXlQ7hS5eQ5U2RmAMN43LsWv9ISW8mACintjYtUmQczFSnLTqqyguIiYYSfaxxfsz7SJNJJDN+UonRfkDRleUkE6klAIQMAsH20Uq31Zav8urQ3Xi2ysNpvtki7lOMOv2HJFa+Fo4xekvoY/dZm30aBfQxA58hE67BaT/rBiWuT8Zh11Y624vBV9hT6Kq5F0HkGvgbe05Qa1qojgkFKqeDRSFd/NviNVLpVkzG/9MH x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8bce4681-8e26-446b-91b4-08d5526852b1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060);SRVR:CY1PR02MB1691; x-ms-traffictypediagnostic: CY1PR02MB1691: x-ld-processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr 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)(3231023)(944501075)(93006095)(93001095)(10201501046)(6055026)(6041268)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:CY1PR02MB1691;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR02MB1691; x-forefront-prvs: 0541031FF6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(346002)(376002)(396003)(39380400002)(51914003)(189003)(199004)(24454002)(2950100002)(25786009)(6506007)(55236004)(478600001)(6916009)(68736007)(81156014)(8676002)(2900100001)(6116002)(54906003)(102836004)(86362001)(316002)(3846002)(76176011)(81166006)(8936002)(59450400001)(9686003)(33656002)(229853002)(55016002)(97736004)(106356001)(6436002)(14454004)(77096006)(105586002)(6246003)(7696005)(4326008)(5660300001)(53936002)(74316002)(7416002)(305945005)(3660700001)(7736002)(66066001)(99286004)(3280700002)(2906002)(39060400002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR02MB1691;H:CY1PR02MB1692.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-microsoft-antispam-message-info: dMnR+GjaHINC8FWxPq+zUlIpBrKZS3LxvUc+eKTwsParbuSYAIu5+zx+YNz+J3RwyOFtvOKxB4kBEiTLAZ5yVA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bce4681-8e26-446b-91b4-08d5526852b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2018 05:10:35.8988 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1691 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Vinod, Thanks for the review... > >On Thu, Dec 21, 2017 at 03:41:36PM +0530, Kedareswara rao Appana wrote: > >same issue for patch title here too Ok will fix in v2... > >> when hardware is idle we need to toggle the SG bit in the control >> register, inorder to update new value to the current descriptor >> register other wise undefined results will occur. > >can you try making it bit more clear.. Sure will fix in v2... Regards, Kedar. > >> >> This patch updates the same. >> >> Signed-off-by: Kedareswara rao Appana >> --- >> 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; >> } >> >> -- >> 2.7.4 >> > >-- >~Vinod