From: Bjorn Helgaas <helgaas@kernel.org>
To: Sinan Kaya <okaya@codeaurora.org>
Cc: linux-acpi@vger.kernel.org, timur@codeaurora.org,
cov@codeaurora.org, linux-pci@vger.kernel.org,
ravikanth.nalla@hpe.com, lenb@kernel.org, harish.k@hpe.com,
ashwin.reghunandanan@hpe.com, bhelgaas@google.com,
rjw@rjwysocki.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 2/4] acpi,pci,irq: reduce static IRQ array size to 16
Date: Tue, 26 Apr 2016 13:38:31 -0500 [thread overview]
Message-ID: <20160426183831.GD27803@localhost> (raw)
In-Reply-To: <1460914617-8259-2-git-send-email-okaya@codeaurora.org>
On Sun, Apr 17, 2016 at 01:36:54PM -0400, Sinan Kaya wrote:
> Now that the supported number of PCI IRQs are no longer capped
> with 256, renaming the static array to support ISA IRQs only
> and removing the MAX_IRQS constant.
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
> drivers/acpi/pci_link.c | 40 ++++++++++++++++++++--------------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index cc0ba16..12ea784 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -438,8 +438,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
> * enabled system.
> */
>
> -#define ACPI_MAX_IRQS 256
> -#define ACPI_MAX_ISA_IRQ 16
> +#define ACPI_MAX_ISA_IRQS 16
>
> #define PIRQ_PENALTY_PCI_POSSIBLE (16*16)
> #define PIRQ_PENALTY_PCI_USING (16*16*16)
> @@ -447,7 +446,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
> #define PIRQ_PENALTY_ISA_USED (16*16*16*16*16)
> #define PIRQ_PENALTY_ISA_ALWAYS (16*16*16*16*16*16)
>
> -static int acpi_irq_penalty[ACPI_MAX_IRQS] = {
> +static int acpi_isa_irq_penalty[ACPI_MAX_ISA_IRQS] = {
> PIRQ_PENALTY_ISA_ALWAYS, /* IRQ0 timer */
> PIRQ_PENALTY_ISA_ALWAYS, /* IRQ1 keyboard */
> PIRQ_PENALTY_ISA_ALWAYS, /* IRQ2 cascade */
> @@ -500,8 +499,8 @@ static int acpi_irq_get_penalty(int irq)
> {
> int penalty = 0;
>
> - if (irq < ACPI_MAX_ISA_IRQ)
> - penalty += acpi_irq_penalty[irq];
> + if (irq < ACPI_MAX_ISA_IRQS)
Nit: sometimes you use "irq < ACPI_MAX_ISA_IRQS", other times you use
"irq < ARRAY_SIZE(acpi_isa_irq_penalty)". Seems like they could be
consistent.
> - if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty))
> - acpi_irq_penalty[irq] = acpi_irq_get_penalty(irq) +
> + if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty)))
> + acpi_isa_irq_penalty[irq] = acpi_irq_get_penalty(irq) +
> active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING;
> }
>
> bool acpi_isa_irq_available(int irq)
> {
> - return irq >= 0 && (irq >= ARRAY_SIZE(acpi_irq_penalty) ||
> + return irq >= 0 && (irq >= ARRAY_SIZE(acpi_isa_irq_penalty) ||
> acpi_irq_get_penalty(irq) < PIRQ_PENALTY_ISA_ALWAYS);
> }
>
> --
> 1.8.2.1
>
next prev parent reply other threads:[~2016-04-26 18:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-17 17:36 [PATCH V3 1/4] acpi,pci,irq: reduce resource requirements Sinan Kaya
2016-04-17 17:36 ` [PATCH V3 2/4] acpi,pci,irq: reduce static IRQ array size to 16 Sinan Kaya
2016-04-26 18:38 ` Bjorn Helgaas [this message]
2016-04-17 17:36 ` [PATCH V3 3/4] acpi,pci,irq: remove redundant code in acpi_irq_penalty_init Sinan Kaya
2016-04-26 18:39 ` Bjorn Helgaas
2016-04-17 17:36 ` [PATCH V3 4/4] acpi,pci,irq: remove SCI penalize function Sinan Kaya
2016-04-26 18:36 ` [PATCH V3 1/4] acpi,pci,irq: reduce resource requirements Bjorn Helgaas
2016-04-26 19:00 ` Sinan Kaya
2016-04-26 20:33 ` Nalla, Ravikanth
2016-04-26 20:33 ` Nalla, Ravikanth
2016-05-02 17:44 ` Nalla, Ravikanth
2016-05-02 17:44 ` Nalla, Ravikanth
2016-05-02 17:58 ` Sinan Kaya
2016-05-03 16:17 ` Nalla, Ravikanth
2016-05-03 16:17 ` Nalla, Ravikanth
2016-05-03 17:16 ` Sinan Kaya
2016-04-27 0:06 ` Bjorn Helgaas
2016-04-27 0:17 ` Rafael J. Wysocki
2016-05-05 23:40 ` Rafael J. Wysocki
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=20160426183831.GD27803@localhost \
--to=helgaas@kernel.org \
--cc=ashwin.reghunandanan@hpe.com \
--cc=bhelgaas@google.com \
--cc=cov@codeaurora.org \
--cc=harish.k@hpe.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=okaya@codeaurora.org \
--cc=ravikanth.nalla@hpe.com \
--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.