From: Al Stone <ahs3@redhat.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 2/3] ACPI: fix acpi_parse_entries_array() so it traverses all subtables
Date: Fri, 1 Jul 2016 15:55:43 -0600 [thread overview]
Message-ID: <00e1e2ec-b7e1-606d-3faa-271560864d0e@redhat.com> (raw)
In-Reply-To: <CAJZ5v0htLm0r0gk+t=_acBfeVA5ErW-bDRDEXHtKKQsAapEC5g@mail.gmail.com>
On 07/01/2016 03:46 PM, Rafael J. Wysocki wrote:
> On Fri, Jul 1, 2016 at 11:41 PM, Al Stone <ahs3@redhat.com> wrote:
>> On 07/01/2016 03:32 PM, Rafael J. Wysocki wrote:
>>> On Fri, Jul 1, 2016 at 11:21 PM, Al Stone <ahs3@redhat.com> wrote:
>>>> Without this patch, the acpi_parse_entries_array() function will return
>>>> the very first time there is any error found in either the array of
>>>> callback functions or if one of the callbacks returns an non-zero value.
>>>> However, the array of callbacks could still have valid entries further
>>>> on in the array, or the callbacks may be able to process subsequent
>>>> subtables without error. The change here makes the function consistent
>>>> with its description so that it will properly return the sum of all
>>>> matching entries for all proc handlers, instead of stopping abruptly
>>>> as it does today.
>>>
>>> I'm not sure I follow.
>>>
>>> You seem to be saying that the function should process all of the
>>> subtables etc even though errors have been found for some of them, but
>>> it still will return an error in the end if there are any errors. How
>>> exactly does it help to continue processing in case of an error, then?
>>
>> The use case I have in mind is to simply count all of the subtables of
>> a certain type. If for some reason, the callback -- or any other callback
>> -- fails, the traversal of all the subtables stops immediately. So, I
>> could have two callbacks, and if the first one fails on the first subtable
>> of its type, traversal stops. The count for the second callback will be
>> zero which may or may not be correct.
>
> It will be zero, because the callback has not been invoked at all.
> Why is this incorrect?
>
Because there could be additional subtables after the one causing a failure
that the second callback could have counted; e.g., if the failure is on the
first subtable of 20 in the MADT, the following 19 would be ignored, even if
they were all the right subtype for the second callback.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
next prev parent reply other threads:[~2016-07-01 21:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 21:21 [PATCH 0/3] Correct errors in acpi_parse_entries_array() Al Stone
2016-07-01 21:21 ` [PATCH 1/3] ACPI: fix incorrect counts returned by acpi_parse_entries_array() Al Stone
2016-07-01 21:25 ` Rafael J. Wysocki
2016-07-01 21:36 ` Al Stone
2016-07-01 21:44 ` Rafael J. Wysocki
2016-07-01 21:50 ` Al Stone
2016-07-01 21:56 ` Rafael J. Wysocki
2016-07-01 22:38 ` Al Stone
2016-07-01 21:21 ` [PATCH 2/3] ACPI: fix acpi_parse_entries_array() so it traverses all subtables Al Stone
2016-07-01 21:32 ` Rafael J. Wysocki
2016-07-01 21:41 ` Al Stone
2016-07-01 21:46 ` Rafael J. Wysocki
2016-07-01 21:55 ` Al Stone [this message]
2016-07-01 22:01 ` Rafael J. Wysocki
2016-07-01 23:07 ` Al Stone
2016-07-01 23:27 ` Rafael J. Wysocki
2016-07-01 21:21 ` [PATCH 3/3] ACPI: fix acpi_parse_entries_array() so it reports overflow correctly Al Stone
2016-07-01 21:40 ` Rafael J. Wysocki
2016-07-01 21:44 ` Al Stone
2016-07-01 21:54 ` Rafael J. Wysocki
2016-07-01 22:38 ` Al Stone
2016-07-01 22:45 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00e1e2ec-b7e1-606d-3faa-271560864d0e@redhat.com \
--to=ahs3@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).