Skip to content

Commit 3515d01

Browse files
Al ViroLinus Torvalds
authored andcommitted
[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 <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Ben Collins <bcollins@debian.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent a46206e commit 3515d01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/ieee1394/ohci1394.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ static void ohci_initialize(struct ti_ohci *ohci)
478478
int num_ports, i;
479479

480480
spin_lock_init(&ohci->phy_reg_lock);
481-
spin_lock_init(&ohci->event_lock);
482481

483482
/* Put some defaults to these undefined bus options */
484483
buf = reg_read(ohci, OHCI1394_BusOptions);
@@ -3402,7 +3401,14 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
34023401
/* We hopefully don't have to pre-allocate IT DMA like we did
34033402
* for IR DMA above. Allocate it on-demand and mark inactive. */
34043403
ohci->it_legacy_context.ohci = NULL;
3404+
spin_lock_init(&ohci->event_lock);
34053405

3406+
/*
3407+
* interrupts are disabled, all right, but... due to SA_SHIRQ we
3408+
* might get called anyway. We'll see no event, of course, but
3409+
* we need to get to that "no event", so enough should be initialized
3410+
* by that point.
3411+
*/
34063412
if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ,
34073413
OHCI1394_DRIVER_NAME, ohci))
34083414
FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);

0 commit comments

Comments
 (0)