public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq
@ 2017-07-11 16:45 Mark Salter
  2017-07-11 17:23 ` Marc Zyngier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Salter @ 2017-07-11 16:45 UTC (permalink / raw)
  To: Rafael J . Wysocki; +Cc: Marc Zyngier, linux-acpi, linux-kernel

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>
[rebased to v4.12-rc]
Signed-off-by: Mark Salter <msalter@redhat.com>
---
 drivers/acpi/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
index 830299a..7c352cb 100644
--- a/drivers/acpi/irq.c
+++ b/drivers/acpi/irq.c
@@ -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);
 
-- 
2.9.4


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

* Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq
  2017-07-11 16:45 [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Mark Salter
@ 2017-07-11 17:23 ` Marc Zyngier
  2017-07-11 17:46 ` Lorenzo Pieralisi
  2017-07-12 21:19 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2017-07-11 17:23 UTC (permalink / raw)
  To: Mark Salter, Rafael J . Wysocki
  Cc: linux-acpi, linux-kernel, Lorenzo Pieralisi

+ Lorenzo, since he deals with ACPI on arm64.

On 11/07/17 17:45, Mark Salter wrote:
> 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>
> [rebased to v4.12-rc]
> Signed-off-by: Mark Salter <msalter@redhat.com>
> ---
>  drivers/acpi/irq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
> index 830299a..7c352cb 100644
> --- a/drivers/acpi/irq.c
> +++ b/drivers/acpi/irq.c
> @@ -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);
>  
> 


-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq
  2017-07-11 16:45 [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Mark Salter
  2017-07-11 17:23 ` Marc Zyngier
@ 2017-07-11 17:46 ` Lorenzo Pieralisi
  2017-07-12 21:19 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2017-07-11 17:46 UTC (permalink / raw)
  To: Mark Salter; +Cc: Rafael J . Wysocki, Marc Zyngier, linux-acpi, linux-kernel

On Tue, Jul 11, 2017 at 12:45:43PM -0400, Mark Salter wrote:
> 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.

>     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>
> [rebased to v4.12-rc]
> Signed-off-by: Mark Salter <msalter@redhat.com>
> ---
>  drivers/acpi/irq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

> diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
> index 830299a..7c352cb 100644
> --- a/drivers/acpi/irq.c
> +++ b/drivers/acpi/irq.c
> @@ -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);
>  
> -- 
> 2.9.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq
  2017-07-11 16:45 [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Mark Salter
  2017-07-11 17:23 ` Marc Zyngier
  2017-07-11 17:46 ` Lorenzo Pieralisi
@ 2017-07-12 21:19 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2017-07-12 21:19 UTC (permalink / raw)
  To: Mark Salter; +Cc: Marc Zyngier, linux-acpi, linux-kernel

On Tuesday, July 11, 2017 12:45:43 PM Mark Salter wrote:
> 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>
> [rebased to v4.12-rc]
> Signed-off-by: Mark Salter <msalter@redhat.com>

Applied with the Lorenzo's ACK.

Thanks,
Rafael


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

end of thread, other threads:[~2017-07-12 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 16:45 [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Mark Salter
2017-07-11 17:23 ` Marc Zyngier
2017-07-11 17:46 ` Lorenzo Pieralisi
2017-07-12 21:19 ` 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