[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56411E66.2030104@codeaurora.org>
Date: Mon, 9 Nov 2015 17:29:58 -0500
From: Sinan Kaya <okaya@...eaurora.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
timur@...eaurora.org, cov@...eaurora.org, jcm@...hat.com,
Andy Gross <agross@...eaurora.org>,
linux-arm-msm@...r.kernel.org,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] acpi: add support for extended IRQ to PCI link
On 11/8/2015 3:35 PM, Andy Shevchenko wrote:
> On Sun, Nov 8, 2015 at 6:07 PM, Sinan Kaya <okaya@...eaurora.org> wrote:
>> The ACPI compiler uses the extended format when
>> used interrupt numbers are greater than 256.
>> The PCI link code currently only supports simple
>> interrupt format. The IRQ numbers are represented
>> using 32 bits when extended IRQ syntax. This patch
>> changes the interrupt number type to 32 bits and
>> places an upper limit of 1020 as possible interrupt
>> id. Additional checks have been placed to prevent
>> out of bounds writes.
>
> In commit messages and in comments I see this narrow lines, any reason
> to make them short, except increasing number of lines?
>
done
>> if (acpi_irq_balance || !link->irq.active) {
>> - /*
>> - * Select the best IRQ. This is done in reverse to promote
>> - * the use of IRQs 9, 10, 11, and >15.
>> - */
>> - for (i = (link->irq.possible_count - 1); i >= 0; i--) {
>> - if (acpi_irq_penalty[irq] >
>> - acpi_irq_penalty[link->irq.possible[i]])
>> - irq = link->irq.possible[i];
>> +
>> + if (irq < ACPI_MAX_IRQS) {
>> + /*
>> + * Select the best IRQ. This is done in reverse to
>> + * promote the use of IRQs 9, 10, 11, and >15.
>> + */
>> + for (i = (link->irq.possible_count - 1); i >= 0;
>> + i--) {
>
> Why not
>
> if ((acpi_irq_balance || !link->irq.active) && irq < ACPI_MAX_IRQS) {
> int i = link->irq.possible_count;
>
> while (--i) {
> …
> }
> }
done
>
>> + if ((link->irq.possible[i] < ACPI_MAX_IRQS) &&
>> + (acpi_irq_penalty[irq] >
>> + acpi_irq_penalty[link->irq.possible[i]]))
>> + irq = link->irq.possible[i];
>> + }
>> }
>> }
>> if (acpi_irq_penalty[irq] >= PIRQ_PENALTY_ISA_ALWAYS) {
>
--
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists