Received: by 10.192.165.148 with SMTP id m20csp4381833imm; Tue, 8 May 2018 07:37:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTxb5NNOLXRSnkXFkPpXo1EUT+bnZVaARZYN0hcIfzBmicP0nz9V7/BGy50MCOIZ6SQK9u X-Received: by 2002:a17:902:7406:: with SMTP id g6-v6mr24451778pll.237.1525790231075; Tue, 08 May 2018 07:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525790231; cv=none; d=google.com; s=arc-20160816; b=lPOGoYbpLxYcC5yXwKAt5pghCeFX/CTXg5dKpkq7ip+5xzf3tTnr5iUuOhU/+LMLhN 5dyRIryXHrod6UV7kX4J7Yrp1BFpkXVnsrsc3UcxqwMecpw8GWra7837OPvcCr1NeyZj FIM8SQghbnJqMZPme993wce1VGYl702Ww7sOicV2YX0ZxPikoDHkVPGuBFRumtw/iYPc 48AQEuBsFsyJWaO+LxDN7Bktj61a1QO+KRRlKv160Sh5fwzyXn9nAPXAKk+r3uKh+2O5 nd+6L2jSl1dSTghlrtSI7RqlnTRpgrmoKGtjAk+w8k+lraFwHaaBKFD1hiT6EF/AJzsf /0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=JOhh37DqdQMfwDcVPQ61CaVg72JGkpE+t8Uvnu7iyKs=; b=iPCVh7Ahc8f6Tm3wIo1uk/gERYdTOlgG023+IKpccIzPVqZOKAG2Xl70klVWpRZh2L tcbCGuAS4fnit9RWDC186gB8LfXU3OKfokxYzbovlATdj5jLptUsM61gnMg+98nu94xE jZo6eLbguExeOHkXSWJ1tdaaE4u0NWoQPcaYrFEQXHQpVOSKdGpn/KSlEJw8ALUfSwqZ foITTHDSyv54NiD1gbKGVujY7VVsLwarWg6GQPYx33OQMsUpWrQhjxIEwQyEI26ANNLY 5glG9FgFS/38ce4eWRMyNYZRsxvlKlw4/zlp73HixZgDRdBE4m8kEG+SVzjwJSqHg3B0 AW+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZRCcE8cd; 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 l7-v6si24172123pls.93.2018.05.08.07.36.56; Tue, 08 May 2018 07:37:11 -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=ZRCcE8cd; 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 S932591AbeEHOgW (ORCPT + 99 others); Tue, 8 May 2018 10:36:22 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:38729 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932323AbeEHOgU (ORCPT ); Tue, 8 May 2018 10:36:20 -0400 Received: by mail-it0-f49.google.com with SMTP id q4-v6so16627956ite.3; Tue, 08 May 2018 07:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JOhh37DqdQMfwDcVPQ61CaVg72JGkpE+t8Uvnu7iyKs=; b=ZRCcE8cdDJLAkDyuKG7UGuKoJ8Mx+1VksWjrOOEGJbS3pX/zniW+pMIpTxHvz0f45G K5dBFKl0tEoMpO8/5VoE9EqHYV8vxSeB44cg44d1sPiAEFUJaYZrnCFHqo7AbsVPlFiY wNTivCYYHsKbOv2oeyyPJBBqcqJxtS6hvOEy8wK2q7YDn6DS+XFfF+dZm35Oezlaqy2m 65+IFLJJmKxsbiaFI3KrOLDEz3Lrlp3463E0q+eiWDPl0Aaatu1v8SRJ00TVBvrZYDIc BzLfhkx0UKqtk9T8gxKUTOr8I/NkQ24nnnhCMxmwE74pAAJs0zv6AA4j4i6Hu+O5EjAu W5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JOhh37DqdQMfwDcVPQ61CaVg72JGkpE+t8Uvnu7iyKs=; b=j2WEd3piUJ/KrVvoHQLqAMnJ6DDEFwChtm7uqxIppFfk224cnoE6+lpUh4mbm6Z0LU 7RfkkZsFNKDfcxWPseCHAIX9gr8MrkHv1FyASAfaiLAMsWDzO8HkAiHNaB9hqvPu9i56 uRzSgi4qmoF7rm9N+W5Cydth9rU3e9S6M2GdHm2eAK0WX4dw2VRtMkehKaCw6z7ApM1Z QFLq3OE+Sbrya1cxZ0Q7aSgFXX2nh+ZcagMQ0TH46gtDdD6LJe810jYhfE5wA/ahAn/d T9DwBSR1W/GHsr/IwhOWoeTjp3Aojb88X/t/eRfHcfCU3u68XkGunb53Md+5vy5Lq2kz lwBQ== X-Gm-Message-State: ALKqPwcevaSosSU39BmPg3WkPoVkPFNyU8nSOJRbM8/CFZG4bA/y+b4h 3K3cP/A3eDIQ9bevA6kgw/98bhVq93520UwcNk4= X-Received: by 2002:a24:56c9:: with SMTP id o192-v6mr6136965itb.3.1525790179700; Tue, 08 May 2018 07:36:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:4d51:0:0:0:0:0 with HTTP; Tue, 8 May 2018 07:36:18 -0700 (PDT) In-Reply-To: <53b13d76-16a1-0e0a-09e1-c917e5d49326@samsung.com> References: <2484918.HKVQc3yJkt@bear> <53b13d76-16a1-0e0a-09e1-c917e5d49326@samsung.com> From: Frank Mori Hess Date: Tue, 8 May 2018 10:36:18 -0400 Message-ID: Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" To: Marek Szyprowski Cc: Vinod Koul , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Williams , r.baldyga@hackerion.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 8, 2018 at 5:04 AM, Marek Szyprowski wrote: > Hi Frank and Vinod, > > On 2018-04-28 23:50, Frank Mori Hess wrote: >> 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 > > This revert completely breaks serial driver operation on almost all Exynos > SoCs, because serial driver relies on having PAUSE feature and proper > residue reporting from dma engine. Please drop it if possible. > It will cause the serial driver to not use the pl330.c driver for dma, the serial driver will fall back on using the cpu. This is unfortunate, but the dma hardware simply does not support pause. The "nice" stop instruction DMAEND is not allowed to be inserted using the debug instruction register. The only possibility for implementing pause would be to make the dma transfer do a DMAWFE (wait for event) before every transfer. Then you would need to devote another dma thread to doing nothing but DMASEV (send event) to keep the transfer going. The pause could then DMAKILL the event-generating thread rather than the transfer thread. I don't know exactly what the performance impact would be, but it couldn't be good. The serial driver could be modified to still use dma for TX, since it only needs pause for RX. Also, if your serial hardware can report exactly how many bytes it has sitting in its rx fifo, the serial driver could be modified to use pause-less dma for RX. This is actually what I did for the custom serial hardware I'm using with a dma-330, although our serial hardware has a very large rx fifo which makes this scheme worthwhile.