Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=88f0178e6ec2c73167de973e4af86905b4dbfd45
Commit:     88f0178e6ec2c73167de973e4af86905b4dbfd45
Parent:     da8cadb31b82c9d41fc593c8deab6aa20b162d6b
Author:     Stephen Rothwell <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 14:58:12 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Dec 14 15:50:46 2007 +1100

    [POWERPC] iSeries: don't printk with HV spinlock held
    
    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.  This fixes it by dropping
    the lock before doing the printk, then looping back to the top to
    reacquire the lock.
    
    Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/iseries/lpevents.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/lpevents.c 
b/arch/powerpc/platforms/iseries/lpevents.c
index 34bdbbe..275f494 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to