All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@linuxtv.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Patrick Boettcher <pb@linuxtv.org>
Subject: [DVB patch 06/11] flexcop: fixed interrupt-sharing
Date: Sat, 14 May 2005 00:00:25 +0200	[thread overview]
Message-ID: <20050513220225.655149000@abc> (raw)
In-Reply-To: 20050513220019.907667000@abc

[-- Attachment #1: dvb-flexcop-irq-fix.patch --]
[-- Type: text/plain, Size: 2353 bytes --]

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>
---

 drivers/media/dvb/b2c2/flexcop-pci.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

Index: linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-pci.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/b2c2/flexcop-pci.c	2005-05-12 01:30:04.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-pci.c	2005-05-12 01:30:40.000000000 +0200
@@ -53,6 +53,8 @@ struct flexcop_pci {
 	int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */
 	u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */
 
+	spinlock_t irq_lock;
+
 	struct flexcop_device *fc_dev;
 };
 
@@ -93,6 +95,9 @@ static irqreturn_t flexcop_pci_irq(int i
 	struct flexcop_pci *fc_pci = dev_id;
 	struct flexcop_device *fc = fc_pci->fc_dev;
 	flexcop_ibi_value v = fc->read_ibi_reg(fc,irq_20c);
+	irqreturn_t ret = IRQ_HANDLED;
+
+	spin_lock_irq(&fc_pci->irq_lock);
 
 	deb_irq("irq: %08x cur_addr: %08x (%d), our addrs. 1: %08x 2: %08x; 0x000: "
 			"%08x, 0x00c: %08x\n",v.raw,
@@ -102,6 +107,7 @@ static irqreturn_t flexcop_pci_irq(int i
 			fc->read_ibi_reg(fc,dma1_000).raw,
 			fc->read_ibi_reg(fc,dma1_00c).raw);
 
+
 	if (v.irq_20c.DMA1_IRQ_Status == 1) {
 		if (fc_pci->active_dma1_addr == 0)
 			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 i
 		}
 
 		fc_pci->last_dma1_cur_pos = cur_pos;
-	}
+	} else
+		ret = IRQ_NONE;
+
+	spin_unlock_irq(&fc_pci->irq_lock);
 
 /* packet count would be ideal for hw filtering, but it isn't working. Either
  * the data book is wrong, or I'm unable to read it correctly */
 
 /*	if (v.irq_20c.DMA1_Size_IRQ_Status == 1) { packet counter */
 
-	return IRQ_HANDLED;
+	return ret;
 }
 
 static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff)
@@ -240,6 +249,8 @@ static int flexcop_pci_init(struct flexc
 					SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0)
 		goto err_pci_iounmap;
 
+	spin_lock_init(&fc_pci->irq_lock);
+
 	fc_pci->init_state |= FC_PCI_INIT;
 	goto success;
 

--


  parent reply	other threads:[~2005-05-13 22:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-13 22:00 [DVB patch 00/11] B2C2 / FlexCop driver rewrite Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 01/11] b2c2/flexcop driver refactoring part 1: drop old b2c2-usb stuff Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 03/11] flexcop: fix USB transfer handling Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 04/11] flexcop: add acknowledgements Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 05/11] flexcop: fix MAC address reading Johannes Stezenbach
2005-05-13 22:00 ` Johannes Stezenbach [this message]
2005-05-13 22:00 ` [DVB patch 07/11] flexcop: use hw pid filter Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 08/11] flexcop: fix module refcount handling Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 09/11] flexcop: readme update Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 10/11] flexcop: i2c read fixes Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 11/11] B2C2 / FlexCop driver rewrite Johannes Stezenbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050513220225.655149000@abc \
    --to=js@linuxtv.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.