Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp425949ybt; Mon, 6 Jul 2020 12:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwva8fHQBWl/4sZ0TgHr47kZavlyASvZDYJNuBhLhJPEW3eEwJghfdDZohq+puwrbsWA4/p X-Received: by 2002:a05:6402:3058:: with SMTP id bu24mr39795882edb.242.1594064704868; Mon, 06 Jul 2020 12:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594064704; cv=none; d=google.com; s=arc-20160816; b=dM3OeujxesSBkH6q91oJBzZkiHoI7pnHuKR1Q4ZlCkhTPWBOxX2uinIwOTESsoS+DG aYkgRLlDiOAOusL4V5PGfeEldvXSSaCp7/FvZIkiqYizu0u8DhwmeDEPCjRitr8I40Oo tXL4TUIjQDIJSVXZ27cmKGGJDjCxjLGBXXfic2Ji/M8Kb2UmmTzdPhf38X59ejHgxhLv pnXFRHMLSviN6J3Ob09CRUZSDWqkmtairgIZJPkCxQpDd7wh6vLpGA7tSNIWNK3kQP4k JP/vm8HC9Tmpsg/39FJkpJBUD0LhE7TWRR2VNS86g/wEZRtQjl5lC0wvUnd3Kx5HCKsy +HDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=e5DmdXVxUK2I4wdrEJr1jP9VXE+gP2AKP7ywqQH9shk=; b=laxnnB4ToD4BkEsAyJyySv0oesRFBY1TK8KFoWki1UZeXxgs4SMAKXZSav/r8Tff+t sHfpPQI3zaFOlLlQ1LP8pdujYdRAzr0RGidZD0mDlqVbVYR7UeBz40iRPGxxL0EBzR9L AEmk8+0K1JnzWMQsBa1GcMUXuZ9Dns7tvnYsXOtQJkNMo1wWjS2S7WmsDrw/9vr3QI8O OZ/y3135WrNoHwgoJIGb/zxSvviYs93JVVnyPRuB0F9KMJOdl1+bERDzPFZlrusbpxHB xIeHJmTZOp7XFnZT+8Soz70z/sUtm2gsoPZI8JJl3buS73h7iAmWlc7pAxjvZ2sgpEEn CXjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rp17si12742313ejb.67.2020.07.06.12.44.41; Mon, 06 Jul 2020 12:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbgGFTmd (ORCPT + 99 others); Mon, 6 Jul 2020 15:42:33 -0400 Received: from smtp6.emailarray.com ([65.39.216.46]:45097 "EHLO smtp6.emailarray.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbgGFTmd (ORCPT ); Mon, 6 Jul 2020 15:42:33 -0400 Received: (qmail 3254 invoked by uid 89); 6 Jul 2020 19:42:30 -0000 Received: from unknown (HELO localhost) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTYzLjExNC4xMzIuMw==) (POLARISLOCAL) by smtp6.emailarray.com with SMTP; 6 Jul 2020 19:42:30 -0000 Date: Mon, 6 Jul 2020 12:42:27 -0700 From: Jonathan Lemon To: Christoph Hellwig Cc: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , iommu@lists.linux-foundation.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] dma-mapping: add a new dma_need_sync API Message-ID: <20200706194227.vfhv5o4lporxjxmq@bsd-mbp.dhcp.thefacebook.com> References: <20200629130359.2690853-1-hch@lst.de> <20200629130359.2690853-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629130359.2690853-2-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 03:03:56PM +0200, Christoph Hellwig wrote: > Add a new API to check if calls to dma_sync_single_for_{device,cpu} are > required for a given DMA streaming mapping. > > +:: > + > + bool > + dma_need_sync(struct device *dev, dma_addr_t dma_addr); > + > +Returns %true if dma_sync_single_for_{device,cpu} calls are required to > +transfer memory ownership. Returns %false if those calls can be skipped. Hi Christoph - Thie call above is for a specific dma_addr. For correctness, would I need to check every addr, or can I assume that for a specific memory type (pages returned from malloc), that the answer would be identical? -- Jonathan