Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1289548pxb; Thu, 14 Apr 2022 02:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4SASZ8xT25ffcisnCP1G4XmXrZDVThGquaIksfi3xAvlt/oNHnQcTZL3BqiKVg8JiiIJz X-Received: by 2002:a65:694e:0:b0:399:5aa8:2845 with SMTP id w14-20020a65694e000000b003995aa82845mr1658739pgq.38.1649929831972; Thu, 14 Apr 2022 02:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649929831; cv=none; d=google.com; s=arc-20160816; b=r90hryEnixNubzpwRJ/yfSljXKv5ULFSjOzd7cp0depPXx0CxLBGPhAx86+0tbvvwB sEmrVcTt+OFVOvN9MWKlSWUUy94yDuuV5p3tJlAsfQxY6vW5WKWFgq+6p2Hb4k7wpPU/ zh4JU5fDQaZi6Y6nBSGWuDXLgKnH2U7HNbNML92EheXazdslhYsL10UPsvLrhXNNkIj2 OllBqy7GeZaQvpjdOAqk3Dn0QUHEBFi/Ec0RwfaGWd/ccI5IYpp9uxUb/hfxTaYEp6wH y5ZM7tnI3zwmVQoCd8rBYcKkSdIKx3CMopMxXi4hKdG3LIGddcXI0nrLMI1kqYi6ZZW7 /Mdw== 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=TXLlYecIivW5dbH23DWzZx2CyNiMJ7jFb3Yk3JsemxU=; b=n6bSXpkRooMtFvTQO2Z/ttuAyVhop7JOVGUG99GiYx9oSbEpP86r2Q47++UzN2Yemm q+rO3Z5bWZ8M47WWaKCd+tNwy1RueeyJSPIo08uYxpoVE3FlzUmwM23T4Zic6cAvS+TH /ceYOXQnSFrXkBtFFGQ5SBeh6uzi78O8xCShOHDOeH8FnZqg++Rf9oQfnP0c4bes1z4V SwDdqfQgNrRoMF804aAchRAeWNgdmYq4BFuJgBT9+rR/MqTHWq/gB0l/CQfSYeEZi6VI v/fvligE14DXIihrBl1qL75LstEoBLY/l+tNdL56H5b8VoeYZDZ0haWbGT6nMuNmG1uQ VIGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a1709028c8f00b00153b4bc544bsi15874315plo.312.2022.04.14.02.50.18; Thu, 14 Apr 2022 02:50:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237000AbiDMQrP (ORCPT + 99 others); Wed, 13 Apr 2022 12:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234436AbiDMQqr (ORCPT ); Wed, 13 Apr 2022 12:46:47 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9896BF45 for ; Wed, 13 Apr 2022 09:44:18 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 8FC2568AFE; Wed, 13 Apr 2022 18:44:15 +0200 (CEST) Date: Wed, 13 Apr 2022 18:44:15 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Chao Gao , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, m.szyprowski@samsung.com, Wang Zhaoyang1 , Gao Liang , Kevin Tian Subject: Re: [PATCH] dma-direct: avoid redundant memory sync for swiotlb Message-ID: <20220413164415.GA31640@lst.de> References: <20220412113805.3210-1-chao.gao@intel.com> <20220413010157.GA10502@gao-cwp> <20220413045958.GA31209@lst.de> <4a993382-6a29-a0f4-4600-90ab60ad982a@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a993382-6a29-a0f4-4600-90ab60ad982a@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 13, 2022 at 02:10:56PM +0100, Robin Murphy wrote: > Are you sure? AFAICS swiotlb_map() does the right thing, and > dma_direct_{sync,unmap} are working off the DMA address, which is that of > the bounce slot when SWIOTLB is involved (not least, how would the > is_swiotlb_buffer() checks work otherwise?) Yeah, actually this should be fine.