Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685206 > unrolled thread

[PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq

Started byMark Salter <msalter@redhat.com>
First post2017-07-11 18:50 +0200
Last post2017-07-12 23:30 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Mark Salter <msalter@redhat.com> - 2017-07-11 18:50 +0200
    Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Marc Zyngier <marc.zyngier@arm.com> - 2017-07-11 19:30 +0200
    Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-07-11 19:50 +0200
    Re: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-12 23:30 +0200

#1685206 — [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq

FromMark Salter <msalter@redhat.com>
Date2017-07-11 18:50 +0200
Subject[PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq
Message-ID<u26wi-4KY-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1685235

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-07-11 19:30 +0200
Message-ID<u2790-5cu-17@gated-at.bofh.it>
In reply to#1685206
+ 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...

[toc] | [prev] | [next] | [standalone]


#1685251

FromLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date2017-07-11 19:50 +0200
Message-ID<u27sl-5iL-7@gated-at.bofh.it>
In reply to#1685206
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

[toc] | [prev] | [next] | [standalone]


#1686042

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-07-12 23:30 +0200
Message-ID<u2xmO-53z-19@gated-at.bofh.it>
In reply to#1685206
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web