diff options
author | Johannes Stezenbach <js@linuxtv.org> | 2005-05-17 00:54:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:25 -0400 |
commit | 4853f16ad881194ec4c49f73287ef1999b2585ea (patch) | |
tree | 6fff14e79a6ec535bc0d3c237d68b4aeea45fe24 /drivers/media | |
parent | 778241313819e17de3bdf91523c724b4704402c6 (diff) |
[PATCH] dvb: flexcop: fixed interrupt-sharing
fixed interrupt-sharing and added a spinlock to the irq-callback
(thanks to Pascal Riekenberg)
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-pci.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c index 693af41f3370..c52286ea669f 100644 --- a/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/drivers/media/dvb/b2c2/flexcop-pci.c | |||
@@ -53,6 +53,8 @@ struct flexcop_pci { | |||
53 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ | 53 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ |
54 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ | 54 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ |
55 | 55 | ||
56 | spinlock_t irq_lock; | ||
57 | |||
56 | struct flexcop_device *fc_dev; | 58 | struct flexcop_device *fc_dev; |
57 | }; | 59 | }; |
58 | 60 | ||
@@ -93,6 +95,9 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
93 | struct flexcop_pci *fc_pci = dev_id; | 95 | struct flexcop_pci *fc_pci = dev_id; |
94 | struct flexcop_device *fc = fc_pci->fc_dev; | 96 | struct flexcop_device *fc = fc_pci->fc_dev; |
95 | flexcop_ibi_value v = fc->read_ibi_reg(fc,irq_20c); | 97 | flexcop_ibi_value v = fc->read_ibi_reg(fc,irq_20c); |
98 | irqreturn_t ret = IRQ_HANDLED; | ||
99 | |||
100 | spin_lock_irq(&fc_pci->irq_lock); | ||
96 | 101 | ||
97 | deb_irq("irq: %08x cur_addr: %08x (%d), our addrs. 1: %08x 2: %08x; 0x000: " | 102 | deb_irq("irq: %08x cur_addr: %08x (%d), our addrs. 1: %08x 2: %08x; 0x000: " |
98 | "%08x, 0x00c: %08x\n",v.raw, | 103 | "%08x, 0x00c: %08x\n",v.raw, |
@@ -102,6 +107,7 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
102 | fc->read_ibi_reg(fc,dma1_000).raw, | 107 | fc->read_ibi_reg(fc,dma1_000).raw, |
103 | fc->read_ibi_reg(fc,dma1_00c).raw); | 108 | fc->read_ibi_reg(fc,dma1_00c).raw); |
104 | 109 | ||
110 | |||
105 | if (v.irq_20c.DMA1_IRQ_Status == 1) { | 111 | if (v.irq_20c.DMA1_IRQ_Status == 1) { |
106 | if (fc_pci->active_dma1_addr == 0) | 112 | if (fc_pci->active_dma1_addr == 0) |
107 | flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr0,fc_pci->dma[0].size / 188); | 113 | flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr0,fc_pci->dma[0].size / 188); |
@@ -134,14 +140,17 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
134 | } | 140 | } |
135 | 141 | ||
136 | fc_pci->last_dma1_cur_pos = cur_pos; | 142 | fc_pci->last_dma1_cur_pos = cur_pos; |
137 | } | 143 | } else |
144 | ret = IRQ_NONE; | ||
145 | |||
146 | spin_unlock_irq(&fc_pci->irq_lock); | ||
138 | 147 | ||
139 | /* packet count would be ideal for hw filtering, but it isn't working. Either | 148 | /* packet count would be ideal for hw filtering, but it isn't working. Either |
140 | * the data book is wrong, or I'm unable to read it correctly */ | 149 | * the data book is wrong, or I'm unable to read it correctly */ |
141 | 150 | ||
142 | /* if (v.irq_20c.DMA1_Size_IRQ_Status == 1) { packet counter */ | 151 | /* if (v.irq_20c.DMA1_Size_IRQ_Status == 1) { packet counter */ |
143 | 152 | ||
144 | return IRQ_HANDLED; | 153 | return ret; |
145 | } | 154 | } |
146 | 155 | ||
147 | static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff) | 156 | static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff) |
@@ -240,6 +249,8 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) | |||
240 | SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0) | 249 | SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0) |
241 | goto err_pci_iounmap; | 250 | goto err_pci_iounmap; |
242 | 251 | ||
252 | spin_lock_init(&fc_pci->irq_lock); | ||
253 | |||
243 | fc_pci->init_state |= FC_PCI_INIT; | 254 | fc_pci->init_state |= FC_PCI_INIT; |
244 | goto success; | 255 | goto success; |
245 | 256 | ||