Skip to contentSkip to conversation

Staging: vme: Add syncronize interrupts before removing callback

PATCH Superseded Martyn Welch 1 participant 2 messages Aug 11, 2009 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Staging: vme: Add syncronize interrupts before removing callback

As identified by Jiri, there is no syncronisation before callback is removed.

---

Jiri: Thanks once again. The pointer is checked before it is called, but I guess their is a slim chance that we could try to jump to a null pointer, so this probably makes sense.

 drivers/staging/vme/bridges/vme_tsi148.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/staging/vme/bridges/vme_tsi148.c +5 -0
index cdc2919..e4bf430 100644
@@ -480,6 +480,7 @@ int tsi148_request_irq(int level, int statid,
 void tsi148_free_irq(int level, int statid)
 {
 	u32 tmp;
+	struct pci_dev pdev;
 
 	/* Get semaphore */
 	down(&(vme_irq));
@@ -495,6 +496,10 @@ void tsi148_free_irq(int level, int statid)
 		tmp = ioread32be(tsi148_bridge->base + TSI148_LCSR_INTEO);
 		tmp &= ~TSI148_LCSR_INTEO_IRQEO[level - 1];
 		iowrite32be(tmp, tsi148_bridge->base + TSI148_LCSR_INTEO);
+
+		pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev);
+
+		synchronize_irq(pdev->irq);
 	}
 
 	tsi148_bridge->irq[level - 1].callback[statid].func = NULL;
#2 lore raw

PATCH v2 1/1 Staging: vme: Add syncronize interrupts before removing callback

In reply to a message not in the archive

As identified by Jiri, there is no syncronisation before callback is removed.

---

It generally pays to compile the correct tree when compile testing a patch...

v2: pdev should be a pointer.

 drivers/staging/vme/bridges/vme_tsi148.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/staging/vme/bridges/vme_tsi148.c +5 -0
index cdc2919..a4929ad 100644
@@ -480,6 +480,7 @@ int tsi148_request_irq(int level, int statid,
 void tsi148_free_irq(int level, int statid)
 {
 	u32 tmp;
+	struct pci_dev *pdev;
 
 	/* Get semaphore */
 	down(&(vme_irq));
@@ -495,6 +496,10 @@ void tsi148_free_irq(int level, int statid)
 		tmp = ioread32be(tsi148_bridge->base + TSI148_LCSR_INTEO);
 		tmp &= ~TSI148_LCSR_INTEO_IRQEO[level - 1];
 		iowrite32be(tmp, tsi148_bridge->base + TSI148_LCSR_INTEO);
+
+		pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev);
+
+		synchronize_irq(pdev->irq);
 	}
 
 	tsi148_bridge->irq[level - 1].callback[statid].func = NULL;