public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Suresh Siddha <suresh.b.siddha@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	daniel.blueman@gmail.com, suresh.b.siddha@intel.com,
	tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/apic] x86, ioapic: Remove duplicate code for saving/restoring RTEs
Date: Fri, 20 May 2011 13:38:21 GMT	[thread overview]
Message-ID: <tip-15bac20bd8a039e9acb274785be82772e1237eed@git.kernel.org> (raw)
In-Reply-To: <20110518233157.673130611@sbsiddha-MOBL3.sc.intel.com>

Commit-ID:  15bac20bd8a039e9acb274785be82772e1237eed
Gitweb:     http://git.kernel.org/tip/15bac20bd8a039e9acb274785be82772e1237eed
Author:     Suresh Siddha <suresh.b.siddha@intel.com>
AuthorDate: Wed, 18 May 2011 16:31:34 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 20 May 2011 13:40:54 +0200

x86, ioapic: Remove duplicate code for saving/restoring RTEs

Code flow for enabling interrupt-remapping has its own routines
for saving and restoring io-apic RTE's. ioapic suspend/resume
code flow also has similar routines. Remove the duplicate code.

Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/20110518233157.673130611@sbsiddha-MOBL3.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/apic/io_apic.c |   36 +++++-------------------------------
 1 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 08b794d..4fc544d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2887,37 +2887,11 @@ static int __init io_apic_bug_finalize(void)
 
 late_initcall(io_apic_bug_finalize);
 
-static void suspend_ioapic(int ioapic_id)
+static void resume_ioapic_id(int ioapic_id)
 {
-	struct IO_APIC_route_entry *saved_data = ioapic_saved_data[ioapic_id];
-	int i;
-
-	if (!saved_data)
-		return;
-
-	for (i = 0; i < nr_ioapic_registers[ioapic_id]; i++)
-		saved_data[i] = ioapic_read_entry(ioapic_id, i);
-}
-
-static int ioapic_suspend(void)
-{
-	int ioapic_id;
-
-	for (ioapic_id = 0; ioapic_id < nr_ioapics; ioapic_id++)
-		suspend_ioapic(ioapic_id);
-
-	return 0;
-}
-
-static void resume_ioapic(int ioapic_id)
-{
-	struct IO_APIC_route_entry *saved_data = ioapic_saved_data[ioapic_id];
 	unsigned long flags;
 	union IO_APIC_reg_00 reg_00;
-	int i;
 
-	if (!saved_data)
-		return;
 
 	raw_spin_lock_irqsave(&ioapic_lock, flags);
 	reg_00.raw = io_apic_read(ioapic_id, 0);
@@ -2926,8 +2900,6 @@ static void resume_ioapic(int ioapic_id)
 		io_apic_write(ioapic_id, 0, reg_00.raw);
 	}
 	raw_spin_unlock_irqrestore(&ioapic_lock, flags);
-	for (i = 0; i < nr_ioapic_registers[ioapic_id]; i++)
-		ioapic_write_entry(ioapic_id, i, saved_data[i]);
 }
 
 static void ioapic_resume(void)
@@ -2935,11 +2907,13 @@ static void ioapic_resume(void)
 	int ioapic_id;
 
 	for (ioapic_id = nr_ioapics - 1; ioapic_id >= 0; ioapic_id--)
-		resume_ioapic(ioapic_id);
+		resume_ioapic_id(ioapic_id);
+
+	restore_ioapic_entries();
 }
 
 static struct syscore_ops ioapic_syscore_ops = {
-	.suspend = ioapic_suspend,
+	.suspend = save_ioapic_entries,
 	.resume = ioapic_resume,
 };
 

  reply	other threads:[~2011-05-20 13:38 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-bot for Suresh Siddha [this message]
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 ` [patch 6/9] x86, ioapic: conslidate ioapic_saved_data[] into " Suresh Siddha
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=tip-15bac20bd8a039e9acb274785be82772e1237eed@git.kernel.org \
    --to=suresh.b.siddha@intel.com \
    --cc=daniel.blueman@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --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