linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linux IDE <linux-ide@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Doug Maxey <dwm@maxeymade.com>, Tejun Heo <htejun@gmail.com>
Subject: [PATCH 3/4] libata: determine the err_mask when the error is found
Date: Mon, 05 Dec 2005 15:40:15 +0800	[thread overview]
Message-ID: <4393EEDF.9060305@tw.ibm.com> (raw)
In-Reply-To: <4393E513.5070203@tw.ibm.com>

Patch 3/4:
  determine the err_mask when the error is found

Changes:
  - move "qc->err_mask |= AC_ERR_ATA_BUS" to where the error is found
  - add "assert(qc->err_mask)" to ata_pio_error() to make sure qc->err_mask was available when we enter the error state


For your review, thanks.

Albert
Signed-off-by: Albert Lee <albertcc@tw.ibm.com> 

============

--- err_mask2/drivers/scsi/libata-core.c	2005-12-05 12:37:14.000000000 +0800
+++ err_mask3/drivers/scsi/libata-core.c	2005-12-05 12:42:06.000000000 +0800
@@ -2830,6 +2830,7 @@ static unsigned long ata_pio_poll(struct
 	status = ata_chk_status(ap);
 	if (status & ATA_BUSY) {
 		if (time_after(jiffies, ap->pio_task_timeout)) {
+			qc->err_mask |= AC_ERR_ATA_BUS;
 			ap->hsm_task_state = HSM_ST_TMOUT;
 			return 0;
 		}
@@ -2880,6 +2881,7 @@ static int ata_pio_complete (struct ata_
 
 	drv_stat = ata_wait_idle(ap);
 	if (!ata_ok(drv_stat)) {
+		qc->err_mask |= __ac_err_mask(drv_stat);
 		ap->hsm_task_state = HSM_ST_ERR;
 		return 0;
 	}
@@ -3195,6 +3197,7 @@ static void atapi_pio_bytes(struct ata_q
 err_out:
 	printk(KERN_INFO "ata%u: dev %u: ATAPI check failed\n",
 	      ap->id, dev->devno);
+	qc->err_mask |= AC_ERR_ATA_BUS;
 	ap->hsm_task_state = HSM_ST_ERR;
 }
 
@@ -3244,6 +3247,7 @@ static void ata_pio_block(struct ata_por
 	} else {
 		/* handle BSY=0, DRQ=0 as error */
 		if ((status & ATA_DRQ) == 0) {
+			qc->err_mask |= AC_ERR_ATA_BUS;
 			ap->hsm_task_state = HSM_ST_ERR;
 			return;
 		}
@@ -3261,9 +3265,13 @@ static void ata_pio_error(struct ata_por
 	qc = ata_qc_from_tag(ap, ap->active_tag);
 	assert(qc != NULL);
 
+	/* make sure qc->err_mask is available to 
+	 * know what's wrong and recover
+	 */
+	assert(qc->err_mask);
+
 	ap->hsm_task_state = HSM_ST_IDLE;
 
-	qc->err_mask |= AC_ERR_ATA_BUS;
 	ata_poll_qc_complete(qc);
 }
 



  parent reply	other threads:[~2005-12-05  7:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-09  4:57 [PATCH/RFC 0/3] libata: misc fixes Albert Lee
2005-11-09  5:03 ` [PATCH 1/3] libata: if condition fix for ata_dev_identify() Albert Lee
2005-11-09  5:07 ` [PATCH/RFC 2/3] libata: move err_mask to ata_queued_cmd Albert Lee
2005-11-09  6:25   ` Jeff Garzik
2005-11-10  7:56     ` [PATCH/RFC 0/4] libata: move err_mask to ata_queued_cmd (revised) Albert Lee
2005-11-10  7:59       ` [PATCH/RFC 1/4] libata: minor patch before moving err_mask Albert Lee
2005-11-10  8:01       ` [PATCH/RFC 2/4] libata: move err_mask to ata_queued_cmd Albert Lee
2005-11-10  8:03       ` [PATCH/RFC 3/4] libata: determine the err_mask when the error is found Albert Lee
2005-11-10  8:05       ` [PATCH/RFC 4/4] libata: determine the err_mask directly in atapi_packet_task() Albert Lee
2005-12-04  2:01       ` [PATCH/RFC 0/4] libata: move err_mask to ata_queued_cmd (revised) Jeff Garzik
2005-12-05  6:58         ` [PATCH 0/4] libata: move err_mask to ata_queued_cmd (revised #2) Albert Lee
2005-12-05  7:36           ` [PATCH 1/4] libata: minor patch before moving err_mask Albert Lee
2005-12-05  7:38           ` [PATCH 2/4] libata: move err_mask to ata_queued_cmd Albert Lee
2005-12-05  7:40           ` Albert Lee [this message]
2005-12-05  7:42           ` [PATCH 4/4] libata: determine the err_mask directly in atapi_packet_task() Albert Lee
2005-12-06  3:34           ` [PATCH/RFC 1/1] libata: err_mask misc fix Albert Lee
2005-12-12 20:26             ` Jeff Garzik
2005-11-09  5:12 ` [PATCH/RFC 3/3] libata: check qc->err_mask for the internal commands Albert Lee
2005-11-09  6:31   ` 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=4393EEDF.9060305@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=bzolnier@gmail.com \
    --cc=dwm@maxeymade.com \
    --cc=htejun@gmail.com \
    --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).