ACPI: Set length even for TYPE_END_TAG acpi resource
Subsystems (5)
PATCH 1/1 ACPI: Set length even for TYPE_END_TAG acpi resource
Found with pm/linux-next, network device in QEMU/KVM guest does not work anymore.
Bisected to commit c13085e5
ACPICA: Resource Mgr: Prevent infinite loops in resource walks
That commit will check acpi_resource length strictly.
it cause acpi_set_current_resources return failure and irq for pci device is not set properly.
Set length for all those TYPE_END_TAG acpi_resources.
--- drivers/acpi/pci_link.c | 1 + drivers/platform/x86/sony-laptop.c | 3 ++- drivers/pnp/pnpacpi/rsparser.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/acpi/pci_link.c +1 -0
@@ -354,6 +354,7 @@ static int acpi_pci_link_set(struct acpi } resource->end.type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->end.length =sizeof (struct acpi_resource );/* Attempt to set the resource */ status =acpi_set_current_resources (link->device->handle, &buffer);
drivers/platform/x86/sony-laptop.c +2 -1
@@ -4121,7 +4121,7 @@ static int sony_pic_enable(struct acpi_d resource->res3.data.irq.sharable =ACPI_SHARED ; resource->res4.type =ACPI_RESOURCE_TYPE_END_TAG ; - + resource->res4.length =sizeof (struct acpi_resource ); }/* setup Type 2/3 resources */ else {
@@ -4140,6 +4140,7 @@ static int sony_pic_enable(struct acpi_d resource->res2.data.irq.sharable =ACPI_SHARED ; resource->res3.type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->res3.length =sizeof (struct acpi_resource ); }/* Attempt to set the resource */
drivers/pnp/pnpacpi/rsparser.c +1 -0
@@ -634,6 +634,7 @@ int pnpacpi_build_resource_template(stru }/* resource will pointer the end resource now */ resource->type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->length =sizeof (struct acpi_resource );return 0 ; }
Rafael J. Wysocki
AppliedQuoted 12 lines · Yinghai Lu
Found with pm/linux-next, network device in QEMU/KVM guest does not work anymore.
Bisected to commit
c13085e5
ACPICA: Resource Mgr: Prevent infinite loops in resource walksThat commit will check
acpi_resourcelength strictly.
it causeacpi_set_current_resourcesreturn failure and irq for pci device is not set properly.Set length for all those
TYPE_END_TAGacpi_resources.
Quoted 7 lines
Bisected-by Yinghai Lu <[email protected]>Signed-off-by Yinghai Lu <[email protected]>Cc Mattia Dongili <[email protected]>Cc Matthew Garrett <[email protected]>Cc Adam Belay <[email protected]>Cc Bjorn Helgaas <[email protected]>
Applied.
Thanks,
Rafael
Quoted 55 lines
--- drivers/acpi/pci_link.c | 1 + drivers/platform/x86/sony-laptop.c | 3 ++- drivers/pnp/pnpacpi/rsparser.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)Index:
linux-2.6/drivers/acpi/pci_link.c
===================================================================drivers/acpi/pci_link.c +1
-0@@ -354,6 +354,7 @@ static int acpi_pci_link_set(struct acpi } resource->end.type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->end.length =sizeof (struct acpi_resource );/* Attempt to set the resource */ status =acpi_set_current_resources (link->device->handle, &buffer);Index:
linux-2.6/drivers/platform/x86/sony-laptop.c
===================================================================drivers/platform/x86/sony-laptop.c +2
-1@@ -4121,7 +4121,7 @@ static int sony_pic_enable(struct acpi_d resource->res3.data.irq.sharable =ACPI_SHARED ; resource->res4.type =ACPI_RESOURCE_TYPE_END_TAG ; - + resource->res4.length =sizeof (struct acpi_resource ); }/* setup Type 2/3 resources */ else {@@ -4140,6 +4140,7 @@ static int sony_pic_enable(struct acpi_d resource->res2.data.irq.sharable =ACPI_SHARED ; resource->res3.type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->res3.length =sizeof (struct acpi_resource ); }/* Attempt to set the resource */ Index:
linux-2.6/drivers/pnp/pnpacpi/rsparser.c
===================================================================drivers/pnp/pnpacpi/rsparser.c +1
-1@@ -634,6 +634,7 @@ int pnpacpi_build_resource_template(stru }/* resource will pointer the end resource now */ resource->type =ACPI_RESOURCE_TYPE_END_TAG ; + resource->length =sizeof (struct acpi_resource );return 0 ; } --To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.