Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp418577ybm; Wed, 22 May 2019 05:34:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwu9AIco2za4YBgF7Pctgp35iskjyq2eGX9To3GWMkUSMu8NEfAATuf2L7VVEu+W7WVxbQ6 X-Received: by 2002:a63:5211:: with SMTP id g17mr59411990pgb.405.1558528490498; Wed, 22 May 2019 05:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558528490; cv=none; d=google.com; s=arc-20160816; b=Tv6FDfC5VQMCgiNvY+sSFUGZSehRisbo+EXlsbyKhuHRembfWYzKL9L07Oaid7JZIa zXz52/aFSrX0LEs5dLqUah/6u1sRsBm4MEMtKHQDg8Lgeiu4GSmvcmqI5fmqeaFTpvfT jrOfDeihnjS7voH8qti/63zdRgEz2QQbLVeUNN9zVaXcXRB6jp+fjm+IPqrxbkOt++C5 s6XpokvoTQoe51ZvKjmzQ2R0tYzvMkdEH9HbbRJqRN2IMBdGj8cvPuol/IT5Ve/ljK7m IHC2ej2TRStuvyG/wvG1yHszFjaDNNhI33YE5S5eTWKA6k8E7eE/uh+61vSaK6ix7eWz dugA== 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; bh=ZquuZNBRygH5SWG/Jl60+qeAGcdyQp6pSmYpEj3e4JU=; b=u3fpANp2SbMScvmNExyl+9poBftdPbEQKzwIURgUFl2uZSezkZI8Ucg7jRP25ISkJc ujIZApGiRA4uvqpw8e5UDCuIxT/wq04Ju4QMFOMVqg91lSNvMH13Nlf2Jw6fG4A0yrPS 9OOwIz+DDOkBT8aEX2UCKYF2p0CUdhflLtOJ/zF4Szvd4Tu9cYLI8YAA8u7wymVhYNWA CTeH61a2M0odB8WcmzsJx6QvBRRVzqOgLj/NVYdsXsenA4lFNLUvR2CTGxR/cBs6KfM9 +wljrZ065otEQoulgPxNZglAhWLnep/dnFUINq2kNfika8xkb+stfRGTzJOOLjtlkfpG QuCw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si24908787pga.238.2019.05.22.05.34.35; Wed, 22 May 2019 05:34:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729373AbfEVMdH (ORCPT + 99 others); Wed, 22 May 2019 08:33:07 -0400 Received: from verein.lst.de ([213.95.11.211]:39305 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728914AbfEVMdH (ORCPT ); Wed, 22 May 2019 08:33:07 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 25DE967358; Wed, 22 May 2019 14:32:44 +0200 (CEST) Date: Wed, 22 May 2019 14:32:43 +0200 From: Christoph Hellwig To: Horia =?utf-8?Q?Geant=C4=83?= Cc: Konrad Rzeszutek Wilk , Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: Re: [PATCH] swiotlb: sync buffer when mapping FROM_DEVICE Message-ID: <20190522123243.GA26390@lst.de> References: <20190522072018.10660-1-horia.geanta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522072018.10660-1-horia.geanta@nxp.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm a little worried about this. While it looks functionally correct we have surived without it, and doing another copy for every swiotlb dma mapping from the device looks extremely painful for the typical use cases where we expect the device to transfer the whole mapping. I'd be tempted to instead properl document the current behavior and introduce a new DMA_ATTR_PARTIAL flag to allow for partial mappings.