public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Alberto Alonso <alberto@ggsys.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: qstor driver -> irq 193: nobody cared
Date: Tue, 14 Nov 2006 13:23:33 -0500	[thread overview]
Message-ID: <455A09A5.2020200@rtr.ca> (raw)
In-Reply-To: <1163528258.3340.23.camel@w100>

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

Alberto Alonso wrote:
> Sounds good, let me know if you need me to do any
> testing or help on the programming. 

Okay, try this (untested) and see if it cleans things up.
I'm also including the old "printk" patch, so that we can
tell whether the "fix" is actually working or not.

Thanks

[-- Attachment #2: qstor_spurious2.patch --]
[-- Type: text/x-patch, Size: 877 bytes --]

--- old/drivers/scsi/sata_qstor.c	2006-09-19 23:42:06.000000000 -0400
+++ linux/drivers/scsi/sata_qstor.c	2006-11-06 09:50:02.000000000 -0500
@@ -459,6 +459,7 @@
 {
 	struct ata_host_set *host_set = dev_instance;
 	unsigned int handled = 0;
+	static int spurious = 0;
 
 	VPRINTK("ENTER\n");
 
@@ -466,6 +467,20 @@
 	handled  = qs_intr_pkt(host_set) | qs_intr_mmio(host_set);
 	spin_unlock(&host_set->lock);
 
+	/* There are reports of at least one system with glitchy interrupts,
+	 * and if we return !handled here for those then the kernel may totally
+	 * disable our own IRQ line (duh!).
+	 * So, try and be tolerant, but not *too* tolerant.
+	 */
+	if (!handled) {
+		if (spurious < 10) {
+			printk("sata_qstor: spurious=%d\n", spurious);
+			++spurious;
+			handled = 1;
+		}
+	} else if (spurious)
+		--spurious;
+
 	VPRINTK("EXIT\n");
 
 	return IRQ_RETVAL(handled);

[-- Attachment #3: qstor_nien_fix.patch --]
[-- Type: text/x-patch, Size: 994 bytes --]

--- old/drivers/scsi/sata_qstor.c	2006-11-14 11:30:37.000000000 -0500
+++ linux/drivers/scsi/sata_qstor.c	2006-11-14 13:22:05.000000000 -0500
@@ -299,6 +299,19 @@
 	return nelem;
 }
 
+static void qs_set_nien (struct ata_port *ap, int new_nien)
+{
+	struct ata_ioports *ioaddr = &ap->ioaddr;
+
+	if ((ap->ctl & ATA_NIEN) != new_nien) {
+		ap->ctl = (ap->ctl & ~ATA_NIEN) | new_nien;
+		ap->last_ctl = ap->ctl;
+		writeb(ap->ctl, (void __iomem *)ioaddr->ctl_addr);
+		wmb();
+		ata_check_status(ap);
+	}
+}
+
 static void qs_qc_prep(struct ata_queued_cmd *qc)
 {
 	struct qs_port_priv *pp = qc->ap->private_data;
@@ -357,6 +370,8 @@
 
 	switch (qc->tf.protocol) {
 	case ATA_PROT_DMA:
+		/* packet mode requires that the NIEN bit be turned on */
+		qs_set_nien(qc->ap, ATA_NIEN);
 
 		pp->state = qs_state_pkt;
 		qs_packet_start(qc);
@@ -370,6 +385,7 @@
 		break;
 	}
 
+	qs_set_nien(qc->ap, 0); // FIXME: is this necessary here?
 	pp->state = qs_state_mmio;
 	return ata_qc_issue_prot(qc);
 }

  reply	other threads:[~2006-11-14 18:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-03 18:02 qstor driver -> irq 193: nobody cared Alberto Alonso
2006-11-03 19:00 ` Sergey Vlasov
2006-11-03 20:22   ` Alberto Alonso
2006-11-03 20:52     ` Sergey Vlasov
2006-11-03 23:21       ` Alberto Alonso
2006-11-04 18:39 ` Mark Lord
2006-11-06  4:04   ` Alberto Alonso
2006-11-06 14:51     ` Mark Lord
2006-11-10 17:36   ` Alberto Alonso
2006-11-12  5:09     ` Mark Lord
2006-11-12  5:17       ` Alberto Alonso
2006-11-12 20:31       ` Alberto Alonso
2006-11-13 14:29         ` Mark Lord
2006-11-14  4:50           ` Alberto Alonso
2006-11-14 16:46             ` Mark Lord
2006-11-14 18:17               ` Alberto Alonso
2006-11-14 18:23                 ` Mark Lord [this message]
2006-11-16  6:35                   ` Alberto Alonso
2006-11-16 13:53                     ` Mark Lord
2006-11-17 21:42                       ` Alberto Alonso

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=455A09A5.2020200@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=alberto@ggsys.net \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox