Skip to contentSkip to conversation

b2c2-flexcop-pci spinlock lock problem fix

PATCH New Borgi2008 1 participant 1 message Apr 4, 2007 Media (V4L/DVB)

lore
Share & tools
lore

Borgi2008

author
#0 lore raw

PATCH 1/1 b2c2-flexcop-pci spinlock lock problem fix

Hello,

i've created a small patch for the current kernel version which fixes a bug in the DVB driver for b2c2-flexcop based pci devices. During initialization of the pci device spin_lock_irq is called before spin_lock_init. I've also created a bugreport in bugzilla:
http://bugzilla.kernel.org/show_bug.cgi?id=8301 . It would be nice if someone could check this patch and perhaps apply it.

Hendrik Borghorst

[email protected]

Quoted 1 line

From Hendrik Borghorst ([email protected])

drivers/media/dvb/b2c2/flexcop-pci.c renamed from drivers/media/dvb/b2c2/flexcop-pci.c.org +5 -4
@@ -127,10 +127,11 @@
 {
 	struct flexcop_pci *fc_pci = dev_id;
 	struct flexcop_device *fc = fc_pci->fc_dev;
+	unsigned long flags;
 	flexcop_ibi_value v;
 	irqreturn_t ret = IRQ_HANDLED;
 
-	spin_lock_irq(&fc_pci->irq_lock);
+	spin_lock_irqsave(&fc_pci->irq_lock,flags);
 
 	v = fc->read_ibi_reg(fc,irq_20c);
 
@@ -194,7 +195,7 @@
 		ret = IRQ_NONE;
 	}
 
-	spin_unlock_irq(&fc_pci->irq_lock);
+	spin_unlock_irqrestore(&fc_pci->irq_lock,flags);
 
 	return ret;
 }
@@ -293,12 +294,12 @@
 	}
 
 	pci_set_drvdata(fc_pci->pdev, fc_pci);
-
+	spin_lock_init(&fc_pci->irq_lock);
 	if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr,
 					IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
 		goto err_pci_iounmap;
 
-	spin_lock_init(&fc_pci->irq_lock);
+
 
 	fc_pci->init_state |= FC_PCI_INIT;
 	return ret;