mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, daniel.blueman@gmail.com,
	suresh.b.siddha@intel.com
Subject: [patch 6/9] x86, ioapic: conslidate ioapic_saved_data[] into struct ioapic
Date: Wed, 18 May 2011 16:31:36 -0700	[thread overview]
Message-ID: <20110518233157.830697056@sbsiddha-MOBL3.sc.intel.com> (raw)
In-Reply-To: <20110518233130.524634928@sbsiddha-MOBL3.sc.intel.com>

[-- Attachment #1: move_saved_data_to_ioapic_struct.patch --]
[-- Type: text/plain, Size: 2904 bytes --]

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 arch/x86/kernel/apic/io_apic.c |   27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
@@ -81,6 +81,10 @@ static struct ioapic {
 	 * # of IRQ routing registers
 	 */
 	int nr_registers;
+	/*
+	 * Saved state during suspend/resume, or while enabling intr-remap.
+	 */
+	struct IO_APIC_route_entry *saved_registers;
 } ioapics[MAX_IO_APICS];
 
 /* I/O APIC entries */
@@ -102,11 +106,6 @@ int mp_irq_entries;
 /* GSI interrupts */
 static int nr_irqs_gsi = NR_IRQS_LEGACY;
 
-/*
- * Saved I/O APIC state during suspend/resume, or while enabling intr-remap.
-*/
-static struct IO_APIC_route_entry *ioapic_saved_data[MAX_IO_APICS];
-
 #if defined (CONFIG_MCA) || defined (CONFIG_EISA)
 int mp_bus_id_to_type[MAX_MP_BUSSES];
 #endif
@@ -187,10 +186,10 @@ int __init arch_early_irq_init(void)
 	}
 
 	for (i = 0; i < nr_ioapics; i++) {
-		ioapic_saved_data[i] =
+		ioapics[i].saved_registers =
 			kzalloc(sizeof(struct IO_APIC_route_entry) *
 				ioapics[i].nr_registers, GFP_KERNEL);
-		if (!ioapic_saved_data[i])
+		if (!ioapics[i].saved_registers)
 			pr_err("IOAPIC %d: suspend/resume impossible!\n", i);
 	}
 
@@ -639,13 +638,13 @@ int save_ioapic_entries(void)
 	int err = 0;
 
 	for (apic = 0; apic < nr_ioapics; apic++) {
-		if (!ioapic_saved_data[apic]) {
+		if (!ioapics[apic].saved_registers) {
 			err = -ENOMEM;
 			continue;
 		}
 
 		for (pin = 0; pin < ioapics[apic].nr_registers; pin++)
-			ioapic_saved_data[apic][pin] =
+			ioapics[apic].saved_registers[pin] =
 				ioapic_read_entry(apic, pin);
 	}
 
@@ -660,13 +659,13 @@ void mask_ioapic_entries(void)
 	int apic, pin;
 
 	for (apic = 0; apic < nr_ioapics; apic++) {
-		if (!ioapic_saved_data[apic])
+		if (ioapics[apic].saved_registers)
 			continue;
 
 		for (pin = 0; pin < ioapics[apic].nr_registers; pin++) {
 			struct IO_APIC_route_entry entry;
 
-			entry = ioapic_saved_data[apic][pin];
+			entry = ioapics[apic].saved_registers[pin];
 			if (!entry.mask) {
 				entry.mask = 1;
 				ioapic_write_entry(apic, pin, entry);
@@ -676,19 +675,19 @@ void mask_ioapic_entries(void)
 }
 
 /*
- * Restore IO APIC entries which was saved in ioapic_saved_data
+ * Restore IO APIC entries which was saved in the ioapic structure.
  */
 int restore_ioapic_entries(void)
 {
 	int apic, pin;
 
 	for (apic = 0; apic < nr_ioapics; apic++) {
-		if (!ioapic_saved_data[apic])
+		if (ioapics[apic].saved_registers)
 			continue;
 
 		for (pin = 0; pin < ioapics[apic].nr_registers; pin++)
 			ioapic_write_entry(apic, pin,
-					   ioapic_saved_data[apic][pin]);
+					   ioapics[apic].saved_registers[pin]);
 	}
 	return 0;
 }



  parent reply	other threads:[~2011-05-18 23:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 23:31 [patch 0/9] x86: ioapic cleanups Suresh Siddha
2011-05-18 23:31 ` [patch 1/9] x86, ioapic: fix potential resume deadlock Suresh Siddha
2011-05-20  4:09   ` Chuck Ebbert
2011-05-20 13:36   ` [tip:x86/apic] x86, ioapic: Fix " tip-bot for Daniel J Blueman
2011-05-18 23:31 ` [patch 2/9] x86, ioapic: allocate ioapic_saved_data early Suresh Siddha
2011-05-20 13:37   ` [tip:x86/apic] x86, ioapic: Allocate " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 3/9] x86, ioapic: use ioapic_saved_data while enabling intr-remapping Suresh Siddha
2011-05-20 13:37   ` [tip:x86/apic] x86, ioapic: Use " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 4/9] x86, ioapic: remove duplicate code for saving/restoring RTEs Suresh Siddha
2011-05-20 13:38   ` [tip:x86/apic] x86, ioapic: Remove " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 5/9] x86, ioapic: add struct ioapic Suresh Siddha
2011-05-20 13:38   ` [tip:x86/apic] x86, ioapic: Add " tip-bot for Suresh Siddha
2011-05-18 23:31 ` Suresh Siddha [this message]
2011-05-20 13:39   ` [tip:x86/apic] x86, ioapic: Consolidate ioapic_saved_data[] into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 7/9] x86, ioapic: consolidate mp_ioapics into struct ioapic Suresh Siddha
2011-05-20 13:39   ` [tip:x86/apic] x86, ioapic: Consolidate mp_ioapics[] into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 8/9] x86, ioapic: consolidate gsi routing info into struct ioapic Suresh Siddha
2011-05-20 13:40   ` [tip:x86/apic] x86, ioapic: Consolidate gsi routing info into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 9/9] x86, ioapic: consolidate mp_ioapic_routing[] into struct ioapic Suresh Siddha
2011-05-20 13:40   ` [tip:x86/apic] x86, ioapic: Consolidate mp_ioapic_routing[] into 'struct ioapic' tip-bot for Suresh Siddha

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=20110518233157.830697056@sbsiddha-MOBL3.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=daniel.blueman@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®