Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp55837pxx; Wed, 28 Oct 2020 18:01:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwakyRbaU2wdKf45xHK9m0Yj+/obB9x/wZA47NPLkENmNwfIQEzqLevsYBiBEzMbaY4ziEs X-Received: by 2002:a17:906:3899:: with SMTP id q25mr1868056ejd.0.1603933285702; Wed, 28 Oct 2020 18:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603933285; cv=none; d=google.com; s=arc-20160816; b=n80/ifVIT6Bb3ZllfDIZY7JrTzk6Yd303g2fNhRlppNzRNHLjTHO74L5pInUcMUOAH VFKcKah1B4paMyaZ6H+2iBo8BrdPpIUXKAVsy6rPAqQPNdeW9qIGZ2veMJF3R3IUTG26 /Csc9I6j4rEkzZuIlQjFfMYQdDnjdUjiBg2ocbJ8rn3zeUAqcUs3isk14yel6V6WO+2A yR9Hcv8PkiokKN4FsTUrqOhwLahgWzpjCkdktSnSmTXGNWB4pWsWy8C+3DVAMeAp4M7Q op5ZtUZuZ7a0d47BM/YHgaeqaWu55yeqr8MyfV8F6nRNuDcMBvQ2d8QBWVsT3XKFUoq+ eH/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0m7gBB8tnXqwJgpyIcn47FsuedaLncSFjUM/3W/0PG0=; b=0+LbVc1yEM4Wf+kwIj6iskKIOQ4Okqo0dIF++2aFVMj5ygL9AgaQzXVq+nXcF4w0OX I2SdhIPsQK1SI88mHnztRq2Nus9umLf9AszksDT5epEavoVICapoMhpuPOVl2akxYgWf +htEBizkcobyLU9ywVLYtDJ4TCdZCqS2M6uLaFbLxMTG21uTe47PlQt6v+Kw4DnZQvEh wOD/bEvqJnkcvZUR/xppyh0hF6w+HK87zXgdha9UpKldNl2m6mS6sxFE1kWcWsj6DeUs cR/Es//qvh2vqgypZPBOF+zZ8SLNClIAml6ej21xB7y01oD01jmcQVZ0PxL3a9X00J/X Dclg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si885738edu.247.2020.10.28.18.01.02; Wed, 28 Oct 2020 18:01:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730141AbgJ1WHf (ORCPT + 99 others); Wed, 28 Oct 2020 18:07:35 -0400 Received: from verein.lst.de ([213.95.11.211]:45194 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730113AbgJ1WH2 (ORCPT ); Wed, 28 Oct 2020 18:07:28 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C423468B02; Wed, 28 Oct 2020 18:21:06 +0100 (CET) Date: Wed, 28 Oct 2020 18:21:06 +0100 From: Christoph Hellwig To: Alexey Kardashevskiy Cc: Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation Message-ID: <20201028172106.GA10015@lst.de> References: <20201027101841.96056-1-aik@ozlabs.ru> <20201027101841.96056-2-aik@ozlabs.ru> <20201027164858.GA30651@lst.de> <28147035-500d-f3cd-f283-257066343697@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28147035-500d-f3cd-f283-257066343697@ozlabs.ru> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 05:55:23PM +1100, Alexey Kardashevskiy wrote: > > It is passing an address of the end of the mapped area so passing a page > struct means passing page and offset which is an extra parameter and we do > not want to do anything with the page in those hooks anyway so I'd keep it > as is. > > >> and >> maybe even hide the dma_map_direct inside it. > > Call dma_map_direct() from arch_dma_map_page_direct() if > arch_dma_map_page_direct() is defined? Seems suboptimal as it is going to > be bypass=true in most cases and we save one call by avoiding calling > arch_dma_map_page_direct(). Unless I missed something? C does not even evaluate the right hand side of a || expression if the left hand evaluates to true.