git: 0421a245da67 - releng/15.2 - acpi_pci_link: Ignore tunables with negative values

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 16:05:01 UTC
The branch releng/15.2 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=0421a245da67838bc6a11ffbdd359d06806d9c62

commit 0421a245da67838bc6a11ffbdd359d06806d9c62
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-11-14 16:02:38 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-11-19 16:04:36 +0000

    acpi_pci_link: Ignore tunables with negative values
    
    IRQ values are unsigned and negative values do not make sense.  The
    invalid IRQ value (255) is already ignored, so ignoring other invalid
    values is consistent with that behavior.
    
    Approved by:    re (cperciva)
    Reported by:    cperciva
    
    (cherry picked from commit 81dab94a5452f996a063bdba2103eda4aa32b3d1)
    (cherry picked from commit 1b71cb09074be51a87a2eb84acb46ee77fceec45)
---
 sys/dev/acpica/acpi_pci_link.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c
index d9807876c443..cb6adee87252 100644
--- a/sys/dev/acpica/acpi_pci_link.c
+++ b/sys/dev/acpica/acpi_pci_link.c
@@ -974,7 +974,8 @@ acpi_pci_link_choose_irq(device_t dev, struct link *link)
 	    sizeof(link_name)))) {
 		snprintf(tunable_buffer, sizeof(tunable_buffer),
 		    "hw.pci.link.%s.%d.irq", link_name, link->l_res_index);
-		if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) {
+		if (getenv_int(tunable_buffer, &i) && i >= 0 &&
+		    PCI_INTERRUPT_VALID(i)) {
 			if (!link_valid_irq(link, i))
 				device_printf(dev,
 				    "Warning, IRQ %d is not listed as valid\n",
@@ -983,7 +984,8 @@ acpi_pci_link_choose_irq(device_t dev, struct link *link)
 		}
 		snprintf(tunable_buffer, sizeof(tunable_buffer),
 		    "hw.pci.link.%s.irq", link_name);
-		if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) {
+		if (getenv_int(tunable_buffer, &i) && i >= 0 &&
+		    PCI_INTERRUPT_VALID(i)) {
 			if (!link_valid_irq(link, i))
 				device_printf(dev,
 				    "Warning, IRQ %d is not listed as valid\n",