Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4568451ybb; Tue, 24 Mar 2020 00:56:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuERFJneH2aHEdZWwidLbwRO2KUUm49ST2dufIWAzDSQufBdbOkQ3NIK2aECF71BU16if98 X-Received: by 2002:a9d:6e12:: with SMTP id e18mr143930otr.10.1585036594066; Tue, 24 Mar 2020 00:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585036594; cv=none; d=google.com; s=arc-20160816; b=QzZBxT+ClKpOO7O+TBOL3MImQ9DTcTLQNcI4DyROnjRNAb4UyVuMDlIvK5Pd+zSikk WiBOkBHSNi5/t933OcXaX3TYTwqS/2IhZKV/FDd6vjZGYi00bkaZv/yCF1mj7IGTHAJJ fE4/b01KYNZnJe163P3dVSEvPJpn2MSDd27z0srzE542xQ3P+wEW8dpPlcFKNTDjmaqk Qt2cV6hv4xol5S5nLNO9FR5ai6H9DHhCkol9jKVswsj59mvkKeeQuMFA7s8KVgpKn+mN 9dG4SzRGixUPQXvX4UTHNceWpPJulyOmPfL6HG4k5/IXjyFYkfgT9yF/W/D3lQxqVfG6 TegA== 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=KJrQcGG44mnOylUPceFJKi/YYtQPayY+vyCpsRl5WXY=; b=xMg3PzQMAh0nS5ysvLfavL9yhYNYtrRiHF80MLFsiUPdcb1S/WVqznUv0Fb6IHGo5Y ZfFvo6Po0DbMfZ41q1yCVUwkxJvE+2MD97lzYB5awyLeKVMkmKRGDyZkrjrnBy53jeJF he6pKeQrENU7DhEiPh9wp5N2XmElKFCD4z8NNkWLdC4pDVIo0AA9C8wYiyJkI5V5PzIq 3em0JHvQVye0JJGB4d3sM+WPMuwB6otbRJj7Az1fYu5H9KQ9R55BShL9sM6bWMjEPdTv QTfTv8d2DcBNn7YgpXOqwz1WW6ISDEKS1Uib5UTshyyj4Gxr1SDGH16X5OlC4BD2q8cW J5pg== 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 k185si9001142oif.13.2020.03.24.00.56.21; Tue, 24 Mar 2020 00:56: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 S1727525AbgCXHzQ (ORCPT + 99 others); Tue, 24 Mar 2020 03:55:16 -0400 Received: from verein.lst.de ([213.95.11.211]:34316 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbgCXHzQ (ORCPT ); Tue, 24 Mar 2020 03:55:16 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 038C268BFE; Tue, 24 Mar 2020 08:55:15 +0100 (CET) Date: Tue, 24 Mar 2020 08:55:14 +0100 From: Christoph Hellwig To: "Aneesh Kumar K.V" Cc: Alexey Kardashevskiy , Christoph Hellwig , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Lu Baolu , Greg Kroah-Hartman , Joerg Roedel , Robin Murphy , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device Message-ID: <20200324075514.GK23447@lst.de> References: <20200320141640.366360-1-hch@lst.de> <20200320141640.366360-2-hch@lst.de> <2f31d0dd-aa7e-8b76-c8a1-5759fda5afc9@ozlabs.ru> <20200323083705.GA31245@lst.de> <20200323085059.GA32528@lst.de> <87sghz2ibh.fsf@linux.ibm.com> <20200323172256.GB31269@lst.de> <87pnd22rke.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pnd22rke.fsf@linux.ibm.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 Tue, Mar 24, 2020 at 12:00:09PM +0530, Aneesh Kumar K.V wrote: > dma_addr_t dma_direct_map_page(struct device *dev, struct page *page, > unsigned long offset, size_t size, enum dma_data_direction dir, > unsigned long attrs) > { > phys_addr_t phys = page_to_phys(page) + offset; > dma_addr_t dma_addr = phys_to_dma(dev, phys); > > if (unlikely(!dma_capable(dev, dma_addr, size, true))) { > return iommu_map(dev, phys, size, dir, attrs); > > return DMA_MAPPING_ERROR; If powerpc hardware / firmware people really come up with crap that stupid you'll have to handle it yourself and will always pay the indirect call penality.