Skip to content

Commit 28ced76

Browse files
committed
Merge tag 'tpmdd-next-v5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
Pull tpm fixes from Jarkko Sakkinen: "Two critical tpm driver bug fixes" * tag 'tpmdd-next-v5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm: efi: Don't create binary_bios_measurements file for an empty log tpm_tis: Disable interrupts on ThinkPad T490s
2 parents 02a2aa3 + 8ffd778 commit 28ced76

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

drivers/char/tpm/eventlog/efi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ int tpm_read_log_efi(struct tpm_chip *chip)
4141
log_size = log_tbl->size;
4242
memunmap(log_tbl);
4343

44+
if (!log_size) {
45+
pr_warn("UEFI TPM log area empty\n");
46+
return -EIO;
47+
}
48+
4449
log_tbl = memremap(efi.tpm_log, sizeof(*log_tbl) + log_size,
4550
MEMREMAP_WB);
4651
if (!log_tbl) {

drivers/char/tpm/tpm_tis.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/of.h>
2828
#include <linux/of_device.h>
2929
#include <linux/kernel.h>
30+
#include <linux/dmi.h>
3031
#include "tpm.h"
3132
#include "tpm_tis_core.h"
3233

@@ -49,8 +50,8 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da
4950
return container_of(data, struct tpm_tis_tcg_phy, priv);
5051
}
5152

52-
static bool interrupts = true;
53-
module_param(interrupts, bool, 0444);
53+
static int interrupts = -1;
54+
module_param(interrupts, int, 0444);
5455
MODULE_PARM_DESC(interrupts, "Enable interrupts");
5556

5657
static bool itpm;
@@ -63,6 +64,28 @@ module_param(force, bool, 0444);
6364
MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
6465
#endif
6566

67+
static int tpm_tis_disable_irq(const struct dmi_system_id *d)
68+
{
69+
if (interrupts == -1) {
70+
pr_notice("tpm_tis: %s detected: disabling interrupts.\n", d->ident);
71+
interrupts = 0;
72+
}
73+
74+
return 0;
75+
}
76+
77+
static const struct dmi_system_id tpm_tis_dmi_table[] = {
78+
{
79+
.callback = tpm_tis_disable_irq,
80+
.ident = "ThinkPad T490s",
81+
.matches = {
82+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
83+
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T490s"),
84+
},
85+
},
86+
{}
87+
};
88+
6689
#if defined(CONFIG_PNP) && defined(CONFIG_ACPI)
6790
static int has_hid(struct acpi_device *dev, const char *hid)
6891
{
@@ -192,6 +215,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info)
192215
int irq = -1;
193216
int rc;
194217

218+
dmi_check_system(tpm_tis_dmi_table);
219+
195220
rc = check_acpi_tpm2(dev);
196221
if (rc)
197222
return rc;

0 commit comments

Comments
 (0)