Skip to contentSkip to conversation

acpi: Fix proper return code for function acpi_gsi_to_irq

PATCH In review Mark Salter 4 participants 4 messages Jul 11, 2017 – Jul 12, 2017 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: Fix proper return code for function 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

[rebased to v4.12-rc]
---
 drivers/acpi/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/irq.c +2 -2
index 830299a..7c352cb 100644
@@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id;
  *
  * irq location updated with irq value [>0 on success, 0 on failure]
  *
- * Returns: linux IRQ number on success (>0)
+ * Returns: 0 on success
  *          -EINVAL on failure
  */
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 	 * *irq == 0 means no mapping, that should
 	 * be reported as a failure
 	 */
-	return (*irq > 0) ? *irq : -EINVAL;
+	return (*irq > 0) ? 0 : -EINVAL;
 }
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 
Signature · 1 line
2.9.4
#1 lore raw

+ Lorenzo, since he deals with ACPI on arm64.

Quoted 42 lines · Mark Salter

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

[rebased to v4.12-rc]
---
 drivers/acpi/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/irq.c +2 -2
index 830299a..7c352cb 100644
@@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id;
  *
  * irq location updated with irq value [>0 on success, 0 on failure]
  *
- * Returns: linux IRQ number on success (>0)
+ * Returns: 0 on success
  *          -EINVAL on failure
  */
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 	 * *irq == 0 means no mapping, that should
 	 * be reported as a failure
 	 */
-	return (*irq > 0) ? *irq : -EINVAL;
+	return (*irq > 0) ? 0 : -EINVAL;
 }
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 
Signature · 1 line
Jazz is not dead. It just smells funny...
Acked-by on v1 1/1
#2 lore raw
In reply to Mark Salter
Quoted 7 lines · Mark Salter

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:

Nit: I think you can rephrase the log, ie it is a bug and you are fixing it, that's it.

Quoted 10 lines

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

[rebased to v4.12-rc]
---
 drivers/acpi/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 29 lines
drivers/acpi/irq.c +2 -2
index 830299a..7c352cb 100644
@@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id;
  *
  * irq location updated with irq value [>0 on success, 0 on failure]
  *
- * Returns: linux IRQ number on success (>0)
+ * Returns: 0 on success
  *          -EINVAL on failure
  */
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 	 * *irq == 0 means no mapping, that should
 	 * be reported as a failure
 	 */
-	return (*irq > 0) ? *irq : -EINVAL;
+	return (*irq > 0) ? 0 : -EINVAL;
 }
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 
Signature · 6 lines
2.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to Mark Salter
Quoted 8 lines · Mark Salter

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:

Quoted 7 lines

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

[rebased to v4.12-rc]

Applied with the Lorenzo's ACK.

Thanks,
Rafael