Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2534010pxb; Tue, 12 Oct 2021 08:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDIOyFwQDAQYzTPQAZRf2uAlypR194b//5MbEhgd+B1xQsrV7oPOcC/Xjdn3AM0QqApGzy X-Received: by 2002:a05:6a00:181c:b0:44c:bf17:e8ad with SMTP id y28-20020a056a00181c00b0044cbf17e8admr31604289pfa.67.1634052727645; Tue, 12 Oct 2021 08:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634052727; cv=none; d=google.com; s=arc-20160816; b=k/tEB5kThsAcFEt3cc6FgZZDh59Z9EczRR7eRJVyMrBHERo0nU/cu9bWz//mbIq56D S7gdWtoBpBcjOMS3iqZB7SBJe551KXmFRyXhcm1Hu4F/dbJhauJbbx9GAMVyHoLsAxwM LQYpjAuYJay9mhx0+h6Aj4EZsEQMHQfCd0YWi0xisiHdJsz9UZydjlw81ijzUKj08Rt8 b/qrH+7zDyqXntV0GSm3YqJ0VlF6/rqHRX8VVoOpQBwO6PnW8XRXsJ3z0q4c9GwINrZY 5D5BgA1n015AtMxgxddXe20nz4umjLNsJCwXX1kYrxCOjLTq2P+o/Swlwsp8Fpl6kjC6 Xy6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=gw9AcApx9xz9FLgYHyjZZOt3eSQwXna4V8TKAbGdcB4=; b=ixUBGqCSywJXJx12mhHSGVFDeIm34v55NkI+JSoMJmwJcZ5JFqyR0bZxuB8XkvAW+z B3Cuu5jPpeXs40cMsii7mYpFS4X2EzZ8MqnTHgC444Z8GTZBXD9zp/gNTRHwj3hpq+42 0rSLX2iQKQ18cb8naas70cAKvEJeAc0+lWzsA6RWrV/idWRpqEYjiwOHwRmgUCGTLPsh 9XxcHvPUqhUW39dtHI27x5B/f+AUOfl0WrFGMf5a7wo78SxBJ51SZN9ny3JlzVKMWquK hm8s63TJkL0No8UKgoDUi4HM+x0/s9yCk+EMiwPP24RejLbO39HxxnA19MpJcVl3OIHO Hl3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pgxa5ioP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o27si18377648pgd.502.2021.10.12.08.31.42; Tue, 12 Oct 2021 08:32:07 -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=@kernel.org header.s=k20201202 header.b=pgxa5ioP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237417AbhJLPcE (ORCPT + 99 others); Tue, 12 Oct 2021 11:32:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:54548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237355AbhJLPcD (ORCPT ); Tue, 12 Oct 2021 11:32:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C843160F3A; Tue, 12 Oct 2021 15:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634052601; bh=JpF6An/Riv/dMcUkrhm8JSEkFKJMUWfWjMUX6PwjxwE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=pgxa5ioPEQcnUN4WhfnouRG3+p0X4c1Fi/dcxyxpGiHcKIBi06OUe7KEFSmwQnEj4 9CKnSJy3J9R8HsExGL6hXZYoLmQ+sxuj4KL+EPjfyAuG3d13IiqBOrlo2oRzAIULso 7eZcbjqZAQHghUA65lYc4vOS4QvnxbPN9TqnzCdpZ2F78zYQZ3vA1KBEw6oEPOiXlj BirBxvEBgeoRDGprFFcSgTdznJV5JOklg4yzuG54yHVd4/JPB5YLqe4vUo/oXTu9MU 2SX9eh/7lEHihPPkibIqfDcSq1xls9O6cJkqA/IH7wtdWXeMiD5WDE+PFMWDpceM8l 8yCsauCyBBbfA== Message-ID: <31619f2f192a4f1584e458f468422cf6e8f7542f.camel@kernel.org> Subject: Re: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent() From: Jarkko Sakkinen To: Cai Huoqing Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Peter Huewe , Jason Gunthorpe , linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 12 Oct 2021 18:29:58 +0300 In-Reply-To: <20211010160147.590-1-caihuoqing@baidu.com> References: <20211010160147.590-1-caihuoqing@baidu.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >=20 > Signed-off-by: Cai Huoqing If this does not do functionally anything useful, there's no reason to apply this. It is also missing information why the substitution is possible. Field tested code is better than clean code, i.e. we don not risk at having possible new regressions just for a bit nicer layout... /Jarkko