linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq
Date: Tue, 12 Jan 2016 19:32:32 +0000	[thread overview]
Message-ID: <569554D0.2000406@arm.com> (raw)
In-Reply-To: <CAGDN=zYVvU9=Qj8_szqYW3qh7G=phr_Bc_dm8+KVO=yhp=YTVQ@mail.gmail.com>

On 12/01/16 19:13, Tuan Phan wrote:
> On Tue, Jan 12, 2016 at 10:59 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> On 07/11/15 00:51, Loc Ho wrote:
>>> The function acpi_gsi_to_irq should returns 0 on success as upper function
>>> caller expect an 0 for sucesss.
>>
>> I have to ask: why do you feel the need to change an API that behaves
>> like the rest of the IRQ allocation functions (at least when it comes to
>> its return value)?
>>
>> 0 is defined as an invalid interrupt, and I wish it stayed that way.
> 
> The upper caller expects 0 for success.
> In drivers/acpi/apei/ghes.c:
>         case ACPI_HEST_NOTIFY_EXTERNAL:
>                 /* External interrupt vector is GSI */
>                 rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq);
>                 if (rc) {
>                         pr_err(GHES_PFX "Failed to map GSI to IRQ for
> generic hardware error source: %d\n",
>                                generic->header.source_id);
>                         goto err_edac_unreg;
>                 }
> 
> Also the implementation of acpi_gsi_to_irq for X86 in
> arch/x86/kernel/acpi/boot.c also return 0 for success and -1 for
> failure.
> int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
> {
>         int rc, irq, trigger, polarity;
> 
>         if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
>                 *irqp = gsi;
>                 return 0;
>         }
> 
>         rc = acpi_get_override_irq(gsi, &trigger, &polarity);
>         if (rc == 0) {
>                 trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
>                 polarity = polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
>                 irq = acpi_register_gsi(NULL, gsi, trigger, polarity);
>                 if (irq >= 0) {
>                         *irqp = irq;
>                         return 0;
>                 }
>         }
> 
>         return -1;
> }
> 

Right. In which case please document this properly in the commit log.

Thanks,

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

  reply	other threads:[~2016-01-12 19:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  0:51 [PATCH v3 0/2] acpi: apei: Bug fix to enable APEI support for ARMv8 Loc Ho
2015-11-07  0:51 ` [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq Loc Ho
2016-01-10 11:07   ` Borislav Petkov
2016-01-11 22:04     ` Tuan Phan
2016-01-11 22:13       ` Borislav Petkov
2016-01-11 22:41         ` Tuan Phan
2016-01-12 14:36           ` Borislav Petkov
2016-01-12 18:26             ` Tuan Phan
2016-01-12 18:32               ` Borislav Petkov
2016-01-12 18:46                 ` Tuan Phan
2016-01-12 19:21                   ` Borislav Petkov
2016-01-12 18:59   ` Marc Zyngier
2016-01-12 19:13     ` Tuan Phan
2016-01-12 19:32       ` Marc Zyngier [this message]
2016-01-12 20:01         ` Tuan Phan
2016-01-13  8:40           ` Marc Zyngier
2015-11-07  0:51 ` [PATCH v3 2/2] acpi: apei: Enable APEI multiple GHES source to share an single external IRQ Loc Ho
2016-01-09  0:30 ` [PATCH v3 0/2] acpi: apei: Bug fix to enable APEI support for ARMv8 Loc Ho
2016-01-10 11:08   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=569554D0.2000406@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).