Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp304327imn; Thu, 28 Jul 2022 00:45:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sZaVqXtrq7J99/i58YFVETD/AzA712/CqCwekdG0nfnIkCZQEz3RwJto8QrBUMecfpjV4L X-Received: by 2002:a17:907:2714:b0:72b:7deb:95e7 with SMTP id w20-20020a170907271400b0072b7deb95e7mr19849293ejk.761.1658994330237; Thu, 28 Jul 2022 00:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658994330; cv=none; d=google.com; s=arc-20160816; b=ObmeqAibwK7622veyoajkEW5nUQ1bfU+NAE18cd0Xfta6mNxsVQtiOtu0pER5lcuVf 7mCesdHkjohy5CsGYcv+z4twivOkDQFflW3gfrCkMIruH0dsZFIwhjOTuklYZvTcR4dS E4GWP7ndpJ2FM5nlKlViZOIYjW0RCLfyVGs6U3U+gpxZTohK0A1CpAQlMHcJcjeZ179K pHqOt7oUa9fta40FPkjfRXR7/91AjCvoO8y/NUCsWDF0C46DqAO26k1CJbz75UCOAw// DFPjODQCEAYt5TZ39gOX2p1YmLF+MGK0o7j8Bz89i9KtiJE6U7uewGzq1d6byuIpmADE 8AYg== 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=lZCz0EKsB1e3/kY2K3V4tw+mB1BE86NqG1mqVmW4kmU=; b=f3ZQzDecgKBzmTBWtjiXRfZFG3U2D5uV4KMDQMfiAwGIglL2ntnsV1oSkD7YPtrCkR U2smfInVZeBkWuN0F0G5sQlDWw21936jjpbn0Vb0qPLgZOhgYU3L1qsp42AS/1Q/RFj5 oMyJdLSp9KWagj9t5eq8tKF4Pq/1MFcFpnT4byu4lYQmDDwEsGvcaEVeWtj+jgUlOj9q +sac7LLBqOxcq/rtkiL5F+Po/PprGDtrE8HQTYnPgv3s4f4ETasL6VTsu4L6hPojtbfY OoxiZA8SexzDMY0DHg7vuUQW2f7tkxU/Ws/XmnAPbn5NQZXGB7Qmg+CFtLLkWvqJUarM RYnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cv5PwUYC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a170906228a00b0072b4addd854si147796eja.292.2022.07.28.00.45.04; Thu, 28 Jul 2022 00:45:30 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cv5PwUYC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbiG1Hki (ORCPT + 99 others); Thu, 28 Jul 2022 03:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234230AbiG1Hkf (ORCPT ); Thu, 28 Jul 2022 03:40:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5753D4D83D; Thu, 28 Jul 2022 00:40:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D264AB82284; Thu, 28 Jul 2022 07:40:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B61C43470; Thu, 28 Jul 2022 07:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658994031; bh=p81wbSl4jQvNdxEQIWuCLFSph+3DQKM11CCOw6EGVc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cv5PwUYCCTni2XA0aQzBYgUcsAonaMU5j+FBsyqzk1VBGaUBwrzetTytavedUvCdv oSg/NaVW1sccm2S21QeVGOyR1WM91YMv4P9yxSS7MSeF543QvBSwiKkuZ6QY8IzHze IXXPphSIebXXWzKADTcb8tz4gH5C6DlKkfx8oIXcYjaqkXOXSKrD9X7bvIgAbeyAEH hLFbMjVVFD7ONHyHCMfWpdGYm0ln5egrWHzeuKff2JN3TpGNhKoI//vy5s3bHUeRcY cWWmFbwBBKWhGj2msQyHoMmDM4sJ7bKKc9vKPtOCRSCrdeyUhH+5/lKCptXnTGYayu ftYnFgLCqFFbg== Date: Thu, 28 Jul 2022 10:40:28 +0300 From: Jarkko Sakkinen To: Stefan Berger Cc: kexec@lists.infradead.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, nayna@linux.ibm.com, nasastry@in.ibm.com, mpe@ellerman.id.au, Jason Gunthorpe , Rob Herring , Frank Rowand Subject: Re: [PATCH v5 4/6] tpm: of: Make of-tree specific function commonly available Message-ID: References: <20220706152329.665636-1-stefanb@linux.ibm.com> <20220706152329.665636-5-stefanb@linux.ibm.com> <3a9196b3-c510-0c32-8b70-572d9c4fe69d@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a9196b3-c510-0c32-8b70-572d9c4fe69d@linux.ibm.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Fri, Jul 15, 2022 at 12:01:36PM -0400, Stefan Berger wrote: > > > On 7/10/22 23:04, Jarkko Sakkinen wrote: > > On Wed, Jul 06, 2022 at 11:23:27AM -0400, Stefan Berger wrote: > > > Simplify tpm_read_log_of() by moving reusable parts of the code into > > > an inline function that makes it commonly available so it can be > > > used also for kexec support. Call the new of_tpm_get_sml_parameters() > > > function from the TPM Open Firmware driver. > > > > > > Signed-off-by: Stefan Berger > > > Cc: Jarkko Sakkinen > > > Cc: Jason Gunthorpe > > > Cc: Rob Herring > > > Cc: Frank Rowand > > > > > > --- > > > v4: > > > - converted to inline function > > > --- > > > drivers/char/tpm/eventlog/of.c | 31 +++++-------------------------- > > > include/linux/tpm.h | 27 +++++++++++++++++++++++++++ > > > 2 files changed, 32 insertions(+), 26 deletions(-) > > > > > > diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c > > > index a9ce66d09a75..f9462d19632e 100644 > > > --- a/drivers/char/tpm/eventlog/of.c > > > +++ b/drivers/char/tpm/eventlog/of.c > > > @@ -12,6 +12,7 @@ > > > #include > > > #include > > > +#include > > > #include > > > #include "../tpm.h" > > > @@ -20,11 +21,10 @@ > > > int tpm_read_log_of(struct tpm_chip *chip) > > > { > > > struct device_node *np; > > > - const u32 *sizep; > > > - const u64 *basep; > > > struct tpm_bios_log *log; > > > u32 size; > > > u64 base; > > > + int ret; > > > log = &chip->log; > > > if (chip->dev.parent && chip->dev.parent->of_node) > > > @@ -35,30 +35,9 @@ int tpm_read_log_of(struct tpm_chip *chip) > > > if (of_property_read_bool(np, "powered-while-suspended")) > > > chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED; > > > - sizep = of_get_property(np, "linux,sml-size", NULL); > > > - basep = of_get_property(np, "linux,sml-base", NULL); > > > - if (sizep == NULL && basep == NULL) > > > - return -ENODEV; > > > - if (sizep == NULL || basep == NULL) > > > - return -EIO; > > > - > > > - /* > > > - * For both vtpm/tpm, firmware has log addr and log size in big > > > - * endian format. But in case of vtpm, there is a method called > > > - * sml-handover which is run during kernel init even before > > > - * device tree is setup. This sml-handover function takes care > > > - * of endianness and writes to sml-base and sml-size in little > > > - * endian format. For this reason, vtpm doesn't need conversion > > > - * but physical tpm needs the conversion. > > > - */ > > > Jarkko, > > can I apply your R-b tag after putting this lost comment back into the > inline function? > Stefan If there's a change I want to see the updated patch first. BR, Jarkko