Commit 3515d016 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

[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: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarBen Collins <bcollins@debian.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a46206e7
...@@ -478,7 +478,6 @@ static void ohci_initialize(struct ti_ohci *ohci) ...@@ -478,7 +478,6 @@ static void ohci_initialize(struct ti_ohci *ohci)
int num_ports, i; int num_ports, i;
spin_lock_init(&ohci->phy_reg_lock); spin_lock_init(&ohci->phy_reg_lock);
spin_lock_init(&ohci->event_lock);
/* Put some defaults to these undefined bus options */ /* Put some defaults to these undefined bus options */
buf = reg_read(ohci, OHCI1394_BusOptions); buf = reg_read(ohci, OHCI1394_BusOptions);
...@@ -3402,7 +3401,14 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev, ...@@ -3402,7 +3401,14 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
/* We hopefully don't have to pre-allocate IT DMA like we did /* We hopefully don't have to pre-allocate IT DMA like we did
* for IR DMA above. Allocate it on-demand and mark inactive. */ * for IR DMA above. Allocate it on-demand and mark inactive. */
ohci->it_legacy_context.ohci = NULL; 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, if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ,
OHCI1394_DRIVER_NAME, ohci)) OHCI1394_DRIVER_NAME, ohci))
FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq); FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment