* [PATCH] acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources()
@ 2020-12-04 0:27 Daniel Scally
2020-12-05 15:21 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Scally @ 2020-12-04 0:27 UTC (permalink / raw)
To: linux-acpi, linux-kernel; +Cc: rjw, lenb, mika.westerberg
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
Fixes: 8a66790b7850 ("ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks")
Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
drivers/acpi/resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index ad04824ca3ba..f2f5f1dc7c61 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -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;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources()
2020-12-04 0:27 [PATCH] acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources() Daniel Scally
@ 2020-12-05 15:21 ` Rafael J. Wysocki
2020-12-05 16:59 ` Dan Scally
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2020-12-05 15:21 UTC (permalink / raw)
To: Daniel Scally; +Cc: linux-acpi, linux-kernel, lenb, mika.westerberg
On Friday, December 4, 2020 1:27:40 AM CET Daniel Scally wrote:
> 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
>
> Fixes: 8a66790b7850 ("ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks")
> Signed-off-by: Daniel Scally <djrscally@gmail.com>
This is simply a revert of the above commit, so it would be better to present
it as a revert explicitly.
> ---
> drivers/acpi/resource.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index ad04824ca3ba..f2f5f1dc7c61 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources()
2020-12-05 15:21 ` Rafael J. Wysocki
@ 2020-12-05 16:59 ` Dan Scally
0 siblings, 0 replies; 3+ messages in thread
From: Dan Scally @ 2020-12-05 16:59 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, linux-kernel, lenb, mika.westerberg
On 05/12/2020 15:21, Rafael J. Wysocki wrote:
> On Friday, December 4, 2020 1:27:40 AM CET Daniel Scally wrote:
>> 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
>>
>> Fixes: 8a66790b7850 ("ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks")
>> Signed-off-by: Daniel Scally <djrscally@gmail.com>
> 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
>
>> ---
>> drivers/acpi/resource.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
>> index ad04824ca3ba..f2f5f1dc7c61 100644
>> --- a/drivers/acpi/resource.c
>> +++ b/drivers/acpi/resource.c
>> @@ -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;
>> }
>>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-05 19:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 0:27 [PATCH] acpi: resource: Use AE_ABORT_METHOD to terminate acpi_dev_get_resources() Daniel Scally
2020-12-05 15:21 ` Rafael J. Wysocki
2020-12-05 16:59 ` Dan Scally
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).