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 95FA8C4332F for ; Tue, 12 Dec 2023 18:01:16 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zALoumacn9e6y8ZqjWQYVXKxZ7+bgVmP2IfjsMnJp6Y=; b=tfCihwroJh0fxL 3IMPNkmYeiygfgnR4HaqVl9ctYltHLAkvy/UIdVhm3+FIKOfycsaTH+PVzQ9mZkiQdIuc+9SsX7Rb dkRIPCTxQ8hitEbwifgOJQfCmSJSfEFhOypvyMujHAo8yax9idZwuydvQnHjCgCU275VJSjs6ulTQ yj3Z8M5SzYesdUmAp2LMWHZKhu7/9kZA9OSty102b7CNuGcEou9xuRUvgWIkvt/KGTNhqBSYUZtvC lBoQsWQJk25ftGyCIxGoBmm9Wdm4M4Djl4rn8OdQjtWvvuPmYvS8pYOvdSGeGhxs1iIvntZBOweKR QROyX3DxaIIV1vfe8B3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rD73n-00CRy9-1w; Tue, 12 Dec 2023 18:00:47 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rD73k-00CRxe-2I for linux-arm-kernel@lists.infradead.org; Tue, 12 Dec 2023 18:00:46 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6d9da137748so2604471a34.1 for ; Tue, 12 Dec 2023 10:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702404041; x=1703008841; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=OCcCZYfwecxquLlX9Qk4H1uh3FlXglU8cLcEqk1Tg0c=; b=WQYi3d3e4EYO3pRjtWBmgnsZSLC66RzIrWcjQxuQCdbQ4CzNVv10ZdPL1DrqTaLes1 9QjwpFvhjsRySDpb+nVJ2fUtIXnM55kaC6tyQfS1HIc2KRYWSxQisDND+FmVLzQN4tQn fYmoNBzgkIP55CR+qk0WZcy/mJA3RQmcloiCm8xTr1Wnane6HpsJLkkikHqTY8Qr9eRl Iltwj1Jxs82IquZ1C01Bp+ogBWKUIWomHyqJS0IAeTwAFIEjp9Kvc0SDc8NqRxVVogAx xYCNhVmcMfS/z0GvTT6fQTNkh06hUt68Ow3nxE2OkF4pbqtUP62311HDjqhrw+11Qw8K Qwiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702404041; x=1703008841; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OCcCZYfwecxquLlX9Qk4H1uh3FlXglU8cLcEqk1Tg0c=; b=p9XgioQXcOiIIjJv3xpXGlIlTg4FM9t6YqQDJhkJBOCtkyOf2ZTUoo8ppb8hk+piOE oTzXMSYw+sis2tGRTNGXRihJQpNrAVkZShfXw/JnVCmL6RZWne+tZ1jrUs5th2fK8uZL MkC/p34iz6eNAxKL1og4B0DkTwzP4fZ+VyXhlt1tXfGnW1DOHe8exImbfbRLfORxBjxG qke3n2Ec9envFLGNTvPg7NoTtAmUnENyqU14YN/Gfp18ziCR4QkAKmOnt+AqCEDHTOaR EfBGjMEgxCyRi1xgiJ3ZxOqgmRJiPx6JmnP4hYhPpi1yEQbkyJC7HxUSPqrfReR/jLwI yHOA== X-Gm-Message-State: AOJu0YyEnXOnGF9KNBaQT9O9lQDSXMvyl9PvRfeelQrELoouXlE/UywE vZUnDO57vxxTu6L9Nx5SZ0s= X-Google-Smtp-Source: AGHT+IFkasojfWbcCsVLi+mdn01yWMQKc33PTZwYORTSQpbYEFfSP/VEH4VMucXy6fDJEiz7YllCGw== X-Received: by 2002:a05:6830:26ef:b0:6d9:d132:7ff with SMTP id m47-20020a05683026ef00b006d9d13207ffmr3413281otu.15.1702404041554; Tue, 12 Dec 2023 10:00:41 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e7-20020a056830200700b006d8811cbc3csm2331250otp.29.2023.12.12.10.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:00:41 -0800 (PST) Date: Tue, 12 Dec 2023 10:00:39 -0800 From: Guenter Roeck 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 Subject: Re: [PATCH v1 7/8] tpm: tis-i2c: Add more compatible strings Message-ID: <73381bb0-7fa7-4a9e-88df-ab0063058e26@roeck-us.net> References: <20231212164004.1683589-1-ninad@linux.ibm.com> <20231212164004.1683589-8-ninad@linux.ibm.com> <20231212-avid-grill-dbead068fac8@spud> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231212-avid-grill-dbead068fac8@spud> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_100044_747485_259F6AD7 X-CRM114-Status: GOOD ( 23.81 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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"; 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". Thanks, Guenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel