Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2545513pxb; Tue, 12 Oct 2021 08:44:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz80F8zNq6/jAG8Sts8JIyjne/iywawbnHUVfcB/K9Lpnwu0yZ6euvSUCidWhWUahj4Wm2g X-Received: by 2002:a17:90a:86:: with SMTP id a6mr6736004pja.190.1634053489617; Tue, 12 Oct 2021 08:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634053489; cv=none; d=google.com; s=arc-20160816; b=Rm3y+QFTKD0AfZjn/zGEIPrGG9ZXYJp2onXWLqc8qYxoG5SmKaKvHGCz7VB3WmeZr8 X0ulAVPttXRL2agtYaVDEkA7xdKxWdnMXEfQvPS6SGjHxerFPl97VAvjx48gqOss1Wj0 gDB2Bm9RGipj7wk0KSFBfC5HgulwGxe6bh42av/tiKo+NxY+mh3Ya1JaP1ELVMPCXhGH PCuL2r3uZKJa3NkkOLt7bzJAHOY0rbsTAluXdUrPg0hK6rWcJfmic/4sCS9VYt7GPgUN DFEyY6PJ1ddmc106vIsn3YGOGGzm4eR2OoiVpNCcRwtx4/jSF4YFbDfbJEVYvZuCLVGh txnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pYzGaaVTDb6cjnLawGS3ll6xPJPKRnUFVY4pJMEW1qQ=; b=YEhJPdEyIO1g1nFjxVG9BkybO3hixmIfuoKi7R/g/Z+OoimdppTySUoGGbZdn2329p HO7wDpTxeo8Bxm9fo+heOt4t8YzvZ3gqnH79ys1ng1hgNll7gn93ObA7xW3PZxkPeR4f bngns5nnL6aP3QMIBsobPzJWnByMl+cQLPgZxZuN/jQcooR1GJ8yaC+n0oq1it5NmTyA XBw0cOeLuEJ3zqK9M1tYVFyI4PHTZz9fOwCQNQwHaLYjG8SAMOGZIMEgkY1P8GBi7C3y 6zdo4Vli0g6EN6vME9S6/du+Chx5TTm8NfV8EuvtHeo7LmREp4EDdXG+rNVuG1+EtErQ 65tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=aXxWWEmI; 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 d7si13884148pln.282.2021.10.12.08.44.34; Tue, 12 Oct 2021 08:44:49 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=aXxWWEmI; 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 S236864AbhJLPp3 (ORCPT + 99 others); Tue, 12 Oct 2021 11:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237382AbhJLPp2 (ORCPT ); Tue, 12 Oct 2021 11:45:28 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE6AC061745 for ; Tue, 12 Oct 2021 08:43:26 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id v2so3639802qve.11 for ; Tue, 12 Oct 2021 08:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pYzGaaVTDb6cjnLawGS3ll6xPJPKRnUFVY4pJMEW1qQ=; b=aXxWWEmI7otvwPSXfEK6Hzf87wzKANGFEo45FY8A5C5F/h6dYa4niGwH6wB4OefJP7 5rjqaqb+N1m6rYoY232wpw522TUOaeDueRMMQpwLt/TU1Djr6C3feMO6grpFtugxJD45 x2IoyBLU8DjZkcFVlxjV7cbdXr3LfaofguD3yiwlMIA0KDUguZsm/uI4Bwfo4yIFQDqW VXa5ysmgc8uaDXjB+oKfD6wSswbZ6CJ4CFGHrclrSq/NpFwb31T1p6HixV+iX8t0Fswg GbHvcsIfXK9lbO+NOAhnljTfUI+InlE5qHq/udfKbcZI+B0LQzCrjaUtW3q7IlJR56EY CBDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pYzGaaVTDb6cjnLawGS3ll6xPJPKRnUFVY4pJMEW1qQ=; b=C4AtiFJhcGkMS3hKN/AjuxOWw9zCioa3pbVCjnBg5BhumWuB81FlUVCwwlIoJc5AoC RDZGX+aS6rWi5KKgABYhkICVpDCAiucPMvk/nN48/KarhU5YUDsmbRlHuJ/L6+ua44Xm avM5AyAmfgR8XokVWyG73vdxcoO6DEIanKH/kEq9/jvkDj/Q6zssYd8q+yRPFFuD9JJE dduUWsEl7pS2uZBBj7jFMiOhLKSWoS9KSlJiCv0wjonlRnTBSVVAF9WOfgvhSNTz1l1N PGDV5rJvDPY2S5G8XScvyMuq6HuWBIJdgDOQk3gbBniouih88YdztlvGcGXxtJejJrTx pTCA== X-Gm-Message-State: AOAM532/WGwOqHfDirmffQflc4qjV3UaGdp982P2gXmdHNxGyRNoYvLY dEAw9+7aeiiul3ktOyx0amNrYQ== X-Received: by 2002:ad4:476a:: with SMTP id d10mr30843885qvx.20.1634053406063; Tue, 12 Oct 2021 08:43:26 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id p9sm3138728qki.51.2021.10.12.08.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 08:43:25 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1maJw5-00E4Wt-0H; Tue, 12 Oct 2021 12:43:25 -0300 Date: Tue, 12 Oct 2021 12:43:25 -0300 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: Cai Huoqing , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Peter Huewe , linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent() Message-ID: <20211012154325.GI2688930@ziepe.ca> References: <20211010160147.590-1-caihuoqing@baidu.com> <31619f2f192a4f1584e458f468422cf6e8f7542f.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31619f2f192a4f1584e458f468422cf6e8f7542f.camel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12, 2021 at 06:29:58PM +0300, Jarkko Sakkinen wrote: > On Mon, 2021-10-11 at 00:01 +0800, Cai Huoqing wrote: > > Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ > ~~~~~~~~~ > Replace > > > dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() > > helps to reduce code size, and simplify the code, and coherent > > DMA will not clear the cache every time. > > > > Signed-off-by: Cai Huoqing > > If this does not do functionally anything useful, there's no > reason to apply this. At least in this case it looks like the ibmvtpm is not using the DMA API properly. There is no sync after each data transfer. Replacing this wrong usage with the coherent API is reasonable. Jason