qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][RFC] Fix bugs in the ATAPI cdrom driver
@ 2007-08-17 23:43 Brandon Philips
  2007-08-18  0:42 ` Matthew Kent
  0 siblings, 1 reply; 4+ messages in thread
From: Brandon Philips @ 2007-08-17 23:43 UTC (permalink / raw)
  To: qemu-devel

The new libata-eh in the Linux kernel is throwing a fit over the QEMU
cdrom device for two reasons:

1) DRQ can be set with ERR_STAT set.  This is a violation of the ATAPI
state machine.

2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting set
which is correct.  But, when the OS issues another ATAPI command
ERR_STAT is still set.  Which is bad since the next expected command
from the OS is REQUEST_SENSE to find out why ERR_STAT is set.

bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=291775

Signed-off-by: Brandon Philips <bphilips@suse.de>

---
 hw/ide.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: qemu-0.9.0/hw/ide.c
===================================================================
--- qemu-0.9.0.orig/hw/ide.c
+++ qemu-0.9.0/hw/ide.c
@@ -586,7 +586,9 @@ static void ide_transfer_start(IDEState 
     s->end_transfer_func = end_transfer_func;
     s->data_ptr = buf;
     s->data_end = buf + size;
-    s->status |= DRQ_STAT;
+    /* don't violate the HSM */
+    if (!(s->status & ERR_STAT))
+        s->status |= DRQ_STAT;
 }
 
 static void ide_transfer_stop(IDEState *s)
@@ -1805,6 +1807,7 @@ static void ide_ioport_write(void *opaqu
             /* overlapping commands not supported */
             if (s->feature & 0x02)
                 goto abort_cmd;
+            s->status = READY_STAT;
             s->atapi_dma = s->feature & 1;
             s->nsector = 1;
             ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE, 

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

end of thread, other threads:[~2007-08-19 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17 23:43 [Qemu-devel] [PATCH][RFC] Fix bugs in the ATAPI cdrom driver Brandon Philips
2007-08-18  0:42 ` Matthew Kent
2007-08-18  4:22   ` Brandon Philips
2007-08-19 22:49     ` Thiemo Seufer

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