Received: by 10.192.165.148 with SMTP id m20csp2194776imm; Sat, 28 Apr 2018 14:52:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZraqBihEjgAPxnDqQuWeKtb2BBmUVdBLAWNZorYkCz08i5BjqCFOk5mhmm0HKaP7uvz5g1B X-Received: by 2002:a17:902:bc49:: with SMTP id t9-v6mr7313458plz.109.1524952353541; Sat, 28 Apr 2018 14:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524952353; cv=none; d=google.com; s=arc-20160816; b=uBJmbcEZSMQ0Yu9unKVNyLBqUPQr3egssGuRho1EueM9CU38SrqZ+DWTHMh1557R+3 0D47ImUdzokd/jSmVs4CtBvs3roEwICIGxLzxWd5OoTdJteBXqL9A4zw94KVu8nFxEHI ffqtWk8MUR84GvltK1FUc0nylKd+XSxwnXvTV11Sny0hE+VsnuvFBJQqzNdivis4gNjP xeZHct955EnkkwHriNb7Gd8CmwXmPbEQ2rvGiy8jvsUC9B45KIGf2l+KiSEQ0glhldya 3t57A4y5vXevToAI8Q+r/GBwJRQS8vn4fI5ri1xnrX78auyEKEOA0suA7/q9L8xY+pqL +gZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=KK9A8+Z7aZgQyVoITpdMFselMnvjt6pUoez5Q3hOLkk=; b=ohLiDveEuiTmEiGpjUGZdfyZiBRG6eZeAqR1p62ssm2s6HTU9uH454gGkMLWe1vobS xITiIaa6F04s4dJXpuD/B9g4KWHE/LHqMXCqU37pl5T9Lys2Hd2MaFxB5EpnLAYPkm+O dWjLeoM1bHrcARU8eSdYUhZ65ek4/xq2bMbOgqDmKitnE95tk6vNbyhYFwOtALL8NbVo tvY+NXokdZo9jupY92xKBO625yPD/lvyrTA925VljTtYOkpZsmYVhSQjeGfGw26N5GkW 7PvQi1/B0Ap7ZWdCpy/XVOOyqyX7gQZ9AG4qDNosDiQi/QoadZa9Zctf0LbHL2NwUlzb SGew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R34vGvtg; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si4223797plz.469.2018.04.28.14.52.14; Sat, 28 Apr 2018 14:52:33 -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=@gmail.com header.s=20161025 header.b=R34vGvtg; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbeD1VvH (ORCPT + 99 others); Sat, 28 Apr 2018 17:51:07 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:41174 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbeD1VvF (ORCPT ); Sat, 28 Apr 2018 17:51:05 -0400 Received: by mail-qk0-f196.google.com with SMTP id d125so4166759qkb.8; Sat, 28 Apr 2018 14:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=KK9A8+Z7aZgQyVoITpdMFselMnvjt6pUoez5Q3hOLkk=; b=R34vGvtg7T3rGB9xPaQH/JYRsv1vwI890xxN3kiySTwCB0XRa9h42nwz09R32hol4Q vBKgBEWCUAfb5MPrgFBi50j0AShXHEC+G3adi+/FHOBZODwnWPIMABZzrhkQGcGPdVUY lsBR/ZhdKdCJbV6FN6hGxZ6joDvzOgotvCBqUiLFw+pZBcBi8xr6OMN55AmmxjgIPpzD W4TvVJ5Xp/vOHdWYsH5TNSPk+9SQZFK3+xbZft29DuenYE3Uu13AVaB+s6B4/B8972Nx UKCr2NUgVqtp6zMELpcZ8mIrTXRr1xbckADHUlPdjaIUu/rBr37zDcNuMIO7M7P//tzH KzyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=KK9A8+Z7aZgQyVoITpdMFselMnvjt6pUoez5Q3hOLkk=; b=stw1WHxSPxov/NIQMPqOJLnvcH9GYW7rFzGqepLWdtIQlTG3q8+VuxVmujyUXj5dBc fnSD05Md+8G7XJsbO2OXtpxNyriONzL0ecvWIyXZMlgiSUotINCl/vHl7CtMKQE2kChG 87Qq7l85Ak5zOM3PWVydojILTjYy9879L0rIe8Fe5afsI09cDXYLQISAacHiY2DicqAY jznkOm5uZxYis6/vxED0zZpWFUfecq/VlFSd1D7uqYc8EZvxc+lGyX0Kma/s+uaRFtRc OMiYFnBPvXIt5GeMdbdl+L3I6dF/3Bvh0R32LKeZkH/WJrxEysGVJcJ2cl4dclVEJkML 2cGw== X-Gm-Message-State: ALQs6tDlpdzqdEwvElWdQ6pyhBH81zlBODBPiiHWaFLCgtekFknjrHaQ nYwRGV6TgSuUwDs4g0ch/Ac= X-Received: by 10.55.122.132 with SMTP id v126mr6197147qkc.249.1524952264434; Sat, 28 Apr 2018 14:51:04 -0700 (PDT) Received: from bear.localnet (pool-108-31-64-178.washdc.fios.verizon.net. [108.31.64.178]) by smtp.gmail.com with ESMTPSA id k188sm3160787qkf.57.2018.04.28.14.51.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Apr 2018 14:51:03 -0700 (PDT) From: Frank Mori Hess To: Vinod Koul , dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dan Williams , r.baldyga@hackerion.com Subject: [PATCH] Revert "dmaengine: pl330: add DMA_PAUSE feature" Date: Sat, 28 Apr 2018 17:50:58 -0400 Message-ID: <2484918.HKVQc3yJkt@bear> User-Agent: KMail/5.2.3 (Linux/4.9.0-6-amd64; KDE/5.28.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 88987d2c7534a0269f567fb101e6d71a08f0f01d. The pl330.c pause implementation violates the dmaengine requirement for no data loss, since it relies on the DMAKILL instruction. However, DMAKILL discards in-flight data from the dma controller's fifo. This is documented in the dma-330 manual and I have observed it with hardware doing device-to-memory burst transfers. The discarded data may or may not show up in the residue count, depending on timing (resulting in data corruption effectively). Signed-off-by: Frank Mori Hess --- drivers/dma/pl330.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 6237069001c4..f802bd3b0481 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2290,33 +2290,6 @@ static int pl330_terminate_all(struct dma_chan *chan) return 0; } -/* - * We don't support DMA_RESUME command because of hardware - * limitations, so after pausing the channel we cannot restore - * it to active state. We have to terminate channel and setup - * DMA transfer again. This pause feature was implemented to - * allow safely read residue before channel termination. - */ -static int pl330_pause(struct dma_chan *chan) -{ - struct dma_pl330_chan *pch = to_pchan(chan); - struct pl330_dmac *pl330 = pch->dmac; - unsigned long flags; - - pm_runtime_get_sync(pl330->ddma.dev); - spin_lock_irqsave(&pch->lock, flags); - - spin_lock(&pl330->lock); - _stop(pch->thread); - spin_unlock(&pl330->lock); - - spin_unlock_irqrestore(&pch->lock, flags); - pm_runtime_mark_last_busy(pl330->ddma.dev); - pm_runtime_put_autosuspend(pl330->ddma.dev); - - return 0; -} - static void pl330_free_chan_resources(struct dma_chan *chan) { struct dma_pl330_chan *pch = to_pchan(chan); @@ -3027,7 +3000,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) pd->device_tx_status = pl330_tx_status; pd->device_prep_slave_sg = pl330_prep_slave_sg; pd->device_config = pl330_config; - pd->device_pause = pl330_pause; pd->device_terminate_all = pl330_terminate_all; pd->device_issue_pending = pl330_issue_pending; pd->src_addr_widths = PL330_DMA_BUSWIDTHS; -- 2.11.0