All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marko Ristola <marko.ristola@kolumbus.fi>
To: linux-media <linux-media@vger.kernel.org>
Cc: Manu Abraham <abraham.manu@gmail.com>
Subject: [PATCH] Mantis and Hopper: Fix CAM hangup caused by losing GPIF status
Date: Wed, 14 Dec 2011 11:46:07 +0200	[thread overview]
Message-ID: <4EE8705F.30609@kolumbus.fi> (raw)


Mantis and Hopper drivers: Fix CAM hangup problem,
where interrupt handler clears GPIF status, even though
GPIF interrupt isn't active.

Manuel  reported that this patch fixes his problem:
http://www.spinics.net/lists/linux-media/msg41473.html
(CAM hangs up about once per 20 minutes, each hangup takes about 3-5s.)

Signed-off-by: Marko Ristola <Marko.Ristola@kolumbus.fi>

diff --git a/drivers/media/dvb/mantis/hopper_cards.c b/drivers/media/dvb/mantis/hopper_cards.c
index 71622f6..c2084e9 100644
--- a/drivers/media/dvb/mantis/hopper_cards.c
+++ b/drivers/media/dvb/mantis/hopper_cards.c
@@ -84,15 +84,6 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id)
  	if (!(stat & mask))
  		return IRQ_NONE;
  
-	rst_mask  = MANTIS_GPIF_WRACK  |
-		    MANTIS_GPIF_OTHERR |
-		    MANTIS_SBUF_WSTO   |
-		    MANTIS_GPIF_EXTIRQ;
-
-	rst_stat  = mmread(MANTIS_GPIF_STATUS);
-	rst_stat &= rst_mask;
-	mmwrite(rst_stat, MANTIS_GPIF_STATUS);
-
  	mantis->mantis_int_stat = stat;
  	mantis->mantis_int_mask = mask;
  	dprintk(MANTIS_DEBUG, 0, "\n-- Stat=<%02x> Mask=<%02x> --", stat, mask);
@@ -101,6 +92,16 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id)
  	}
  	if (stat & MANTIS_INT_IRQ0) {
  		dprintk(MANTIS_DEBUG, 0, "<%s>", label[1]);
+
+		rst_mask  = MANTIS_GPIF_WRACK  |
+			    MANTIS_GPIF_OTHERR |
+			    MANTIS_SBUF_WSTO   |
+			    MANTIS_GPIF_EXTIRQ;
+
+		rst_stat  = mmread(MANTIS_GPIF_STATUS);
+		rst_stat &= rst_mask;
+		mmwrite(rst_stat, MANTIS_GPIF_STATUS);
+
  		mantis->gpif_status = rst_stat;
  		wake_up(&ca->hif_write_wq);
  		schedule_work(&ca->hif_evm_work);
diff --git a/drivers/media/dvb/mantis/mantis_cards.c b/drivers/media/dvb/mantis/mantis_cards.c
index c2bb90b..109a5fb 100644
--- a/drivers/media/dvb/mantis/mantis_cards.c
+++ b/drivers/media/dvb/mantis/mantis_cards.c
@@ -92,15 +92,6 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id)
  	if (!(stat & mask))
  		return IRQ_NONE;
  
-	rst_mask  = MANTIS_GPIF_WRACK  |
-		    MANTIS_GPIF_OTHERR |
-		    MANTIS_SBUF_WSTO   |
-		    MANTIS_GPIF_EXTIRQ;
-
-	rst_stat  = mmread(MANTIS_GPIF_STATUS);
-	rst_stat &= rst_mask;
-	mmwrite(rst_stat, MANTIS_GPIF_STATUS);
-
  	mantis->mantis_int_stat = stat;
  	mantis->mantis_int_mask = mask;
  	dprintk(MANTIS_DEBUG, 0, "\n-- Stat=<%02x> Mask=<%02x> --", stat, mask);
@@ -109,6 +100,15 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id)
  	}
  	if (stat & MANTIS_INT_IRQ0) {
  		dprintk(MANTIS_DEBUG, 0, "<%s>", label[1]);
+		rst_mask  = MANTIS_GPIF_WRACK  |
+			    MANTIS_GPIF_OTHERR |
+			    MANTIS_SBUF_WSTO   |
+			    MANTIS_GPIF_EXTIRQ;
+
+		rst_stat  = mmread(MANTIS_GPIF_STATUS);
+		rst_stat &= rst_mask;
+		mmwrite(rst_stat, MANTIS_GPIF_STATUS);
+
  		mantis->gpif_status = rst_stat;
  		wake_up(&ca->hif_write_wq);
  		schedule_work(&ca->hif_evm_work);

                 reply	other threads:[~2011-12-14  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4EE8705F.30609@kolumbus.fi \
    --to=marko.ristola@kolumbus.fi \
    --cc=abraham.manu@gmail.com \
    --cc=linux-media@vger.kernel.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.