aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2009-05-13 01:53:08 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:14:59 -0400
commit50bcb4aefe382df28031867e16a0a8d1dfb39c94 (patch)
treec193f4e2f1795e0d7af6666f3828e88b48598360 /drivers
parentc303e3e10a7aad1a54946dd060078224e3f1327d (diff)
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')
-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)
119static irqreturn_t saa7164_irq(int irq, void *dev_id) 119static irqreturn_t saa7164_irq(int irq, void *dev_id)
120{ 120{
121 struct saa7164_dev *dev = dev_id; 121 struct saa7164_dev *dev = dev_id;
122 u32 hwacc = 0, interruptid; 122 u32 intid, intstat[INT_SIZE/4];
123 u32 intstat[INT_SIZE/4];
124 int i, handled = 0, bit; 123 int i, handled = 0, bit;
125 124
126 if (dev == 0) { 125 if (dev == 0) {
@@ -140,15 +139,11 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
140 /* Read the 4 hardware interrupt registers */ 139 /* Read the 4 hardware interrupt registers */
141 intstat[i] = saa7164_readl(dev->int_status + (i * 4)); 140 intstat[i] = saa7164_readl(dev->int_status + (i * 4));
142 141
143 if (intstat[i] != 0xffffffff) 142 if (intstat[i])
144 hwacc = 1; 143 handled = 1;
145 } 144 }
146 if (hwacc == 0) { 145 if (handled == 0)
147 handled = 0;
148 goto out; 146 goto out;
149 }
150
151 handled = 1;
152 147
153 /* For each of the HW interrupt registers */ 148 /* For each of the HW interrupt registers */
154 for (i = 0; i < INT_SIZE/4; i++) { 149 for (i = 0; i < INT_SIZE/4; i++) {
@@ -165,17 +160,17 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
165 160
166 /* Calculate the interrupt id (0x00 to 0x7f) */ 161 /* Calculate the interrupt id (0x00 to 0x7f) */
167 162
168 interruptid = (i * 32) + bit; 163 intid = (i * 32) + bit;
169 if (interruptid == dev->intfdesc.bInterruptId) { 164 if (intid == dev->intfdesc.bInterruptId) {
170 /* A response to an cmd/api call */ 165 /* A response to an cmd/api call */
171 schedule_work(&dev->workcmd); 166 schedule_work(&dev->workcmd);
172 } else if (interruptid == 167 } else if (intid ==
173 dev->ts1.hwcfg.interruptid) { 168 dev->ts1.hwcfg.interruptid) {
174 169
175 /* Transport path 1 */ 170 /* Transport path 1 */
176 saa7164_irq_ts(&dev->ts1); 171 saa7164_irq_ts(&dev->ts1);
177 172
178 } else if (interruptid == 173 } else if (intid ==
179 dev->ts2.hwcfg.interruptid) { 174 dev->ts2.hwcfg.interruptid) {
180 175
181 /* Transport path 2 */ 176 /* Transport path 2 */
@@ -187,7 +182,7 @@ static irqreturn_t saa7164_irq(int irq, void *dev_id)
187 "%s() unhandled interrupt " 182 "%s() unhandled interrupt "
188 "reg 0x%x bit 0x%x " 183 "reg 0x%x bit 0x%x "
189 "intid = 0x%x\n", 184 "intid = 0x%x\n",
190 __func__, i, bit, interruptid); 185 __func__, i, bit, intid);
191 } 186 }
192 } 187 }
193 188
@@ -598,8 +593,9 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
598 err = saa7164_downloadfirmware(dev); 593 err = saa7164_downloadfirmware(dev);
599 if (err < 0) { 594 if (err < 0) {
600 printk(KERN_ERR 595 printk(KERN_ERR
601 "Failed to boot firmware, cannot continue\n"); 596 "Failed to boot firmware, no features "
602 goto fail_irq; 597 "registered\n");
598 goto fail_fw;
603 } 599 }
604 600
605 saa7164_get_descriptors(dev); 601 saa7164_get_descriptors(dev);
@@ -666,6 +662,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
666 printk(KERN_ERR "%s() Unsupported board detected, " 662 printk(KERN_ERR "%s() Unsupported board detected, "
667 "registering without firmware\n", __func__); 663 "registering without firmware\n", __func__);
668 664
665fail_fw:
669 return 0; 666 return 0;
670 667
671fail_irq: 668fail_irq: