Received: by 10.213.65.16 with SMTP id m16csp229917imf; Mon, 12 Mar 2018 01:28:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELtqH4IhrHH3ZgVjEDSO9S146qN0z3MF23KI9md49M6j2eaixN3tCoICQLefsPEs2PKD7f/r X-Received: by 2002:a17:902:7b95:: with SMTP id w21-v6mr7534535pll.260.1520843287734; Mon, 12 Mar 2018 01:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520843287; cv=none; d=google.com; s=arc-20160816; b=OLoFRGFGy3M7siLgI6fRU7NOprM4w/2c4hlTrhPCvBq/059Q4cHxsbZSPuOQMxFFMx 7TsvGQnYEVShhsvnSYP8HCZMtiWKQ9ckBshm+xCg9l3x98HC9d5FuniFs2J5qU5aP3HB N5CHLpVYNvA6GExVNkYnU2Fml9YamBgBhuAT7GIz4snGRleryM/KYQa7yNgehO9I1c/T nby5nYRVdBg4X/TWSYQ+rIXeYbq9VvHyqB1WG1qjOf2n2zE1UP33cnJOdVK+YZ3MqEd7 m381mOzLgP79FGuX3PCK1lq2uZYi4+GlgZR1IRMsqO/RQabNJeXY6kziecSmYveW8pR+ T9yQ== 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:arc-authentication-results; bh=owymN/Ado1ETNp0b6Hcpwr6ywIXH86lB5t8Qz7BejFk=; b=SOMnSi7Xnoqke6YBVZBFWKgoyF/MwgG2as50TW4COpYwAg2KwR6ZW8FUGgM1YVR2tF rr3BWPKE+z0MUH4eN9fYxPTI46B9u4Mc/pVHkJmsVYNQOB0RbSGcUco3ccGBW9fwHzQC dFAZH9KQ8jjP+YEDG0azjk8bRdy/sqiAAnR9FQw5ydoUfN7C+nejF7TeBrgspBmmOBE2 WWkByvjZhjTzPQykMG0pioeUIpvSujxT/yYm6FRAGmruFfvIcquHVvgXJvXOWUcKe3H6 f2wIuMReyAeXie88v/XFljDa02VPGHDiEwuq0k576GMskKS6r94RCvqgeG9fKZWE+G3F axjg== 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 a13si5467185pfg.61.2018.03.12.01.27.53; Mon, 12 Mar 2018 01:28:07 -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 S1752177AbeCLI0g (ORCPT + 99 others); Mon, 12 Mar 2018 04:26:36 -0400 Received: from verein.lst.de ([213.95.11.211]:51590 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbeCLI0e (ORCPT ); Mon, 12 Mar 2018 04:26:34 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 3616ADE6B6; Mon, 12 Mar 2018 09:26:33 +0100 (CET) Date: Mon, 12 Mar 2018 09:26:33 +0100 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , x86@kernel.org, Tom Lendacky , Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, Muli Ben-Yehuda , iommu@lists.linux-foundation.org, David Woodhouse Subject: Re: [PATCH 04/13] x86: use generic swiotlb_ops Message-ID: <20180312082633.GA5724@lst.de> References: <20180305174655.9878-1-hch@lst.de> <20180305174655.9878-5-hch@lst.de> <825d4b49-8fa2-e670-75e3-77a88258af3a@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <825d4b49-8fa2-e670-75e3-77a88258af3a@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 Thu, Mar 08, 2018 at 04:03:12PM +0000, Robin Murphy wrote: >> Also fix the sta2x11 case. For that SOC the dma map ops need an >> additional physical to dma address translations. For swiotlb buffers >> that is done throught the phys_to_dma helper, but the sta2x11_dma_ops >> also added an additional translation on the return value from >> x86_swiotlb_alloc_coherent, which is only correct if that functions >> returns a direct allocation and not a swiotlb buffer. With the >> generic swiotlb and dma-direct code phys_to_dma is not always used >> and the separate sta2x11_dma_ops can be replaced with a simple >> bit that marks if the additional physical to dma address translation >> is needed. > > FWIW, last time I looked I got the impression that STA2x11 could just use > dma_pfn_offset - the comments and a2p/p2a logic in sta2x11-fixup.c > certainly imply that the underlying hardware situation is pretty much > exactly that for which dma_pfn_offset exists. That probably is the case. But without access to the hardware I don't feel like doing this deeper surgery. And even without that this case provides a great simplification.