From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1B7EC4332F for ; Tue, 12 Dec 2023 19:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kD4YjkzlMRAX1lomRAund85XbKEJB/optt0TvW9iW+E=; b=fpt+c/jgJhG6AH b/Zq//DNGZrJp06P24ptS0+HdcRM9VtJuIAUfyMCZq8jnWOhtotIZjAUO28tpDUPSCpDN8ochWsk/ OJoJ+vwx44JOEZk0ZXEHxDnlSwuoe5UgoPSn2IZ3Ez/l8lqMej/RwjCeepywi+KuPs+abfSijNZU2 gFDjS1H4t1yM6xM0h72Qt4Y/0lrFZvHIuQUPNK46J/m4oVX24FVw+gdFREhE2C90yIi7PoGqG92ts VDVzAGlXzlnPCJHTHSY8eG4OwSRWML96siCBw83YuuleaI7La1cyLyL5YtR5O0JDY9FhxGH7ooaJj BvBiWyKJdC0cfbV0G3Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rD8le-00Cdty-1g; Tue, 12 Dec 2023 19:50:10 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rD8la-00Cdtf-1t for linux-arm-kernel@lists.infradead.org; Tue, 12 Dec 2023 19:50:08 +0000 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6d7fa93afe9so4441741a34.2 for ; Tue, 12 Dec 2023 11:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702410605; x=1703015405; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=+WmuBvNsZRD+aUZxutpdK+Wc4at557PwkYqBm9ImnNo=; b=cGeBQ2sPSlajMHVreAlVjz6FRuVmoYT0qJTvr6Ax0+HAvfLC7C8Iwky4eiM1MxUMGZ i1/5OKZ93z3wwHoMeuaaCMqAtU6hIAcHd66MuByCfYB6OdO8h/Yvb/8/lyFPDRCVNWO3 3gE0JEtuiNX5teyOTxmr/Iff/sLco0NWZMet7zU5nrNSxaP+X1U+2MXIykcM11pBVmFb 4SuXAT7pvfIUOu+6q8jk1ouulFSMnRjeuX5C4PQU76P2hGoAAA7NAXcKwJZ+MHjjCGTl Wzjassp23UCmN7yuVPtv0VWXJPPbCGdMXV9cmAAgp6CUZJffZnPon8fy6AyaohNPzRPO WiLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702410605; x=1703015405; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+WmuBvNsZRD+aUZxutpdK+Wc4at557PwkYqBm9ImnNo=; b=wOI+z2quzG1jl+aDRD/683v9214eXOMJUB/B3Sk67b5YMAKxhfR9vo3gLaRkL0sV9z uk1B2S0JMxJyfs2a8Z33/Os5GBue+NMKU/5AQKnnUdU9nad9pltpHlk7I9EhxvyKtFAw o6/Rk4KXo3BbUpajLoRD5NSAB8x4K8wS4Nn+DkZ60kVI8XDgcv3Ddwp6UoY+a9A6tm8W rvhAa0LLMBHf5/EfuM7H71L++/h9FIyKMfft6NTI6l90bXcxv6ifCmB6OnKE5VOv7a3N 61QFCoeldLe6aBKRRPe3jJ7leDGchd02/0pvAhCMNLEqZg+rrphGUbA+pe6FSfrSEJG2 xXsQ== X-Gm-Message-State: AOJu0YyBlQzyMys533WQpBl4+HmMA37UYeHzxqy85903NsmWjAHGEZLj AlqSsX1OdcDgSvbPHpbFw8s= X-Google-Smtp-Source: AGHT+IHxvw0Vut2QyDJrUC2ZE3myAntSoCtrfAiJtnB2NbnqgyxdEdjc1V2fTJZEufc66yWs6pg4mw== X-Received: by 2002:a9d:6841:0:b0:6d9:f69a:392c with SMTP id c1-20020a9d6841000000b006d9f69a392cmr5894594oto.31.1702410605018; Tue, 12 Dec 2023 11:50:05 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m19-20020a0568301e7300b006b9cc67386fsm2367658otr.66.2023.12.12.11.50.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Dec 2023 11:50:03 -0800 (PST) Message-ID: <2946fbb1-2a47-4d21-83dc-8e45bf6ba5a9@roeck-us.net> Date: Tue, 12 Dec 2023 11:50:00 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 7/8] tpm: tis-i2c: Add more compatible strings Content-Language: en-US To: Conor Dooley Cc: Ninad Palsule , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, joel@jms.id.au, andrew@codeconstruct.com.au, peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca, keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, johannes.holland@infineon.com, broonie@kernel.org, patrick.rudolph@9elements.com, vincent@vtremblay.dev, peteryin.openbmc@gmail.com, lakshmiy@us.ibm.com, bhelgaas@google.com, naresh.solanki@9elements.com, alexander.stein@ew.tq-group.com, festevam@denx.de, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-hardening@vger.kernel.org, geissonator@yahoo.com References: <20231212164004.1683589-1-ninad@linux.ibm.com> <20231212164004.1683589-8-ninad@linux.ibm.com> <20231212-avid-grill-dbead068fac8@spud> <73381bb0-7fa7-4a9e-88df-ab0063058e26@roeck-us.net> <20231212-mouth-choice-40a83caa34ec@spud> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJ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Oo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20231212-mouth-choice-40a83caa34ec@spud> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_115006_651587_AAF5A5E2 X-CRM114-Status: GOOD ( 27.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/12/23 10:51, Conor Dooley wrote: > On Tue, Dec 12, 2023 at 10:00:39AM -0800, Guenter Roeck wrote: >> On Tue, Dec 12, 2023 at 05:15:51PM +0000, Conor Dooley wrote: >>> On Tue, Dec 12, 2023 at 10:40:03AM -0600, Ninad Palsule wrote: >>>> From: Joel Stanley >>>> >>>> The NPCT75x TPM is TIS compatible. It has an I2C and SPI interface. >>>> >>>> https://www.nuvoton.com/products/cloud-computing/security/trusted-platform-module-tpm/ >>>> >>>> Add a compatible string for it, and the generic compatible. >>>> >>>> OpenBMC-Staging-Count: 3 >>> >>> Delete this from every patch that it appears from. >>> >>>> Signed-off-by: Joel Stanley >>>> Acked-by: Jarkko Sakkinen >>>> Link: https://lore.kernel.org/r/20220928043957.2636877-4-joel@jms.id.au >>>> Signed-off-by: Ninad Palsule >>>> --- >>>> drivers/char/tpm/tpm_tis_i2c.c | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/drivers/char/tpm/tpm_tis_i2c.c b/drivers/char/tpm/tpm_tis_i2c.c >>>> index a897402cc36a..9511c0d50185 100644 >>>> --- a/drivers/char/tpm/tpm_tis_i2c.c >>>> +++ b/drivers/char/tpm/tpm_tis_i2c.c >>>> @@ -383,6 +383,8 @@ MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_id); >>>> #ifdef CONFIG_OF >>>> static const struct of_device_id of_tis_i2c_match[] = { >>>> { .compatible = "infineon,slb9673", }, >>>> + { .compatible = "nuvoton,npct75x", }, >>>> + { .compatible = "tcg,tpm-tis-i2c", }, >>> >>> What's the point of the generic compatible if you are adding the device >>> specific ones to the driver anyway? >>> >> >> $ git grep infineon,slb9673 >> Documentation/devicetree/bindings/trivial-devices.yaml: - infineon,slb9673 > > Hmm, this would then need to be moved into the new schema, out of > trivial devices. > >> drivers/char/tpm/tpm_tis_i2c.c: { .compatible = "infineon,slb9673", }, >> $ git grep nuvoton,npct75x >> arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-bonnell.dts: compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c"; >> arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-everest.dts: compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c"; >> $ git grep tcg,tpm-tis-i2c >> arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-bonnell.dts: compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c"; >> arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-everest.dts: compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c"; >> arch/arm/boot/dts/aspeed/aspeed-bmc-opp-tacoma.dts: compatible = "tcg,tpm-tis-i2c"; > > pog, undocumented compatibles. > Yes, I know, quite annoying. Though, to be fair, a generic "tcg,tpm-tis-i2c" would make a lot of sense. Note that Rob had rejected the original addition (into trivial devices) with the argument that it is not a trivial device (https://lore.kernel.org/lkml/20220605225610.GA3682221-robh@kernel.org/). >> It looks like at least the generic entry is needed, given that it is quite >> likely that there is hardware out there using it. Other than that, this >> makes me wonder: Is there some official guideline describing if and when >> to use (only) generic devicetree compatible entries and when specific ones >> may / should / have to be used ? I suspect the answer to your question might >> simply be "because we did not know better", and it might be helpful to be >> able to say "please see XXX for details". > > To me using generic compatibles is okay when there is another mechanism > to identify the device. This patch would make more sense if the addition > of nuvoton,npct75x was omitted and the dt-binding had > > properties: > compatible: > items: > - enum: > - infineon,slb9673 > - nuvoton,npct75x > - const: tcg,tpm-tis-i2c > > And whenever new i2c tpms showed up the device specific compatible was > added to the bindings and the driver had only* the generic compatible > static const struct of_device_id of_tis_i2c_match[] = { > { .compatible = "infineon,slb9673", }, > { .compatible = "tcg,tpm-tis-i2c", }, > }; > > * well, and the existing one since that cannot be removed. That would be perfectly fine with me. All I personally care about is to get "tcg,tpm-tis-i2c" added to the kernel source so I can start testing the code in qemu. Thanks, Guenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel