From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] ioemu: Add SEEK_STAT in all non-error cases except sleep request
Date: Mon, 11 Aug 2008 22:42:45 +0100 [thread overview]
Message-ID: <20080811214245.GE4526@implementation> (raw)
ioemu: Add SEEK_STAT in all non-error cases except sleep request, since
our seek times are virtually 0. Although this flag is deprecated by
newer ATA standards, Linux at least checks it for CD drives, and would
timeout in some cases if we do not set it.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r eb223ad9eee0 tools/ioemu/hw/ide.c
--- a/tools/ioemu/hw/ide.c Fri Aug 08 11:41:58 2008 +0100
+++ b/tools/ioemu/hw/ide.c Mon Aug 11 12:36:03 2008 +0100
@@ -1122,14 +1122,14 @@ static void ide_flush_cb(void *opaque, i
return;
}
else
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
}
static void ide_atapi_cmd_ok(IDEState *s)
{
s->error = 0;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
ide_set_irq(s);
}
@@ -1243,7 +1243,7 @@ static void ide_atapi_cmd_reply_end(IDES
if (s->packet_transfer_size <= 0) {
/* end of transfer */
ide_transfer_stop(s);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
ide_set_irq(s);
#ifdef DEBUG_IDE_ATAPI
@@ -1321,10 +1321,10 @@ static void ide_atapi_cmd_reply(IDEState
s->io_buffer_index = 0;
if (s->atapi_dma) {
- s->status = READY_STAT | DRQ_STAT;
+ s->status = READY_STAT | SEEK_STAT | DRQ_STAT;
ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
} else {
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_atapi_cmd_reply_end(s);
}
}
@@ -1339,7 +1339,7 @@ static void ide_atapi_cmd_read_pio(IDESt
s->io_buffer_index = sector_size;
s->cd_sector_size = sector_size;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_atapi_cmd_reply_end(s);
}
@@ -1382,7 +1382,7 @@ static void ide_atapi_cmd_read_dma_cb(vo
}
if (s->packet_transfer_size <= 0) {
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD;
ide_set_irq(s);
eot:
@@ -1432,7 +1432,7 @@ static void ide_atapi_cmd_read_dma(IDESt
s->cd_sector_size = sector_size;
/* XXX: check if BUSY_STAT should be set */
- s->status = READY_STAT | DRQ_STAT | BUSY_STAT;
+ s->status = READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT;
ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
}
@@ -1900,7 +1900,7 @@ static void ide_ioport_write(void *opaqu
ide_abort_command(s);
} else {
s->mult_sectors = s->nsector;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
}
ide_set_irq(s);
break;
@@ -1910,7 +1910,7 @@ static void ide_ioport_write(void *opaqu
case WIN_VERIFY_ONCE:
/* do sector number check ? */
ide_cmd_lba48_transform(s, lba48);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_READ_EXT:
@@ -1979,12 +1979,12 @@ static void ide_ioport_write(void *opaqu
case WIN_READ_NATIVE_MAX:
ide_cmd_lba48_transform(s, lba48);
ide_set_sector(s, s->nb_sectors - 1);
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_CHECKPOWERMODE1:
s->nsector = 0xff; /* device active or idle */
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
case WIN_SETFEATURES:
@@ -2084,7 +2084,7 @@ static void ide_ioport_write(void *opaqu
/* overlapping commands not supported */
if (s->feature & 0x02)
goto abort_cmd;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
s->atapi_dma = s->feature & 1;
s->nsector = 1;
ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,
@@ -2303,7 +2303,7 @@ static void ide_reset(IDEState *s)
s->mult_sectors = MAX_MULT_SECTORS;
s->cur_drive = s;
s->select = 0xa0;
- s->status = READY_STAT;
+ s->status = READY_STAT | SEEK_STAT;
ide_set_signature(s);
/* init the transfer handler so that 0xffff is returned on data
accesses */
reply other threads:[~2008-08-11 21:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080811214245.GE4526@implementation \
--to=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.