mbox series

[v2,0/2] ACPI/IORT: rework num_ids off-by-one quirk

Message ID 20200501161014.5935-1-ardb@kernel.org (mailing list archive)
Headers show
Series ACPI/IORT: rework num_ids off-by-one quirk | expand

Message

Ard Biesheuvel May 1, 2020, 4:10 p.m. UTC
Replace the ACPI OEM ID matching based IORT quirk for the ID region size
ambiguity with runtime handling of this condition.

This is based on the observation that we only care about this when it
causes ambiguity regarding the output reference, which means that we
will have more than one match for the input ID. In this case, we can
just disregard the one at the end of a multi-ID region: if we hit it
first, we record it tentatively but allow a subsequent match to
supersede it. If we hit the correct match first, there is nothing we
need to do.

Changes since v1:
- print FW_BUG error to the kernel log when a duplicate match is found
- ignore duplicate matches unless they occur at the start of a region
  (for compatibility with broken systems that might exist that happen to
  work today because the first match is always chosen)

Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>
Cc: Will Deacon <will@kernel.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>

Ard Biesheuvel (2):
  Revert "ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map()"
  ACPI/IORT: work around num_ids ambiguity

 drivers/acpi/arm64/iort.c | 95 ++++++++------------
 1 file changed, 35 insertions(+), 60 deletions(-)

Comments

Will Deacon May 4, 2020, 11:34 a.m. UTC | #1
On Fri, 1 May 2020 18:10:12 +0200, Ard Biesheuvel wrote:
> Replace the ACPI OEM ID matching based IORT quirk for the ID region size
> ambiguity with runtime handling of this condition.
> 
> This is based on the observation that we only care about this when it
> causes ambiguity regarding the output reference, which means that we
> will have more than one match for the input ID. In this case, we can
> just disregard the one at the end of a multi-ID region: if we hit it
> first, we record it tentatively but allow a subsequent match to
> supersede it. If we hit the correct match first, there is nothing we
> need to do.
> 
> [...]

Applied to arm64 (for-next/acpi), thanks!

[1/2] Revert "ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map()"
      https://git.kernel.org/arm64/c/6d3b29d07c3c
[2/2] ACPI/IORT: work around num_ids ambiguity
      https://git.kernel.org/arm64/c/539979b6ec62

Cheers,