public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Ninad Palsule <ninad@linux.ibm.com>,
	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
Date: Tue, 12 Dec 2023 18:51:32 +0000	[thread overview]
Message-ID: <20231212-mouth-choice-40a83caa34ec@spud> (raw)
In-Reply-To: <73381bb0-7fa7-4a9e-88df-ab0063058e26@roeck-us.net>


[-- Attachment #1.1: Type: text/plain, Size: 3766 bytes --]

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 <joel@jms.id.au>
> > > 
> > > 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 <joel@jms.id.au>
> > > Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
> > > Link: https://lore.kernel.org/r/20220928043957.2636877-4-joel@jms.id.au
> > > Signed-off-by: Ninad Palsule <ninad@linux.ibm.com>
> > > ---
> > >  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.

> 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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-12-12 18:52 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 16:39 [PATCH v1 0/8] Add device tree for IBM system1 BMC Ninad Palsule
2023-12-12 16:39 ` [PATCH v1 1/8] dt-bindings: arm: aspeed: add IBM system1-bmc Ninad Palsule
2023-12-12 17:09   ` Conor Dooley
2023-12-12 20:06     ` Ninad Palsule
2023-12-13 18:18   ` Jarkko Sakkinen
2023-12-13 18:36     ` Ninad Palsule
2023-12-12 16:39 ` [PATCH v1 2/8] dt-bindings: tpm: Add schema for TIS I2C devices Ninad Palsule
2023-12-12 17:14   ` Conor Dooley
2023-12-12 18:20     ` Guenter Roeck
2023-12-14 15:37       ` Ninad Palsule
2023-12-14 15:34     ` Ninad Palsule
2023-12-14 16:35       ` Conor Dooley
2023-12-14 20:13         ` Rob Herring
2023-12-13 16:13   ` Rob Herring
2023-12-14 22:23     ` Ninad Palsule
2024-01-08 19:44     ` Ninad Palsule
2023-12-13 18:20   ` Jarkko Sakkinen
2023-12-13 18:38     ` Ninad Palsule
2023-12-12 16:39 ` [PATCH v1 3/8] ARM: dts: aspeed: System1: IBM system1 BMC board Ninad Palsule
2023-12-12 20:20   ` Krzysztof Kozlowski
2023-12-14 15:06     ` Ninad Palsule
2023-12-12 16:40 ` [PATCH v1 4/8] ARM: dts: aspeed: System1: Add i2c and muxes Ninad Palsule
2023-12-12 20:21   ` Krzysztof Kozlowski
2023-12-14 18:34     ` Ninad Palsule
2023-12-15  7:35       ` Krzysztof Kozlowski
2023-12-12 16:40 ` [PATCH v1 5/8] ARM: dts: aspeed: System1: Voltage regulators Ninad Palsule
2023-12-12 20:22   ` Krzysztof Kozlowski
2023-12-14 16:30     ` Ninad Palsule
2023-12-12 16:40 ` [PATCH v1 6/8] ARM: dts: aspeed: System1: GPIO, Fan ctrl, Led Ninad Palsule
2023-12-12 20:25   ` Krzysztof Kozlowski
2024-01-08 19:56     ` Ninad Palsule
2023-12-12 16:40 ` [PATCH v1 7/8] tpm: tis-i2c: Add more compatible strings Ninad Palsule
2023-12-12 17:15   ` Conor Dooley
2023-12-12 18:00     ` Guenter Roeck
2023-12-12 18:51       ` Conor Dooley [this message]
2023-12-12 19:50         ` Guenter Roeck
2024-01-08 20:05           ` Ninad Palsule
2024-01-09 17:14             ` Conor Dooley
2024-01-09 23:55               ` Ninad Palsule
2024-01-09 23:55               ` Ninad Palsule
2024-01-10  7:50                 ` Krzysztof Kozlowski
2024-01-10 14:31                   ` Ninad Palsule
2024-01-10 15:37                     ` Krzysztof Kozlowski
2024-01-10 15:54                       ` Ninad Palsule
2024-01-10 16:23                         ` Conor Dooley
2024-01-10 17:54                         ` Krzysztof Kozlowski
2024-01-10 19:06                           ` Guenter Roeck
2024-01-10 20:34                             ` Krzysztof Kozlowski
2024-01-10 20:36                               ` Krzysztof Kozlowski
2024-01-10 21:41                               ` Guenter Roeck
2024-01-08 20:04     ` Ninad Palsule
2023-12-12 16:40 ` [PATCH v1 8/8] ARM: dts: aspeed: System1: PS, sensor and more Ninad Palsule
2023-12-12 20:26   ` Krzysztof Kozlowski
2023-12-13 19:02     ` Ninad Palsule
2023-12-13 19:37       ` Krzysztof Kozlowski
2023-12-13 19:49         ` Ninad Palsule
2023-12-14  7:24           ` Krzysztof Kozlowski
2023-12-14 14:24             ` Ninad Palsule
2023-12-14 15:04     ` Ninad Palsule

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231212-mouth-choice-40a83caa34ec@spud \
    --to=conor@kernel.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=bhelgaas@google.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@denx.de \
    --cc=geissonator@yahoo.com \
    --cc=gpiccoli@igalia.com \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=joel@jms.id.au \
    --cc=johannes.holland@infineon.com \
    --cc=keescook@chromium.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lakshmiy@us.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=naresh.solanki@9elements.com \
    --cc=ninad@linux.ibm.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=peterhuewe@gmx.de \
    --cc=peteryin.openbmc@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=vincent@vtremblay.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox