Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1063509imm; Mon, 21 May 2018 20:38:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoU520coPErO1S7LTfR2U+ZBA0DTSPomzRcxImIHWAp61qHqDmrEnV8y1nu6lA9u2EeHVUy X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr23246086plm.123.1526960312301; Mon, 21 May 2018 20:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526960312; cv=none; d=google.com; s=arc-20160816; b=yL/xdfmnY1oJnsnZIjj+J3kjRrXLmY6dIQNRlk9CKuMJnkM3YOlalHpmOcK+AR6Bq6 VtKtnVAhjS+uZy/WctRF/PXvB5QbTeMkE7OZvQ8p3GmBCsqjq1qcG0FLjtrVmhsVmWoL ebns+5AcPc56Iyq4rYXSAoDs4RQEWMWVVbX2X6c/8RdjV8MZvZQ8hm5T1mHbmLMiZanj yCo/lMPIimF+CU1cywuhdZe+/7GvVxZahUgCb3Gf5yY396J2C8O3+DIkYhsNrv8ebKKy tlFfTPmKjQWCPP+razV6vzZ6wik3ABWAkVvlrGsVAeNRaNyZIfhQPzNX2djZ6T4H/FIp tNaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=WkI1smYpNHs1iHuGRulDqZ6SNZ4TuykkVojXWXpGIKI=; b=MInLUX5P4OAbYwJrlPhLoffmCNHne4/+v3tJiVpSHbMTiANiYxuHvviS3T886Zf5+E dzn9aXOK1nOpy0NGXR5Q34IN0Hn+XpKzsSsfBmnvkzaBQCYPI0DuvK6BSePzXtDIbsL9 ckxsPtZN8Gl65PXC3KSrxOkDY2lmMM0gm68EOmVXdmJAf7mIZNvNMGAQ+nRJUweikuaN fDJeriorYEEc/KSVrdWX8myeToDMc2jMd9apYWNpF15McdbPLfdcH5Vk3JVxv9rXnQOF sevL/OFWSKXB3HwLqplIVSPS8sJgUFOaf1dtnBHWT1ZE8EuK40buNOyZpVNpZ42zmipC CpMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fe1YFIGD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si14962156plo.62.2018.05.21.20.38.18; Mon, 21 May 2018 20:38:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fe1YFIGD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbeEVDiA (ORCPT + 99 others); Mon, 21 May 2018 23:38:00 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:46602 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbeEVDhz (ORCPT ); Mon, 21 May 2018 23:37:55 -0400 Received: by mail-pg0-f67.google.com with SMTP id a3-v6so2296967pgt.13 for ; Mon, 21 May 2018 20:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WkI1smYpNHs1iHuGRulDqZ6SNZ4TuykkVojXWXpGIKI=; b=fe1YFIGDVO8LoMOPRN92q0ts9k0uiNuyzupbDMifOZeSZti7G0fa0TiQrj7O2KOfSp caWr1XwN7xF5xuJkPAau5FlL7pSUdXQrxbEuZR9pxioNvgdWNTE+KE/TCH3P9WA4xLoh RQ4SdfjP5y9V6NOQ4bB9/x2e0TpdyO7+rBTfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WkI1smYpNHs1iHuGRulDqZ6SNZ4TuykkVojXWXpGIKI=; b=mXThXdrckcmCaHRYOdMstFQAigb7mgjySAtRG/g6Jak4Y0waq/F5Pz+GPSWzGYDBvI n1H+8jNdgFBR1HpKTuwExdKybsRH+6oFj6rlFDxeETkSav3r4EVD8xOCEk99xOzFS8TL pA3o3JUiKyRdpx515Q6d79ABP7zMvZhmonXHRYOaI3m+16kTfwv49kslDWhxsgGElcGu pVFdJP00FlnGEZCMvNac+y9bWJS6VHzRvdqOtGUUfwcezcjp3xRiiGCKq4sEVyAz9XUe 9z4TfTznjSMOzOTlOko/Uyk5tP+JUjU3525wFHTvMa2dT/mZe88E8KLKkYIR6K9pY9f6 N4dg== X-Gm-Message-State: ALKqPwdAL7QhVWmyVi4SceZ9FAcUCX3E2zzeN0l/Z0xVRfeybM7aYsBp 17gyi/71dUz8HxWT03zTMrVTvg== X-Received: by 2002:a62:4184:: with SMTP id g4-v6mr22564626pfd.51.1526960274359; Mon, 21 May 2018 20:37:54 -0700 (PDT) Received: from localhost ([171.76.76.14]) by smtp.gmail.com with ESMTPSA id m14-v6sm23831647pgs.72.2018.05.21.20.37.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 20:37:53 -0700 (PDT) Date: Tue, 22 May 2018 09:07:51 +0530 From: Vinod Koul To: Frank Mori Hess Cc: Marek Szyprowski , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Williams , r.baldyga@hackerion.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Linux Samsung SOC Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" Message-ID: <20180522033751.GB18351@vkoul-mobl> References: <06f54061-c537-b399-e493-ec2cdf4def5d@samsung.com> <20180515062144.GC13271@vkoul-mobl> <20180517041946.GQ13271@vkoul-mobl> <20180518040349.GB2932@vkoul-mobl> <20180521091626.GB14654@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-05-18, 20:56, Frank Mori Hess wrote: > On Mon, May 21, 2018 at 5:16 AM, Vinod Koul wrote: > >> > >> I understand the residue can't be read after terminate, that's why > >> reading the residue is step 2 in pause/residue/terminate. My question > >> was whether the entire sequence pause/residue/terminate taken as a > >> whole can or cannot lose data. Saying that individual steps can or > >> can't lose data is not enough, context is required. The key point is > >> whether pause flushes in-flight data to its destination or not. If it > >> does, and our residue is accurate, the terminate cannot cause data > >> loss. If pause doesn't flush, an additional step of flush_sync as > >> Lars suggested is required. So pause/flush_sync/residue/terminate > >> would be the safe sequence that cannot lose data. > > > > I wouldn't use cannot, shouldn't would be better here as it depends on HW and > > where all data has been buffered and if it can be flushed or not. > > > > Have you checked if pl330 supports such flushing? > > It does not, at least in the context of pausing. The dma-330 DMAEND > instruction flushes in-flight data to its destination, and there are > read/write barrier instructions also, but none of them can be injected > on the fly into a running dma thread. DMAKILL can be, but it discards > in-flight data. Currently, if an 8250 serial driver uses the pl330 > for rx dma, the result is possible data loss/corruption. If there was > a stronger pause capability, call it "cmd_sync_pause" which guaranteed > flushing of in-flight data to its destination and accurate residue > reading when paused, then the 8250 serial driver could check for > "cmd_sync_pause" and reject dma drivers that do not have that > capability. pl330.c would not advertise cmd_sync_pause. I don't know > if other dmaengine hardware would be able to support cmd_sync_pause or > not, I'm mostly just familiar with the pl330. The ep93xx_dma.c driver > for example has a m2p_hw_synchronize function which seems to do a > flush. Well looks like even adding support for sync_pause doesn't solve your issue on pl330. Do you want to move this to PIO mode then..? -- ~Vinod