Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp455106ybm; Wed, 22 May 2019 06:11:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy96hz0H4XdwtkDuG04dXFPFSa7zTXPp8FjrbkX62ZcuY6zb8WzcTcg88nAQ3agG6JyXRe X-Received: by 2002:a63:234c:: with SMTP id u12mr92247403pgm.264.1558530694181; Wed, 22 May 2019 06:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558530694; cv=none; d=google.com; s=arc-20160816; b=VAzMuSweW5QSkUqjSInvu4lLNFYln8sbPD1YiQm8bP0PMH9nTwXqovyK7xFk1ZLybI df70CTGi4eRzpFr3sRzxqqTJ7ZuCYBPM2jwtuIpDwCW6eCx27EZ45DCf+73l+HCqgaHu 5dkO+2FgZL5TLN5Lv7PgDLEyncYff+EoVVWk8RlbJiqiW0ep3nBMxttfDrUDhIyxG2P7 vD2gHI/0c4nH0yDDDTf0apqNpizsHUDPFA5AOY5zPjNgFbqmp99WWBEiepNvXVRdtpIT JfABv3kBhZEXUIF8l35jL0p5k3UZJ9v/e2pl5n2ZieX8NaUfdJA7Kz86fTTY23ESqzpc LBmw== 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=hD1OZp5OJrzRnZEhz9452Rrf4Itn6gn15Vtmzk3xFN8=; b=gg0ajxlbLNgEspSLNYaGxad8f2Jp7yQufmxEq6oe/jYZOpZ8a7YwZktCUX1IT/VCUs 0giEzZ478cXcqNHHL9saP20J+Y0kGXrgKwYTcvyWvcHQMMjoSJYc87CCMAWzYO1qp9co Jti6f5FZnXZvtPEnhY5VxeNe0OFCHTSuMnpEkB5YctaEitMBMpGMwoMacHojqAdjUK1c 72hPsVji3fGbcUtafXBfMDHVH2LKJuVNJDmQhVDwEZzcFpyX13uzULOqhUBndT2O3Oeo 1Wdzp2rNSlL6GSgvrFdCllEl614e+nI4a2+N72ZOf/8jFDxOV+RrvAGH3uEs9GZWbS5q woTA== 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 q2si25523044plh.148.2019.05.22.06.11.08; Wed, 22 May 2019 06:11:34 -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 S1729323AbfEVNJp (ORCPT + 99 others); Wed, 22 May 2019 09:09:45 -0400 Received: from verein.lst.de ([213.95.11.211]:39448 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729071AbfEVNJp (ORCPT ); Wed, 22 May 2019 09:09:45 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id DC0B267358; Wed, 22 May 2019 15:09:21 +0200 (CEST) Date: Wed, 22 May 2019 15:09:21 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Horia =?utf-8?Q?Geant=C4=83?= , Konrad Rzeszutek Wilk , Marek Szyprowski , 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: <20190522130921.GA26874@lst.de> References: <20190522072018.10660-1-horia.geanta@nxp.com> <20190522123243.GA26390@lst.de> <6cbe5470-16a6-17e9-337d-6ba18b16b6e8@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6cbe5470-16a6-17e9-337d-6ba18b16b6e8@arm.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 On Wed, May 22, 2019 at 01:50:47PM +0100, Robin Murphy wrote: > Would that work out any different from the existing DMA_ATTR_SKIP_CPU_SYNC? > > If drivers are prepared to handle this issue from their end, they can > already do so for single mappings by using that attr along with explicit > partial syncs via dma_sync_single(). For page/sg mappings we'd still have > the problem of identifying what part of "partial" actually matters, and > probably having to add some additional new sync operations to cope. Except that the same optimization we are tripping over here is also present in dma_sync_* - dma_sync_*_to_device with DMA_FROM_DEVICE is a no-op in swiotlb.