tree 986c5aa31761cbc186b4de7b410d539633f5ceb1
parent a46206e74e1897bf34d6b58f0991a0d6f3797e27
author Al Viro <[EMAIL PROTECTED]> Thu, 25 Aug 2005 23:13:14 +0100
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 27 Aug 2005 06:30:30 -0700

[PATCH] late spinlock initialization in ieee1394/ohci

spinlock used in irq handler should be initialized before registering
irq, even if we know that our device has interrupts disabled; handler
is registered shared and taking spinlock is done unconditionally.  As
it is, we can and do get oopsen on boot for some configuration, depending
on irq routing - I've got a reproducer.

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Ben Collins <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/ieee1394/ohci1394.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -478,7 +478,6 @@ static void ohci_initialize(struct ti_oh
        int num_ports, i;
-       spin_lock_init(&ohci->event_lock);
        /* Put some defaults to these undefined bus options */
        buf = reg_read(ohci, OHCI1394_BusOptions);
@@ -3402,7 +3401,14 @@ static int __devinit ohci1394_pci_probe(
        /* We hopefully don't have to pre-allocate IT DMA like we did
         * for IR DMA above. Allocate it on-demand and mark inactive. */
        ohci->it_legacy_context.ohci = NULL;
+       spin_lock_init(&ohci->event_lock);
+       /*
+        * interrupts are disabled, all right, but... due to SA_SHIRQ we
+        * might get called anyway.  We'll see no event, of course, but
+        * we need to get to that "no event", so enough should be initialized
+        * by that point.
+        */
        if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ,
                         OHCI1394_DRIVER_NAME, ohci))
                FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", 
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

Reply via email to