All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com,
	Andy Gross <agross@codeaurora.org>,
	linux-arm-msm@vger.kernel.org,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] acpi: add support for extended IRQ to PCI link
Date: Mon, 9 Nov 2015 17:29:58 -0500	[thread overview]
Message-ID: <56411E66.2030104@codeaurora.org> (raw)
In-Reply-To: <CAHp75VfH9-OpQdX_aoraLEcHewdRPFoR5My8mN2jU30ittS7oA@mail.gmail.com>



On 11/8/2015 3:35 PM, Andy Shevchenko wrote:
> On Sun, Nov 8, 2015 at 6:07 PM, Sinan Kaya <okaya@codeaurora.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-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Sinan Kaya <okaya@codeaurora.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com,
	Andy Gross <agross@codeaurora.org>,
	linux-arm-msm@vger.kernel.org,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] acpi: add support for extended IRQ to PCI link
Date: Mon, 9 Nov 2015 17:29:58 -0500	[thread overview]
Message-ID: <56411E66.2030104@codeaurora.org> (raw)
In-Reply-To: <CAHp75VfH9-OpQdX_aoraLEcHewdRPFoR5My8mN2jU30ittS7oA@mail.gmail.com>



On 11/8/2015 3:35 PM, Andy Shevchenko wrote:
> On Sun, Nov 8, 2015 at 6:07 PM, Sinan Kaya <okaya@codeaurora.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

WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] acpi: add support for extended IRQ to PCI link
Date: Mon, 9 Nov 2015 17:29:58 -0500	[thread overview]
Message-ID: <56411E66.2030104@codeaurora.org> (raw)
In-Reply-To: <CAHp75VfH9-OpQdX_aoraLEcHewdRPFoR5My8mN2jU30ittS7oA@mail.gmail.com>



On 11/8/2015 3:35 PM, Andy Shevchenko wrote:
> On Sun, Nov 8, 2015 at 6:07 PM, Sinan Kaya <okaya@codeaurora.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

  reply	other threads:[~2015-11-09 22:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08 16:07 [PATCH] acpi: add support for extended IRQ to PCI link Sinan Kaya
2015-11-08 16:07 ` Sinan Kaya
2015-11-08 16:11 ` Timur Tabi
2015-11-08 16:11   ` Timur Tabi
2015-11-09  0:04   ` Sinan Kaya
2015-11-09  0:04     ` Sinan Kaya
2015-11-09  0:05     ` Timur Tabi
2015-11-09  0:05       ` Timur Tabi
2015-11-09 21:49       ` Rafael J. Wysocki
2015-11-09 21:49         ` Rafael J. Wysocki
2015-11-08 20:35 ` Andy Shevchenko
2015-11-08 20:35   ` Andy Shevchenko
2015-11-09 22:29   ` Sinan Kaya [this message]
2015-11-09 22:29     ` Sinan Kaya
2015-11-09 22:29     ` Sinan Kaya
2015-11-09  5:24 ` Jiang Liu
2015-11-09  5:24   ` Jiang Liu
2015-11-09  5:45   ` Sinan Kaya
2015-11-09  5:45     ` Sinan Kaya
2015-11-09  8:45     ` Jiang Liu
2015-11-09  8:45       ` Jiang Liu
2015-11-09 13:50     ` Timur Tabi
2015-11-09 13:50       ` Timur Tabi
2015-11-09 16:28       ` Sinan Kaya
2015-11-09 16:28         ` Sinan Kaya
2015-11-12  6:14 [PATCH V2] " Sinan Kaya
2015-11-12  6:14 ` [PATCH] " Sinan Kaya
2015-11-12  9:56   ` Andy Shevchenko
2015-11-12 15:04     ` Sinan Kaya
2015-11-12 15:17       ` Andy Shevchenko
2015-11-12 15:54         ` okaya
2015-11-12 15:58           ` Timur Tabi

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=56411E66.2030104@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=agross@codeaurora.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=cov@codeaurora.org \
    --cc=jcm@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=timur@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.