linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, Carlos.Pardo@siliconimage.com,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH libata-dev-2.6:sil24 01/07] sil24: implement status register emulation
Date: Sat, 30 Jul 2005 19:13:57 +0900 (KST)	[thread overview]
Message-ID: <20050730101344.623D22BD@htj.dyndns.org> (raw)
In-Reply-To: <20050730101344.1C985988@htj.dyndns.org>

01_sil24_add-status-emulation.patch

	Add back status register emulation.  It's very simple.  If the
	previous command completed successfully, we return ATA_DRDY
	for all following status register queries; otherwise, we
	return ATA_DRDY | ATA_ERR.  We can improve error reporting by
	reading CMD_ERROR register and emulating status/error values
	accordingly.

Signed-off-by: Tejun Heo <htejun@gmail.com>

 sata_sil24.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

Index: work/drivers/scsi/sata_sil24.c
===================================================================
--- work.orig/drivers/scsi/sata_sil24.c	2005-07-30 19:13:39.000000000 +0900
+++ work/drivers/scsi/sata_sil24.c	2005-07-30 19:13:39.000000000 +0900
@@ -217,6 +217,7 @@ struct sil24_cmd_block {
  * here from the previous interrupt.
  */
 struct sil24_port_priv {
+	u8 stat;
 	void *port;
 	struct sil24_cmd_block *cmd_block;	/* 32 cmd blocks */
 	dma_addr_t cmd_block_dma;		/* DMA base addr for them */
@@ -328,7 +329,8 @@ static struct ata_port_info sil24_port_i
 
 static u8 sil24_check_status(struct ata_port *ap)
 {
-	return ATA_DRDY;
+	struct sil24_port_priv *pp = ap->private_data;
+	return pp->stat;
 }
 
 static u8 sil24_check_err(struct ata_port *ap)
@@ -489,6 +491,7 @@ static inline void sil24_host_intr(struc
 
 	slot_stat = readl(port + PORT_SLOT_STAT);
 	if (!(slot_stat & HOST_SSTAT_ATTN)) {
+		pp->stat = ATA_DRDY;
 		if (qc)
 			ata_qc_complete(qc, 0);
 	} else {
@@ -510,6 +513,8 @@ static inline void sil24_host_intr(struc
 		       "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
 		       ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror);
 
+		/* FIXME: We can do better and emulate the err register too. */
+		pp->stat = ATA_DRDY | ATA_ERR;
 		if (qc)
 			ata_qc_complete(qc, ATA_ERR);
 
@@ -574,6 +579,7 @@ static int sil24_port_start(struct ata_p
 	}
 	memset(cb, 0, cb_size);
 
+	pp->stat = ATA_DRDY;
 	pp->port = hpriv->port_base + ap->port_no * PORT_REGS_SIZE;
 	pp->cmd_block = cb;
 	pp->cmd_block_dma = cb_dma;


  reply	other threads:[~2005-07-30 10:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-30 10:13 [PATCH libata-dev-2.6:sil24 00/07] sil24: misc fixes Tejun Heo
2005-07-30 10:13 ` Tejun Heo [this message]
2005-08-11 19:18   ` [PATCH libata-dev-2.6:sil24 01/07] sil24: implement status register emulation Jeff Garzik
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 02/07] sil24: move error handling out of hot interrupt path Tejun Heo
2005-08-11 19:18   ` Jeff Garzik
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 03/07] sil24: add testing for PCI fault Tejun Heo
2005-08-11 19:19   ` Jeff Garzik
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 04/07] sil24: remove irq disable code on spurious interrupt Tejun Heo
2005-08-11 19:19   ` Jeff Garzik
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 05/07] sil24: use longer delay function and less iteration in reset_controller Tejun Heo
2005-08-11 19:20   ` Jeff Garzik
2005-08-12  0:54     ` Tejun Heo
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 06/07] sil24: add IO flushing after masking irq during initialization Tejun Heo
2005-08-11 19:20   ` Jeff Garzik
2005-07-30 10:14 ` [PATCH libata-dev-2.6:sil24 07/07] sil24: add FIXME comment above ata_device_add Tejun Heo
2005-08-11 19:21   ` Jeff Garzik
2005-08-11 19:21 ` [PATCH libata-dev-2.6:sil24 00/07] sil24: misc fixes Jeff Garzik
2005-08-12  0:57   ` 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=20050730101344.623D22BD@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=Carlos.Pardo@siliconimage.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).