From d5166a49508df7a60a1c437b7a33cd688f478055 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 15 Jan 2024 11:24:47 -0800 Subject: tpm/tpm_ftpm_tee: fix all kernel-doc warnings Change @pdev to @dev in 2 places to match the function parameters. Correct one function name in kernel-doc comment to match the function implementation. This prevents these warnings: tpm_ftpm_tee.c:217: warning: Function parameter or struct member 'dev' not described in 'ftpm_tee_probe' tpm_ftpm_tee.c:217: warning: Excess function parameter 'pdev' description in 'ftpm_tee_probe' tpm_ftpm_tee.c:313: warning: Function parameter or struct member 'dev' not described in 'ftpm_tee_remove' tpm_ftpm_tee.c:313: warning: Excess function parameter 'pdev' description in 'ftpm_tee_remove' tpm_ftpm_tee.c:348: warning: expecting prototype for ftpm_tee_shutdown(). Prototype was for ftpm_plat_tee_shutdown() instead Signed-off-by: Randy Dunlap Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_ftpm_tee.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/char/tpm') diff --git a/drivers/char/tpm/tpm_ftpm_tee.c b/drivers/char/tpm/tpm_ftpm_tee.c index 76adb108076c..2ea4882251cf 100644 --- a/drivers/char/tpm/tpm_ftpm_tee.c +++ b/drivers/char/tpm/tpm_ftpm_tee.c @@ -208,7 +208,7 @@ static int ftpm_tee_match(struct tee_ioctl_version_data *ver, const void *data) /** * ftpm_tee_probe() - initialize the fTPM - * @pdev: the platform_device description. + * @dev: the device description. * * Return: * On success, 0. On failure, -errno. @@ -304,7 +304,7 @@ static int ftpm_plat_tee_probe(struct platform_device *pdev) /** * ftpm_tee_remove() - remove the TPM device - * @pdev: the platform_device description. + * @dev: the device description. * * Return: * 0 always. @@ -341,7 +341,7 @@ static void ftpm_plat_tee_remove(struct platform_device *pdev) } /** - * ftpm_tee_shutdown() - shutdown the TPM device + * ftpm_plat_tee_shutdown() - shutdown the TPM device * @pdev: the platform_device description. */ static void ftpm_plat_tee_shutdown(struct platform_device *pdev) -- cgit v1.2.3 From b7ab4bbd0188f3985b821fa09456b11105a8dedf Mon Sep 17 00:00:00 2001 From: Lino Sanfilippo Date: Thu, 1 Feb 2024 12:36:45 +0100 Subject: tpm,tpm_tis: Avoid warning splat at shutdown If interrupts are not activated the work struct 'free_irq_work' is not initialized. This results in a warning splat at module shutdown. Fix this by always initializing the work regardless of whether interrupts are activated or not. cc: stable@vger.kernel.org Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs") Reported-by: Jarkko Sakkinen Closes: https://lore.kernel.org/all/CX32RFOMJUQ0.3R4YCL9MDCB96@kernel.org/ Signed-off-by: Lino Sanfilippo Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/char/tpm') diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 1b350412d8a6..64c875657687 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -919,8 +919,6 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int rc; u32 int_status; - INIT_WORK(&priv->free_irq_work, tpm_tis_free_irq_func); - rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL, tis_int_handler, IRQF_ONESHOT | flags, dev_name(&chip->dev), chip); @@ -1132,6 +1130,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, priv->phy_ops = phy_ops; priv->locality_count = 0; mutex_init(&priv->locality_count_mutex); + INIT_WORK(&priv->free_irq_work, tpm_tis_free_irq_func); dev_set_drvdata(&chip->dev, priv); -- cgit v1.2.3 From 3c45308c44eda6cc3343a48341a82b96753c8a13 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 13 Jan 2024 18:10:52 +0100 Subject: tpm_tis_spi: Add compatible string atmel,attpm20p Commit 4f2a348aa365 ("arm64: dts: imx8mm-venice-gw73xx: add TPM device") added a devicetree node for the Trusted Platform Module on certain Gateworks boards. The commit only used the generic "tcg,tpm_tis-spi" compatible string, but public documentation shows that the chip is an ATTPM20P from Atmel (nowadays Microchip): https://trac.gateworks.com/wiki/tpm Add the chip to the supported compatible strings of the TPM TIS SPI driver. For reference, a datasheet is available at: https://ww1.microchip.com/downloads/en/DeviceDoc/ATTPM20P-Trusted-Platform-Module-TPM-2.0-SPI-Interface-Summary-Data-Sheet-DS40002082A.pdf Signed-off-by: Lukas Wunner Reviewed-by: Jarkko Sakkinen Cc: Tim Harvey Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_spi_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char/tpm') diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c index c5c3197ee29f..7d376a642807 100644 --- a/drivers/char/tpm/tpm_tis_spi_main.c +++ b/drivers/char/tpm/tpm_tis_spi_main.c @@ -327,6 +327,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = { MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id); static const struct of_device_id of_tis_spi_match[] __maybe_unused = { + { .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe }, { .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe }, { .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe }, { .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe }, -- cgit v1.2.3 From 68bf59c3dc744c2123ad7194fbe42efa2fb36873 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 13 Jan 2024 18:10:53 +0100 Subject: tpm_tis: Add compatible string atmel,at97sc3204 Commit 420d439849ca ("tpm_tis: Allow tpm_tis to be bound using DT") added the fallback compatible "tcg,tpm-tis-mmio" to the TPM TIS driver, but not the chip-specific "atmel,at97sc3204". However it did document it as a valid compatible string. Add it to tis_of_platform_match[] for consistency. Signed-off-by: Lukas Wunner Cc: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char/tpm') diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 2c52b7905b07..14652aaf8254 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -347,6 +347,7 @@ static void tpm_tis_plat_remove(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id tis_of_platform_match[] = { + {.compatible = "atmel,at97sc3204"}, {.compatible = "tcg,tpm-tis-mmio"}, {}, }; -- cgit v1.2.3 From 6fa6b796e037a15b1c208b1158f801f9adcb1f2b Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 13 Jan 2024 18:10:54 +0100 Subject: tpm: tis_i2c: Add compatible string nuvoton,npct75x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add "nuvoton,npct75x" as well as the fallback compatible string "tcg,tpm-tis-i2c" to the TPM TIS I²C driver. They're used by: arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-bonnell.dts arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-everest.dts And by all accounts, NPCT75x is supported by the driver: https://lore.kernel.org/all/60e23fd0f0ff4d1f8954034237ae8865@NTILML02.nuvoton.com/ https://lore.kernel.org/all/20220808220839.1006341-8-peter@pjd.dev/ Signed-off-by: Lukas Wunner Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_i2c.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/char/tpm') 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", }, {} }; MODULE_DEVICE_TABLE(of, of_tis_i2c_match); -- cgit v1.2.3