acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources()
PATCH 1/1 acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources()
Switching this function to AE_CTRL_TERMINATE broke the documented behaviour of acpi_dev_get_resources() - AE_CTRL_TERMINATE does not, in fact, terminate the resource walk because acpi_walk_resource_buffer() ignores it (specifically converting it to AE_OK), referring to that value as "an OK termination by the user function". This means that acpi_dev_get_resources() does not abort processing when the preproc function returns a negative value.
Revert to AE_ABORT_METHOD
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/resource.c +1 -1
@@ -541,7 +541,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, ret = c->preproc (ares, c->preproc_data);if (ret <0 ) { c->error = ret; -return AE_CTRL_TERMINATE ; +return AE_ABORT_METHOD ; }else if (ret >0 ) {return AE_OK ; }
Signature · 1 line
2.25.1
Quoted 8 lines · CET Daniel Scally
Switching this function to
AE_CTRL_TERMINATEbroke the documented behaviour ofacpi_dev_get_resources()-AE_CTRL_TERMINATEdoes not, in fact, terminate the resource walk becauseacpi_walk_resource_buffer()ignores it (specifically converting it toAE_OK), referring to that value as "an OK termination by the user function". This means thatacpi_dev_get_resources()does not abort processing when the preproc function returns a negative value.
Quoted 4 lines
Revert to
AE_ABORT_METHODFixes 8a66790b7850 ("ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks")Signed-off-by Daniel Scally <[email protected]>
This is simply a revert of the above commit, so it would be better to present it as a revert explicitly.
Quoted 18 lines
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/resource.c +1
-1@@ -541,7 +541,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, ret = c->preproc (ares, c->preproc_data);if (ret <0 ) { c->error = ret; -return AE_CTRL_TERMINATE ; +return AE_ABORT_METHOD ; }else if (ret >0 ) {return AE_OK ; }
Quoted 9 lines · Rafael J. Wysocki
Quoted 8 lines · CET Daniel Scally
Switching this function to
AE_CTRL_TERMINATEbroke the documented behaviour ofacpi_dev_get_resources()-AE_CTRL_TERMINATEdoes not, in fact, terminate the resource walk becauseacpi_walk_resource_buffer()ignores it (specifically converting it toAE_OK), referring to that value as "an OK termination by the user function". This means thatacpi_dev_get_resources()does not abort processing when the preproc function returns a negative value.
Quoted 6 lines
Quoted 4 lines
Revert to
AE_ABORT_METHODFixes 8a66790b7850 ("ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks")Signed-off-by Daniel Scally <[email protected]>This is simply a revert of the above commit, so it would be better to present it as a revert explicitly.
Ah, of course. I'll resend as that, sorry for the noise
Quoted 22 lines
Quoted 19 lines
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/resource.c +1
-1@@ -541,7 +541,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, ret = c->preproc (ares, c->preproc_data);if (ret <0 ) { c->error = ret; -return AE_CTRL_TERMINATE ; +return AE_ABORT_METHOD ; }else if (ret >0 ) {return AE_OK ; }