linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: don't schedule EH on wcache on/off if old EH
@ 2006-11-22  3:39 Tejun Heo
  2006-11-28  8:45 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2006-11-22  3:39 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

Do not schedule EH for revalidation on wcache on/off if old EH.  Old
EH cannot handle it and will result in WARN_ON()'s and oops.

This closes bug #7412.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
Jeff, this one should go into #upstream-fixes too.

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 3976b25..fc03628 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1434,6 +1434,7 @@ nothing_to_do:
 
 static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
 {
+	struct ata_port *ap = qc->ap;
 	struct scsi_cmnd *cmd = qc->scsicmd;
 	u8 *cdb = cmd->cmnd;
  	int need_sense = (qc->err_mask != 0);
@@ -1442,11 +1443,12 @@ static void ata_scsi_qc_complete(struct
 	 * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE
 	 * cache
 	 */
-	if (!need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) &&
+	if (ap->ops->error_handler &&
+	    !need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) &&
 	    ((qc->tf.feature == SETFEATURES_WC_ON) ||
 	     (qc->tf.feature == SETFEATURES_WC_OFF))) {
-		qc->ap->eh_info.action |= ATA_EH_REVALIDATE;
-		ata_port_schedule_eh(qc->ap);
+		ap->eh_info.action |= ATA_EH_REVALIDATE;
+		ata_port_schedule_eh(ap);
 	}
 
 	/* For ATA pass thru (SAT) commands, generate a sense block if
@@ -1473,8 +1475,8 @@ static void ata_scsi_qc_complete(struct
 		}
 	}
 
-	if (need_sense && !qc->ap->ops->error_handler)
-		ata_dump_status(qc->ap->id, &qc->result_tf);
+	if (need_sense && !ap->ops->error_handler)
+		ata_dump_status(ap->id, &qc->result_tf);
 
 	qc->scsidone(cmd);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libata: don't schedule EH on wcache on/off if old EH
  2006-11-22  3:39 [PATCH] libata: don't schedule EH on wcache on/off if old EH Tejun Heo
@ 2006-11-28  8:45 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-11-28  8:45 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Tejun Heo wrote:
> Do not schedule EH for revalidation on wcache on/off if old EH.  Old
> EH cannot handle it and will result in WARN_ON()'s and oops.
> 
> This closes bug #7412.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> Jeff, this one should go into #upstream-fixes too.

applied to #upstream-fixes



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-28  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-22  3:39 [PATCH] libata: don't schedule EH on wcache on/off if old EH Tejun Heo
2006-11-28  8:45 ` Jeff Garzik

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