提交 f7595464 编写于 作者: R Rafael J. Wysocki

ACPI / TPM: Fix resume regression on Chromebooks

Chromebooks (at least Acer C720 and Pixel) implement an ACPI object
for TPM, but don't implement the _DSM method to support PPI.  As
a result, the TPM driver fails to load on those machines after
commit 1569a4c4 (ACPI / TPM: detect PPI features by checking
availability of _DSM functions) which causes them to fail to
resume from system suspend, becuase they require the TPM hardware
to be put into the right state during resume and the TPM driver
is necessary for that.

Fix the problem by making tpm_add_ppi() return 0 when tpm_ppi_handle
is still NULL after walking the ACPI namespace in search for the PPI
_DSM, which allows the TPM driver to load and operate the hardware
(during system resume in particular), but avoid creating the PPI
sysfs group in that case.

This change is based on a prototype patch from Jiang Liu.

Fixes: 1569a4c4 (ACPI / TPM: detect PPI features by checking availability of _DSM functions)
References: https://bugzilla.kernel.org/show_bug.cgi?id=74021Reported-by: NJames Duley <jagduley@gmail.com>
Reported-by: NPhillip Dixon <phil@dixon.gen.nz>
Tested-by: NBrandon Casey <drafnel@gmail.com>
Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 d6d211db
...@@ -328,13 +328,11 @@ int tpm_add_ppi(struct kobject *parent) ...@@ -328,13 +328,11 @@ int tpm_add_ppi(struct kobject *parent)
/* Cache TPM ACPI handle and version string */ /* Cache TPM ACPI handle and version string */
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
ppi_callback, NULL, NULL, &tpm_ppi_handle); ppi_callback, NULL, NULL, &tpm_ppi_handle);
if (tpm_ppi_handle == NULL) return tpm_ppi_handle ? sysfs_create_group(parent, &ppi_attr_grp) : 0;
return -ENODEV;
return sysfs_create_group(parent, &ppi_attr_grp);
} }
void tpm_remove_ppi(struct kobject *parent) void tpm_remove_ppi(struct kobject *parent)
{ {
sysfs_remove_group(parent, &ppi_attr_grp); if (tpm_ppi_handle)
sysfs_remove_group(parent, &ppi_attr_grp);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册