linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Correct errors in acpi_parse_entries_array()
@ 2016-08-20  0:48 Al Stone
  2016-08-20  0:48 ` [PATCH v2 1/3] ACPI: fix incorrect counts returned by acpi_parse_entries_array() Al Stone
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Al Stone @ 2016-08-20  0:48 UTC (permalink / raw)
  To: linux-acpi, linux-kernel; +Cc: ahs3

Several strange things were found while prototyping a way to correctly
report whether or not an IORT is needed by an arm64 platform.  What the
prototype needed to do was iterate over the MADT subtables and look for
certain types of subtable, count how many there were by type, and capture
some info about some of the subtables.

When I first read through the acpi_parse_entries_array() function, the
comments seemed to describe precisely what I needed to do.  However, what
I found in trying to use the function is that that is not exactly how it
works.

So, the first patch fixes the counts of subtable types found so they are
correct.  Fortunately, nothing has relied on them being correct in the 
past, just non-zero or not.  This has also been noted by Baoquan He in a
patch he recently submitted.

The second patch fixes a problem where iterating over the subtables would
end earlier than necessary, again throwing off the counts; in this case,
I only needed to know how many of certain types of subtables were present,
but would never be able to get to a complete count.

The third patch removes part of a message that always reported an incorrect
value for the number of subtables skipped when there's a limit.  It always
reported zero, so it's never really been useful.

Longer term, I would like to simplify the way MADT and other ACPI tables
with subtables are parsed; mostly, I want to get rid of the need for using
file scoped variables.  The acpi_parse_entries_array() function can be a
good basis to build upon, as long as it works as expected.

Changes since v1:
  -- Much rewrite of the cover letter and changelogs to make sure the 
     motivation for the changes was captured (Rafael)
  -- Verified that the changes in semantics for the function are harmless;
     direct calls, parents/grandparents/.. of the direct calls were checked
     to make sure they did not depend on the current behavior in such a way
     as to break them with these changes (Rafael)
  -- Patch 3/3 was simplified; on further investigation, should additional
     callbacks be made to get the total skipped, there could be side effects
     or dependencies between callbacks that would make the original plan of
     iterating over all callbacks risky, for very little value (Rafael)

Al Stone (3):
  ACPI: fix incorrect counts returned by acpi_parse_entries_array()
  ACPI: fix acpi_parse_entries_array() so it traverses all subtables
  ACPI: do not report the number of entries ignored by
    acpi_parse_entries()

 drivers/acpi/tables.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-12 22:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-20  0:48 [PATCH v2 0/3] Correct errors in acpi_parse_entries_array() Al Stone
2016-08-20  0:48 ` [PATCH v2 1/3] ACPI: fix incorrect counts returned by acpi_parse_entries_array() Al Stone
2016-08-20  0:48 ` [PATCH v2 2/3] ACPI: fix acpi_parse_entries_array() so it traverses all subtables Al Stone
2016-08-20  0:48 ` [PATCH v2 3/3] ACPI: do not report the number of entries ignored by acpi_parse_entries() Al Stone
2016-09-12 22:10 ` [PATCH v2 0/3] Correct errors in acpi_parse_entries_array() Rafael J. Wysocki

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).