summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2009-05-13 09:53:08 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-19 07:14:59 +0400
commit50bcb4aefe382df28031867e16a0a8d1dfb39c94 (patch)
treec193f4e2f1795e0d7af6666f3828e88b48598360 /drivers/media
parentc303e3e10a7aad1a54946dd060078224e3f1327d (diff)
downloadlinux-50bcb4aefe382df28031867e16a0a8d1dfb39c94.tar.xz
V4L/DVB (12933): SAA7164: Fix IRQ related system hang when firmware is not found.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index 0f3ebcdef126..2fbf4204cd5c 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -119,8 +119,7 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_tsport *port)
static irqreturn_t saa7164_irq(int irq, void *dev_id)
{
struct saa7164_dev *dev = dev_id;
- u32 hwacc = 0, interruptid;
- u32 intstat[INT_SIZE/4];
+ u32 intid, intstat[INT_SIZE/4];
int i, handled = 0, bit;
if (dev == 0) {
@@ -140,15 +139,11 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
/* Read the 4 hardware interrupt registers */
intstat[i] = saa7164_readl(dev->int_status + (i * 4));
- if (intstat[i] != 0xffffffff)
- hwacc = 1;
+ if (intstat[i])
+ handled = 1;
}
- if (hwacc == 0) {
- handled = 0;
+ if (handled == 0)
goto out;
- }
-
- handled = 1;
/* For each of the HW interrupt registers */
for (i = 0; i < INT_SIZE/4; i++) {
@@ -165,17 +160,17 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
/* Calculate the interrupt id (0x00 to 0x7f) */
- interruptid = (i * 32) + bit;
- if (interruptid == dev->intfdesc.bInterruptId) {
+ intid = (i * 32) + bit;
+ if (intid == dev->intfdesc.bInterruptId) {
/* A response to an cmd/api call */
schedule_work(&dev->workcmd);
- } else if (interruptid ==
+ } else if (intid ==
dev->ts1.hwcfg.interruptid) {
/* Transport path 1 */
saa7164_irq_ts(&dev->ts1);
- } else if (interruptid ==
+ } else if (intid ==
dev->ts2.hwcfg.interruptid) {
/* Transport path 2 */
@@ -187,7 +182,7 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
"%s() unhandled interrupt "
"reg 0x%x bit 0x%x "
"intid = 0x%x\n",
- __func__, i, bit, interruptid);
+ __func__, i, bit, intid);
}
}
@@ -598,8 +593,9 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
err = saa7164_downloadfirmware(dev);
if (err < 0) {
printk(KERN_ERR
- "Failed to boot firmware, cannot continue\n");
- goto fail_irq;
+ "Failed to boot firmware, no features "
+ "registered\n");
+ goto fail_fw;
}
saa7164_get_descriptors(dev);
@@ -666,6 +662,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
printk(KERN_ERR "%s() Unsupported board detected, "
"registering without firmware\n", __func__);
+fail_fw:
return 0;
fail_irq: