All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH 03/06] sata_mv: stricter irq masking
Date: Fri, 13 Feb 2009 00:05:45 -0500	[thread overview]
Message-ID: <4994FFA9.7030300@rtr.ca> (raw)
In-Reply-To: <4994FF7C.2050607@rtr.ca>

Tighten up interrupt masking in mv_qc_issue() so that it doesn't
miss any protocols.  Handle future cases where a qc is specially
marked for polled issue or where a particular chip version prefers
interrupts over polling for PIO.

This mimics the polling decision logic from ata_sff_qc_issue().

Signed-off-by: Mark Lord <mlord@pobox.com>

--- old/drivers/ata/sata_mv.c	2009-02-12 20:02:42.000000000 -0500
+++ linux/drivers/ata/sata_mv.c	2009-02-12 20:12:50.000000000 -0500
@@ -1809,7 +1809,7 @@
  	void __iomem *port_mmio = mv_ap_base(ap);
  	struct mv_port_priv *pp = ap->private_data;
  	u32 in_index;
-	unsigned int port_irqs = DONE_IRQ | ERR_IRQ;
+	unsigned int port_irqs;

  	switch (qc->tf.protocol) {
  	case ATA_PROT_DMA:
@@ -1842,20 +1842,28 @@
  					"this may fail due to h/w errata\n");
  		}
  		/* drop through */
+	case ATA_PROT_NODATA:
  	case ATAPI_PROT_PIO:
-		port_irqs = ERR_IRQ;	/* leave DONE_IRQ masked for PIO */
-		/* drop through */
-	default:
-		/*
-		 * We're about to send a non-EDMA capable command to the
-		 * port.  Turn off EDMA so there won't be problems accessing
-		 * shadow block, etc registers.
-		 */
-		mv_stop_edma(ap);
-		mv_clear_and_enable_port_irqs(ap, mv_ap_base(ap), port_irqs);
-		mv_pmp_select(ap, qc->dev->link->pmp);
-		return ata_sff_qc_issue(qc);
+	case ATAPI_PROT_NODATA:
+		if (ap->flags & ATA_FLAG_PIO_POLLING)
+			qc->tf.flags |= ATA_TFLAG_POLLING;
+		break;
  	}
+
+	if (qc->tf.flags & ATA_TFLAG_POLLING)
+		port_irqs = ERR_IRQ;	/* mask device interrupt when polling */
+	else
+		port_irqs = ERR_IRQ | DONE_IRQ;	/* unmask all interrupts */
+
+	/*
+	 * We're about to send a non-EDMA capable command to the
+	 * port.  Turn off EDMA so there won't be problems accessing
+	 * shadow block, etc registers.
+	 */
+	mv_stop_edma(ap);
+	mv_clear_and_enable_port_irqs(ap, mv_ap_base(ap), port_irqs);
+	mv_pmp_select(ap, qc->dev->link->pmp);
+	return ata_sff_qc_issue(qc);
  }

  static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap)

  reply	other threads:[~2009-02-13  5:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13  5:03 [PATCH 01/06] sata_mv: cache frequently read registers Mark Lord
2009-02-13  5:05 ` [PATCH 02/06] sata_mv: enable ATAPI DMA for GEN_IIE chips Mark Lord
2009-02-13  5:05   ` Mark Lord [this message]
2009-02-13  5:08     ` [PATCH 04/06] sata_mv: implement mv_sff_check_status Mark Lord
2009-02-13  5:08       ` [PATCH 05/06] sata_mv: export ata_pio_queue_task() Mark Lord
2009-02-13  5:09         ` [PATCH 06/06] sata_mv: implement mv_qc_issue_fis() for errata workaround Mark Lord
2009-02-17  0:19 ` [PATCH 01/06] sata_mv: cache frequently read registers Jeff Garzik
2009-02-25 17:52   ` Mark Lord
     [not found]   ` <499A26B8.7070107@pobox.com>
2009-02-25 20:20     ` Jeff Garzik

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=4994FFA9.7030300@rtr.ca \
    --to=liml@rtr.ca \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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.