]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tpm, tpm_crb: Handle 64-bit resource in crb_check_resource()
authorJiandi An <anjiandi@codeaurora.org>
Mon, 19 Dec 2016 04:20:53 +0000 (22:20 -0600)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 23 Jan 2017 16:28:18 +0000 (18:28 +0200)
crb_check_resource() in TPM CRB driver calls
acpi_dev_resource_memory() which only handles 32-bit resources.
Adding a call to acpi_dev_resource_address_space() in TPM CRB
driver which handles 64-bit resources.

Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_crb.c

index 717b6b47c042760fe4db4f6834e8d40af5d2a117..86f355b6df1d345ff9cf0874c40a29f5f986b0f2 100644 (file)
@@ -264,10 +264,12 @@ static const struct tpm_class_ops tpm_crb = {
 static int crb_check_resource(struct acpi_resource *ares, void *data)
 {
        struct resource *io_res = data;
-       struct resource res;
+       struct resource_win win;
+       struct resource *res = &(win.res);
 
-       if (acpi_dev_resource_memory(ares, &res)) {
-               *io_res = res;
+       if (acpi_dev_resource_memory(ares, res) ||
+           acpi_dev_resource_address_space(ares, &win)) {
+               *io_res = *res;
                io_res->name = NULL;
        }