From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D675DC433DF for ; Mon, 6 Jul 2020 19:42:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBCC120675 for ; Mon, 6 Jul 2020 19:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726542AbgGFTmd (ORCPT ); Mon, 6 Jul 2020 15:42:33 -0400 Received: from smtp6.emailarray.com ([65.39.216.46]:45096 "EHLO smtp6.emailarray.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbgGFTmd (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: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@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