Skip to content

Commit b154ce1

Browse files
snitsjarkkojs
authored andcommitted
tpm_tis: Disable interrupts on ThinkPad T490s
There is a misconfiguration in the bios of the gpio pin used for the interrupt in the T490s. When interrupts are enabled in the tpm_tis driver code this results in an interrupt storm. This was initially reported when we attempted to enable the interrupt code in the tpm_tis driver, which previously wasn't setting a flag to enable it. Due to the reports of the interrupt storm that code was reverted and we went back to polling instead of using interrupts. Now that we know the T490s problem is a firmware issue, add code to check if the system is a T490s and disable interrupts if that is the case. This will allow us to enable interrupts for everyone else. If the user has a fixed bios they can force the enabling of interrupts with tpm_tis.interrupts=1 on the kernel command line. Cc: Peter Huewe <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Hans de Goede <[email protected]> Signed-off-by: Jerry Snitselaar <[email protected]> Reviewed-by: James Bottomley <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 521b619 commit b154ce1

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

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)