Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f949820de30b6fd0eb958f7eea87dac190de1cec
Commit:     f949820de30b6fd0eb958f7eea87dac190de1cec
Parent:     a34a8751f312bd4674d48d63556efa8f0e3a1021
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 00:32:35 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Oct 20 00:32:35 2007 +0200

    qd65xx: fix deadlock on error handling
    
    Stop abusing ide_lock lock (switch to a private locking).
    
    Fixes same issue as fixed by Alan Cox in atiixp host driver with
    commit 6c5f8cc33eb2e10b6ab788bbe259fc142a068627.
    
    Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/legacy/qd65xx.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 85104bc..ffd9c05 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -89,13 +89,15 @@
 
 static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
 
+static DEFINE_SPINLOCK(qd65xx_lock);
+
 static void qd_write_reg (u8 content, unsigned long reg)
 {
        unsigned long flags;
 
-       spin_lock_irqsave(&ide_lock, flags);
+       spin_lock_irqsave(&qd65xx_lock, flags);
        outb(content,reg);
-       spin_unlock_irqrestore(&ide_lock, flags);
+       spin_unlock_irqrestore(&qd65xx_lock, flags);
 }
 
 static u8 __init qd_read_reg (unsigned long reg)
@@ -103,9 +105,9 @@ static u8 __init qd_read_reg (unsigned long reg)
        unsigned long flags;
        u8 read;
 
-       spin_lock_irqsave(&ide_lock, flags);
+       spin_lock_irqsave(&qd65xx_lock, flags);
        read = inb(reg);
-       spin_unlock_irqrestore(&ide_lock, flags);
+       spin_unlock_irqrestore(&qd65xx_lock, flags);
        return read;
 }
 
@@ -301,16 +303,15 @@ static void qd6580_set_pio_mode(ide_drive_t *drive, const 
u8 pio)
 
 static int __init qd_testreg(int port)
 {
-       u8 savereg;
-       u8 readreg;
        unsigned long flags;
+       u8 savereg, readreg;
 
-       spin_lock_irqsave(&ide_lock, flags);
+       spin_lock_irqsave(&qd65xx_lock, flags);
        savereg = inb_p(port);
        outb_p(QD_TESTVAL, port);       /* safe value */
        readreg = inb_p(port);
        outb(savereg, port);
-       spin_unlock_irqrestore(&ide_lock, flags);
+       spin_unlock_irqrestore(&qd65xx_lock, flags);
 
        if (savereg == QD_TESTVAL) {
                printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable 
!\n");
-
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