From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: [PATCH 1/7] sata_mv: prevent unnecessary double-resets
Date: Fri, 19 May 2006 16:21:03 -0400 [thread overview]
Message-ID: <200605191621.03598.liml@rtr.ca> (raw)
In-Reply-To: <200605191614.00023.liml@rtr.ca>
The mv_err_intr() function is invoked from the driver's interrupt handler,
as well as from the timeout function. This patch prevents it from triggering
a one-after-the-other double reset of the controller when invoked
from the timeout function.
This also adds a check for a timeout race condition that has been observed
to occur with this driver in earlier kernels. This should not be needed,
in theory, but in practice it has caught bugs. Maybe nuke it at a later date.
Signed-off-by: Mark Lord <liml@rtr.ca>
---
--- linux/drivers/scsi/sata_mv.c 2006-05-19 15:00:20.000000000 -0400
+++ linux/drivers/scsi/sata_mv.c 2006-05-19 14:58:51.000000000 -0400
@@ -1291,6 +1291,7 @@
/**
* mv_err_intr - Handle error interrupts on the port
* @ap: ATA channel to manipulate
+ * @reset_allowed: bool: 0 == don't trigger from reset here
*
* In most cases, just clear the interrupt and move on. However,
* some cases require an eDMA reset, which is done right before
@@ -1301,7 +1302,7 @@
* LOCKING:
* Inherited from caller.
*/
-static void mv_err_intr(struct ata_port *ap)
+static void mv_err_intr(struct ata_port *ap, int reset_allowed)
{
void __iomem *port_mmio = mv_ap_base(ap);
u32 edma_err_cause, serr = 0;
@@ -1323,9 +1324,8 @@
writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
/* check for fatal here and recover if needed */
- if (EDMA_ERR_FATAL & edma_err_cause) {
+ if (reset_allowed && (EDMA_ERR_FATAL & edma_err_cause))
mv_stop_and_reset(ap);
- }
}
/**
@@ -1406,7 +1406,7 @@
shift++; /* skip bit 8 in the HC Main IRQ reg */
}
if ((PORT0_ERR << shift) & relevant) {
- mv_err_intr(ap);
+ mv_err_intr(ap, 1);
err_mask |= AC_ERR_OTHER;
handled = 1;
}
@@ -2033,11 +2033,14 @@
ap->host_set->mmio_base, ap, qc, qc->scsicmd,
&qc->scsicmd->cmnd);
- mv_err_intr(ap);
+ mv_err_intr(ap, 0);
mv_stop_and_reset(ap);
- qc->err_mask |= AC_ERR_TIMEOUT;
- ata_eh_qc_complete(qc);
+ WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE));
+ if (qc->flags & ATA_QCFLAG_ACTIVE) {
+ qc->err_mask |= AC_ERR_TIMEOUT;
+ ata_eh_qc_complete(qc);
+ }
}
/**
next prev parent reply other threads:[~2006-05-19 20:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-19 15:48 [PATCHSET 03/03] add hotplug support, take 3 Tejun Heo
2006-05-19 15:48 ` [PATCH 05/13] libata-hp: hook warmplug Tejun Heo
2006-05-19 15:48 ` [PATCH 02/13] libata-hp: implement hotplug Tejun Heo
2006-05-19 16:04 ` Jeff Garzik
2006-05-19 15:48 ` [PATCH 07/13] libata-hp: implement unload-unplug Tejun Heo
2006-05-19 16:10 ` Jeff Garzik
2006-05-23 14:53 ` Tejun Heo
2006-05-19 15:48 ` [PATCH 01/13] libata-hp: implement ata_eh_detach_dev() Tejun Heo
2006-05-19 15:48 ` [PATCH 03/13] libata-hp: implement SCSI part of hotplug Tejun Heo
2006-05-19 16:05 ` Jeff Garzik
2006-05-23 14:52 ` Tejun Heo
2006-05-19 15:48 ` [PATCH 06/13] libata-hp: implement bootplug Tejun Heo
2006-05-19 16:09 ` Jeff Garzik
2006-05-19 15:48 ` [PATCH 09/13] sata_sil: convert to new probing mechanism and add hotplug support Tejun Heo
2006-05-19 15:48 ` [PATCH 08/13] ata_piix: convert ata_piix to new probing mechanism Tejun Heo
2006-05-19 15:48 ` [PATCH 04/13] libata-hp: implement warmplug Tejun Heo
2006-05-19 15:48 ` [PATCH 11/13] sata_sil24: convert to new probing mechanism and add hotplug support Tejun Heo
2006-05-19 15:48 ` [PATCH 13/13] libata-hp: move ata_do_reset() to libata-eh.c Tejun Heo
2006-05-19 16:13 ` Jeff Garzik
2006-05-19 20:13 ` [PATCH 0/7] sata_mv: assorted fixes Mark Lord
2006-05-19 20:21 ` Mark Lord [this message]
2006-05-19 20:24 ` [PATCH 2/7] sata_mv: deal with interrupt coalescing interrupts Mark Lord
2006-05-20 4:32 ` Jeff Garzik
2006-05-20 13:13 ` Mark Lord
2006-05-20 13:24 ` Jeff Garzik
2006-05-20 14:01 ` Mark Lord
2006-05-22 6:35 ` Jeff Garzik
2006-05-19 20:29 ` [PATCH 3/7] sata_mv: chip initialization fixes Mark Lord
2006-05-19 20:33 ` [PATCH 4/7] sata_mv: spurious interrupt workaround Mark Lord
2006-05-19 20:36 ` [PATCH 5/7] sata_mv: remove local copy of queue indexes Mark Lord
2006-05-19 20:40 ` [PATCH 6/7] sata_mv: endian fix Mark Lord
2006-05-19 20:41 ` [PATCH 7/7] sata_mv: version bump Mark Lord
2006-05-19 15:48 ` [PATCH 12/13] libata-hp: killl ops->probe_reset Tejun Heo
2006-05-19 15:48 ` [PATCH 10/13] ahci: convert to new probing mechanism and add hotplug support Tejun Heo
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=200605191621.03598.liml@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).