Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4815194rdb; Tue, 12 Dec 2023 10:01:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG91IbbJM1N0toHjqGjMjraKa2EXPMw2H0tN7BavkCXblYEWvHaBihjwAYvefm4eEb2SrxV X-Received: by 2002:a17:902:c407:b0:1cf:d19e:fae with SMTP id k7-20020a170902c40700b001cfd19e0faemr11025112plk.34.1702404081352; Tue, 12 Dec 2023 10:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702404081; cv=none; d=google.com; s=arc-20160816; b=SGrqUyLJ3brQveboQUABOT5joYLaHE8lReUYbK0RJ+7nhT3qAPjxNK19ApM9+iQMPC ajgzq9TgP8w2qswOwIOeMOJCASli6g5ORbBdKkfvVe2J2eC3/noTeFl1ITjgqheWvxF3 b5141jsEh2J1id2zZnNhNpj5bbA5k115WBytBkbEKQV9WvrwMW5IpvAKPiV1osaUUoN+ CzEmgknx1bD+bf3IwOcyBeMfTPyMtRT4dJv4AAWcTLPI2yzyaO+yIn+SJXjeTLvriAAg i0glzhe5dDO90Bl9zbZodWe2/a2LbSl/MF+xoPZxOScjERwBTFLYPXaN22ox4Q/exqVE mI3A== 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:sender:dkim-signature; bh=OCcCZYfwecxquLlX9Qk4H1uh3FlXglU8cLcEqk1Tg0c=; fh=F4dNJi6WkiY2Fl+TGXAXfvHwc4/zZEIarYo2E2G8+VA=; b=Bj2xfCqlxHG+SIjTr2KkByYunNdywAxb815aQ6nby9JtUw1gpMBw2bTOwRzMMtfaxr kBg7xzEMnJ67A1/Xbf//gSMrieAqHNN0ZxDu8ZdhA0H1yaYvdsNP8aL1Ta7bGaoaO77F Hc38ss8r5eoC9tC7CkJ6XEHEXRBfdTo+3oxZNHzh/57lfN50/uiIGHqRVaVHDQTsDjO/ ZB3BV7J2Q7lpagq2i/0eN4wsxt1rXZy3PEcm1RnbhgDJ7VgW1i+6rU2+JAoMwSMKVwA8 lcui6DKjUW6Pbbb1ZkkP9SNVRxVXhTWHT6Cb1wZPH4gd4pj48dvn8sS6yUTc9DN6fJor 0e7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ku12+XF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e21-20020a170902d39500b001d1ce4cc5b4si7199082pld.50.2023.12.12.10.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ku12+XF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D96128096DAD; Tue, 12 Dec 2023 10:01:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377067AbjLLSAh (ORCPT + 99 others); Tue, 12 Dec 2023 13:00:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377057AbjLLSAg (ORCPT ); Tue, 12 Dec 2023 13:00:36 -0500 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47657AD; Tue, 12 Dec 2023 10:00:42 -0800 (PST) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6d9d29a2332so2796043a34.0; 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=vger.kernel.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=ku12+XF9PILNcNWeB8voRm/7luTldInfD7zImBHinj373nb9vPjiAIjKPUzOQsuOsL jV6prRSa06hGWPmSd7jNVh3HUrbuZQGOECyYTXpPc2WIVFdIPS4oDDenu83acsSTfHIw 31cP/fhR+FVBocPdHo0bGMkZvsS12OcbixQWXLBK4oxRV81K4NbKuvvo2ZHmkH3gRuJX XiLX4R5hlmfauJx3ZTv6JzVdPJoKS33uXvBfAtZxRFF6YdIgP2eZC0trIqtNC6GJrYg2 cC7889pOr6ccb1O/BaIwgu5Hn234GHZHiWtMSyYZCaCYqvlfPVB9Wfd5RbnuzlFxxXpe nqpg== 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=PzottFw2sTiLyzesb6rOqmAkaOOojrQYl0Y7Ft1Moo7/F+b+SpVui2hquTF/7X9F41 jW4z/8f5x+3GSitPn+jI0PjtO1hiBNOmShini1uuuqXylLmG97Q7bsyg8Kx2vVjmuQs5 qSvkmxJFCpoSZ4XREdqskxtdJFuS64Tuv808+2jcb1VBRz3GKcSs41gNOkcTO4STxxa7 VLVJw5Pr2wBNOOXfeZPdNuACz/VvpLsmjFHFHCkqzjywBrX4EHem6FjbsZGljZu7iHeO zfxBkCNAzJR6Moz1YqKLUV2mkPkPfp0GDZlQRT+/E2TDb7+dkdm8dSprbWRAnBAC0geE f7Lw== X-Gm-Message-State: AOJu0YxqlNpYTk8FxVhCUvyLT7e1pPpO0e633Ts1j9Od12cfMVzL/x5W i1QZaWFd8itcC+prjChsfWc= 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) Sender: Guenter Roeck 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212-avid-grill-dbead068fac8@spud> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:01:13 -0800 (PST) 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