Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1508721pxb; Thu, 14 Apr 2022 07:41:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl414WcBd/2WNO2sloMrJ6/iqfHBpvxjGdkMF4+TSgBdHRcLA2ZVEr6BsCnnI2DNd0WZEG X-Received: by 2002:a17:90b:38d1:b0:1c9:ba10:353b with SMTP id nn17-20020a17090b38d100b001c9ba10353bmr4635735pjb.9.1649947267569; Thu, 14 Apr 2022 07:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649947267; cv=none; d=google.com; s=arc-20160816; b=CluUotQ2xAILTT12+XIkyDJl7Mwn7EiOkBu/Pp3DdFUXkYZwI6akOCiYQJlVSt9Md/ gXPU5UcevB8HW6psRYpj05rreOP/LjZOB5HRxKYMB9fJDercrXqWBDMyVyiMxE4JX5pN zvM3ZbXF9yyyKkLlNo1zmxxtCy97YJ0YstB35LZhEa1ieN+NfVc8EyAd0gV/lOfya3Gt 5uER8FoZNbGes6I1ZdWlmdxCu27cYniFsnY5eDrL4dG9pg+ImOmqPCil/IP6CPdVpNdt JfHL5IU5i7tgninDh0BoCTqtxnJ4IH27NqqnR9ZI4U5WWEx2ZOmz+RawyViy5tj8+4p0 a/xQ== 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=nlGs/JdrJi7iXdWlJlrFiU7cWQshfR9HBzQwE/tSQjg=; b=KJ/CQ1YCyK4H7aaLFmEEAsYtZrk445O16kpf3IaKHC24h2fxTEoLMCBkHeOrS3Ipdl Zm1cQbQ0V1A2IF1kVjuiTzs3atGVyCi+mXPBfalBO4k3U5/48h1Gn9rk1/SQk0PwrIoi EItDnTqpP6YzFgw1rBfCrWKp7gckU/1TmDqKtSLEBr+OBVTldozbkjfLC94U/y/W1n/c mr5f24qiXmm/BydKqbbiIRuLPYsqL1zY7qF6Al3D5SW6vkOsj0Z0LuO8lY1UhU1jTHFR zeD2xGeOclExmaWPAIcGfAaE4ztp+vJf8tvZ15nq07nJrwgRsVaJFBfeqLXic+MkMnm6 wMIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e+MdVUz+; 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 f7-20020a056a00238700b0050603f643b9si140572pfc.103.2022.04.14.07.40.50; Thu, 14 Apr 2022 07:41:07 -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=e+MdVUz+; 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 S238219AbiDNMJq (ORCPT + 99 others); Thu, 14 Apr 2022 08:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234127AbiDNMJo (ORCPT ); Thu, 14 Apr 2022 08:09:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C871DA7A; Thu, 14 Apr 2022 05:07:20 -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 0A2DCB82893; Thu, 14 Apr 2022 12:07:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BBF2C385A5; Thu, 14 Apr 2022 12:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649938037; bh=fD5H+AHlNuloFWN8eOvS2D969xXSqjhbt85Vypx3ujg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e+MdVUz+OFOQpreLTstwipHSAoZgG5U2C89UHMsVtw/8GXzdnzHLO4vAwjT7ImEIF Nv3J6qN0putDd3iOOV6mSRi8UKURRtt/rBOAMvUtx7IT5NAptWFxjMd1FSbOZK1Iip 6YrrFCzonD0Szi67lKV9QnPpnjdeZrVUWWo7kPJxr8no+lYXuzo2SZYJZSPgi0cnq4 hlmUC7dvcCcw3k+MzBOjSCin/BKVxRE/gGNuNxdRiqgY8B28eX3iZkfm2/JWBkeO70 K4ViF82voXJLiMgrv/hR5jsnIkEq8PaTACdJSsgVa/IXoERNGz/d55mEsNb+KDOQJq Dgg2bKb2Zgynw== Date: Thu, 14 Apr 2022 15:06:09 +0300 From: Jarkko Sakkinen To: "Jes B. Klinke" Cc: linux-integrity@vger.kernel.org, Paul Menzel , Jason Gunthorpe , Peter Huewe , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: cr50: Add new device/vendor ID 0x504a6666 Message-ID: References: <20220405173741.4023216-1-jbk@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405173741.4023216-1-jbk@chromium.org> X-Spam-Status: No, score=-7.1 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,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 Tue, Apr 05, 2022 at 10:37:41AM -0700, Jes B. Klinke wrote: > Accept one additional numerical value of DID:VID for next generation > Google TPM, to be used in future Chromebooks. > > This patch touches more lines than may seem necessary, as a result of > the need to move the error case to sit after the two recognized cases. > > Signed-off-by: Jes B. Klinke > --- > > drivers/char/tpm/tpm_tis_i2c_cr50.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c > index f6c0affbb4567..bf54ebd6724b0 100644 > --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c > +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c > @@ -31,6 +31,7 @@ > #define TPM_CR50_TIMEOUT_SHORT_MS 2 /* Short timeout during transactions */ > #define TPM_CR50_TIMEOUT_NOIRQ_MS 20 /* Timeout for TPM ready without IRQ */ > #define TPM_CR50_I2C_DID_VID 0x00281ae0L /* Device and vendor ID reg value */ > +#define TPM_TI50_I2C_DID_VID 0x504a6666L /* Device and vendor ID reg value */ > #define TPM_CR50_I2C_MAX_RETRIES 3 /* Max retries due to I2C errors */ > #define TPM_CR50_I2C_RETRY_DELAY_LO 55 /* Min usecs between retries on I2C */ > #define TPM_CR50_I2C_RETRY_DELAY_HI 65 /* Max usecs between retries on I2C */ > @@ -742,16 +743,20 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) > } > > vendor = le32_to_cpup((__le32 *)buf); > - if (vendor != TPM_CR50_I2C_DID_VID) { > - dev_err(dev, "Vendor ID did not match! ID was %08x\n", vendor); > - tpm_cr50_release_locality(chip, true); > - return -ENODEV; > + if (vendor == TPM_CR50_I2C_DID_VID) { > + dev_info(dev, "cr50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", > + client->addr, client->irq, vendor >> 16); > + return tpm_chip_register(chip); > + } > + if (vendor == TPM_TI50_I2C_DID_VID) { > + dev_info(dev, "ti50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", > + client->addr, client->irq, vendor >> 16); > + return tpm_chip_register(chip); > } > > - dev_info(dev, "cr50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", > - client->addr, client->irq, vendor >> 16); > - > - return tpm_chip_register(chip); > + dev_err(dev, "Vendor ID did not match! ID was %08x\n", vendor); > + tpm_cr50_release_locality(chip, true); > + return -ENODEV; > } > > /** > -- > 2.35.1.1094.g7c7d902a7c-goog > Reviewed-by: Jarkko Sakkinen BR, Jarkko