[sparc64] Make prom entry spinlock NMI safe (Closes: #572442)

svn path=/dists/sid/linux-2.6/; revision=15321
This commit is contained in:
Ben Hutchings 2010-03-04 23:13:16 +00:00
parent fe30fac8d0
commit 199f5f061a
3 changed files with 47 additions and 0 deletions

1
debian/changelog vendored
View File

@ -26,6 +26,7 @@ linux-2.6 (2.6.32-10) UNRELEASED; urgency=low
- MSI is disabled on QLA24xx chips other than QLA2432 (MSI-X already was)
- MSI-X is disabled if qlx2enablemsix=2
- MSI and MSI-X are disabled if qlx2enablemsix=0
* [sparc64] Make prom entry spinlock NMI safe (Closes: #572442)
-- maximilian attems <maks@debian.org> Thu, 25 Feb 2010 13:07:47 +0100

View File

@ -0,0 +1,45 @@
From: David S. Miller <davem@davemloft.net>
Subject: [PATCH] sparc64: Make prom entry spinlock NMI safe.
If we do something like try to print to the OF console from an NMI
while we're already in OpenFirmware, we'll deadlock on the spinlock.
Disable NMIs when we take it.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c
index 4b7c937..815cab6 100644
--- a/arch/sparc/prom/p1275.c
+++ b/arch/sparc/prom/p1275.c
@@ -32,8 +32,7 @@ extern void prom_cif_interface(void);
extern void prom_cif_callback(void);
/*
- * This provides SMP safety on the p1275buf. prom_callback() drops this lock
- * to allow recursuve acquisition.
+ * This provides SMP safety on the p1275buf.
*/
DEFINE_SPINLOCK(prom_entry_lock);
@@ -47,7 +46,9 @@ long p1275_cmd(const char *service, long fmt, ...)
p = p1275buf.prom_buffer;
- spin_lock_irqsave(&prom_entry_lock, flags);
+ raw_local_save_flags(flags);
+ raw_local_irq_restore(PIL_NMI);
+ spin_lock(&prom_entry_lock);
p1275buf.prom_args[0] = (unsigned long)p; /* service */
strcpy (p, service);
@@ -139,7 +140,8 @@ long p1275_cmd(const char *service, long fmt, ...)
va_end(list);
x = p1275buf.prom_args [nargs + 3];
- spin_unlock_irqrestore(&prom_entry_lock, flags);
+ spin_unlock(&prom_entry_lock);
+ raw_local_irq_restore(flags);
return x;
}

View File

@ -10,3 +10,4 @@
+ features/all/i915-autoload-without-CONFIG_DRM_I915_KMS-2.patch
+ features/all/radeon-autoload-without-CONFIG_DRM_RADEON_KMS.patch
+ bugfix/all/qla2xxx-disable-broken-msi.patch
+ bugfix/sparc/sparc64-Make-prom-entry-spinlock-NMI-safe.patch