Skip to content

Commit 408632c

Browse files
committed
tpm: Do not remap from ACPI resources again for Pluton TPM
JIRA: https://issues.redhat.com/browse/RHEL-102691 commit b1c1b98 Author: Valentin David <valentin.david@gmail.com> Date: Mon, 10 Jul 2023 22:27:49 +0200 For Pluton TPM devices, it was assumed that there was no ACPI memory regions. This is not true for ASUS ROG Ally. ACPI advertises 0xfd500000-0xfd5fffff. Since remapping is already done in `crb_map_pluton`, remapping again in `crb_map_io` causes EBUSY error: [ 3.510453] tpm_crb MSFT0101:00: can't request region for resource [mem 0xfd500000-0xfd5fffff] [ 3.510463] tpm_crb: probe of MSFT0101:00 failed with error -16 Cc: stable@vger.kernel.org # v6.3+ Fixes: 4d27328 ("tpm_crb: Add support for CRB devices based on Pluton") Signed-off-by: Valentin David <valentin.david@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
1 parent 6b6eb76 commit 408632c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

drivers/char/tpm/tpm_crb.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -607,15 +607,18 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
607607
u32 rsp_size;
608608
int ret;
609609

610-
INIT_LIST_HEAD(&acpi_resource_list);
611-
ret = acpi_dev_get_resources(device, &acpi_resource_list,
612-
crb_check_resource, iores_array);
613-
if (ret < 0)
614-
return ret;
615-
acpi_dev_free_resource_list(&acpi_resource_list);
616-
617-
/* Pluton doesn't appear to define ACPI memory regions */
610+
/*
611+
* Pluton sometimes does not define ACPI memory regions.
612+
* Mapping is then done in crb_map_pluton
613+
*/
618614
if (priv->sm != ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON) {
615+
INIT_LIST_HEAD(&acpi_resource_list);
616+
ret = acpi_dev_get_resources(device, &acpi_resource_list,
617+
crb_check_resource, iores_array);
618+
if (ret < 0)
619+
return ret;
620+
acpi_dev_free_resource_list(&acpi_resource_list);
621+
619622
if (resource_type(iores_array) != IORESOURCE_MEM) {
620623
dev_err(dev, FW_BUG "TPM2 ACPI table does not define a memory resource\n");
621624
return -EINVAL;

0 commit comments

Comments
 (0)