[git patch] free_irq() fixes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff Garzik
Date: Tuesday, April 22, 2008 - 3:17 pm

Please pull from 'irq-fixes' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git irq-fixes

to receive the following updates:

 arch/arm/mach-integrator/time.c |    4 ++--
 drivers/char/mwave/tp3780i.c    |   13 +++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

Jeff Garzik (1):
      arm/mach-integrator, char/mwave: fix request_irq/free_irq mismatch

diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c
index 5235f64..28726ee 100644
--- a/arch/arm/mach-integrator/time.c
+++ b/arch/arm/mach-integrator/time.c
@@ -137,7 +137,7 @@ static int rtc_probe(struct amba_device *dev, void *id)
 	return 0;
 
  irq_out:
-	free_irq(dev->irq[0], dev);
+	free_irq(dev->irq[0], NULL);
  map_out:
 	iounmap(rtc_base);
 	rtc_base = NULL;
@@ -153,7 +153,7 @@ static int rtc_remove(struct amba_device *dev)
 
 	writel(0, rtc_base + RTC_CR);
 
-	free_irq(dev->irq[0], dev);
+	free_irq(dev->irq[0], NULL);
 	unregister_rtc(&rtc_ops);
 
 	iounmap(rtc_base);
diff --git a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
index 37fe80d..5681c01 100644
--- a/drivers/char/mwave/tp3780i.c
+++ b/drivers/char/mwave/tp3780i.c
@@ -274,7 +274,8 @@ int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData)
 	release_region(pSettings->usDspBaseIO & (~3), 16);
 
 	if (pSettings->bInterruptClaimed) {
-		free_irq(pSettings->usDspIrq, NULL);
+		free_irq(pSettings->usDspIrq,
+			 (void *)(unsigned long) pSettings->usDspIrq);
 		pSettings->bInterruptClaimed = FALSE;
 	}
 
@@ -365,12 +366,14 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
 	pSettings->bPllBypass = TP_CFG_PllBypass;
 	pSettings->usChipletEnable = TP_CFG_ChipletEnable;
 
+	/* FIXME: this is a racy way to verify irq conflict does not exist */
 	if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart",
 			(void *)(unsigned long) pSettings->usUartIrq)) {
 		PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
 		goto exit_cleanup;
 	} else {		/* no conflict just release */
-		free_irq(pSettings->usUartIrq, NULL);
+		free_irq(pSettings->usUartIrq,
+			 (void *)(unsigned long) pSettings->usUartIrq);
 	}
 
 	if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i",
@@ -411,7 +414,8 @@ exit_cleanup:
 	if (bDSPPoweredUp)
 		smapi_set_DSP_power_state(FALSE);
 	if (bInterruptAllocated) {
-		free_irq(pSettings->usDspIrq, NULL);
+		free_irq(pSettings->usDspIrq,
+			 (void *)(unsigned long) pSettings->usDspIrq);
 		pSettings->bInterruptClaimed = FALSE;
 	}
 	return -EIO;
@@ -428,7 +432,8 @@ int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData)
 	if (pBDData->bDSPEnabled) {
 		dsp3780I_DisableDSP(&pBDData->rDspSettings);
 		if (pSettings->bInterruptClaimed) {
-			free_irq(pSettings->usDspIrq, NULL);
+			free_irq(pSettings->usDspIrq,
+				 (void *)(unsigned long) pSettings->usDspIrq);
 			pSettings->bInterruptClaimed = FALSE;
 		}
 		smapi_set_DSP_power_state(FALSE);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git patch] free_irq() fixes, Jeff Garzik, (Tue Apr 22, 3:17 pm)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Tue Apr 22, 3:25 pm)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Tue Apr 22, 3:59 pm)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Tue Apr 22, 4:20 pm)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Tue Apr 22, 4:49 pm)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Tue Apr 22, 4:52 pm)
Re: [git patch] free_irq() fixes, Adrian Bunk, (Tue Apr 22, 5:05 pm)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Tue Apr 22, 5:16 pm)
Re: [git patch] free_irq() fixes, Rene Herman, (Wed Apr 23, 6:51 am)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Wed Apr 23, 7:10 pm)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Wed Apr 23, 7:19 pm)
Re: [git patch] free_irq() fixes, Eric W. Biederman, (Wed Apr 23, 10:59 pm)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Thu Apr 24, 3:53 am)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Thu Apr 24, 8:16 am)
Re: [git patch] free_irq() fixes, Alan Cox, (Thu Apr 24, 8:37 am)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Thu Apr 24, 8:40 am)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Thu Apr 24, 8:55 am)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Thu Apr 24, 9:16 am)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Thu Apr 24, 9:20 am)
Re: [git patch] free_irq() fixes, Eric W. Biederman, (Thu Apr 24, 9:48 am)
Re: [git patch] free_irq() fixes, Linus Torvalds, (Thu Apr 24, 9:58 am)
Re: [git patch] free_irq() fixes, Jeff Garzik, (Thu Apr 24, 10:30 am)
Re: [git patch] free_irq() fixes, Eric W. Biederman, (Thu Apr 24, 11:15 am)
Re: [git patch] free_irq() fixes, Eric W. Biederman, (Thu Apr 24, 7:53 pm)
Re: MSI, fun for the whole family, Roland Dreier, (Thu Apr 24, 8:57 pm)
Re: MSI, fun for the whole family, David Miller, (Thu Apr 24, 9:19 pm)
Re: MSI, fun for the whole family, Jeff Garzik, (Thu Apr 24, 9:35 pm)
Re: MSI, fun for the whole family, Eric W. Biederman, (Thu Apr 24, 10:08 pm)
Re: MSI, fun for the whole family, Eric W. Biederman, (Thu Apr 24, 10:48 pm)
Re: MSI, fun for the whole family, Roland Dreier, (Fri Apr 25, 3:44 pm)