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


Groups > linux.kernel > #1433551

[PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible

From Sinan Kaya <okaya@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible
Date 2016-06-29 10:30 +0200
Message-ID <rPj2F-1OB-7@gated-at.bofh.it> (permalink)
References <rPj2F-1OB-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The change introduced in commit 103544d86976 ("ACPI,PCI,IRQ: reduce
resource requirements") omitted the initially assigned POSSIBLE penalty
when the IRQ is active.

The original code would assign the POSSIBLE value divided by the number
of possible IRQs during initialization.

Later, if the IRQ is chosen as the active IRQ or if the IRQ is in use
by ISA; additional penalties get added.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/acpi/pci_link.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 8fc7323..f2b69e3 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -470,6 +470,7 @@ static int acpi_irq_pci_sharing_penalty(int irq)
 {
 	struct acpi_pci_link *link;
 	int penalty = 0;
+	int i;
 
 	list_for_each_entry(link, &acpi_link_list, list) {
 		/*
@@ -478,18 +479,14 @@ static int acpi_irq_pci_sharing_penalty(int irq)
 		 */
 		if (link->irq.active && link->irq.active == irq)
 			penalty += PIRQ_PENALTY_PCI_USING;
-		else {
-			int i;
-
-			/*
-			 * If a link is inactive, penalize the IRQs it
-			 * might use, but not as severely.
-			 */
-			for (i = 0; i < link->irq.possible_count; i++)
-				if (link->irq.possible[i] == irq)
-					penalty += PIRQ_PENALTY_PCI_POSSIBLE /
-						link->irq.possible_count;
-		}
+
+		/*
+		 * penalize the IRQs PCI might use, but not as severely.
+		 */
+		for (i = 0; i < link->irq.possible_count; i++)
+			if (link->irq.possible[i] == irq)
+				penalty += PIRQ_PENALTY_PCI_POSSIBLE /
+					link->irq.possible_count;
 	}
 
 	return penalty;
-- 
1.8.2.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible Sinan Kaya <okaya@codeaurora.org> - 2016-06-29 10:30 +0200
  Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-29 15:20 +0200
    Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible Sinan Kaya <okaya@codeaurora.org> - 2016-06-29 20:50 +0200
      Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-29 23:20 +0200
        Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-29 23:30 +0200
        Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-29 23:50 +0200
        Re: [PATCH V2 1/4] ACPI,PCI,IRQ: factor in PCI possible Sinan Kaya <okaya@codeaurora.org> - 2016-06-30 00:20 +0200

csiph-web