* [PATCH] [POWERPC] iSeries: don't printk with HV spinlock held.
@ 2007-12-12 3:58 Stephen Rothwell
0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2007-12-12 3:58 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Printk was observed to hang during module unload due to a limited
window of characters that may be sent to the hypervisor. The window
only reexpands when we receive an ack from the HV and the spinlock here
prevents us from ever processing that ack.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/lpevents.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
Paul, this would be nice for 2.6.24 if at all possible.
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index 02c1422..e5b40e3 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -121,6 +121,7 @@ void process_hvlpevents(void)
{
struct HvLpEvent * event;
+ restart:
/* If we have recursed, just return */
if (!spin_trylock(&hvlpevent_queue.hq_lock))
return;
@@ -146,8 +147,20 @@ void process_hvlpevents(void)
if (event->xType < HvLpEvent_Type_NumTypes &&
lpEventHandler[event->xType])
lpEventHandler[event->xType](event);
- else
- printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType );
+ else {
+ u8 type = event->xType;
+
+ /*
+ * Don't printk in the spinlock as printk
+ * may require ack events form the HV to send
+ * any characters there.
+ */
+ hvlpevent_clear_valid(event);
+ spin_unlock(&hvlpevent_queue.hq_lock);
+ printk(KERN_INFO
+ "Unexpected Lp Event type=%d\n", type);
+ goto restart;
+ }
hvlpevent_clear_valid(event);
} else if (hvlpevent_queue.hq_overflow_pending)
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-12 3:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12 3:58 [PATCH] [POWERPC] iSeries: don't printk with HV spinlock held Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox