Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / irq: Fix return code of acpi_gsi_to_irq()

The function acpi_gsi_to_irq() must return 0 on success as the caller
ghes_probe expects an 0 for success. This change also matches x86
implementation.

This patch was submitted around 4.5 timeframe but wasn't pushed because
it didn't fix a real problem. Now that RAS/GHES patches are in kernel,
this fixes an error seen on a Mustang (arm64) platform:

GHES: Failed to map GSI to IRQ for generic hardware error source: 2
GHES: probe of GHES.2 failed with error 81

Signed-off-by: Tuan Phan <tphan@apm.com>
Signed-off-by: Loc Ho <lho@apm.com>
Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Mark Salter and committed by
Rafael J. Wysocki
1dc482b6 6f7da290

+2 -2
+2 -2
drivers/acpi/irq.c
··· 24 24 * 25 25 * irq location updated with irq value [>0 on success, 0 on failure] 26 26 * 27 - * Returns: linux IRQ number on success (>0) 27 + * Returns: 0 on success 28 28 * -EINVAL on failure 29 29 */ 30 30 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) ··· 37 37 * *irq == 0 means no mapping, that should 38 38 * be reported as a failure 39 39 */ 40 - return (*irq > 0) ? *irq : -EINVAL; 40 + return (*irq > 0) ? 0 : -EINVAL; 41 41 } 42 42 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); 43 43