qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Martin Husemann <martin@duskware.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] hw/esp.c mishandles commands without dma
Date: Sun, 17 Jun 2012 23:55:20 +0200	[thread overview]
Message-ID: <20120617215520.GA7890@mail.duskware.de> (raw)

The NetBSD driver sometimes uses commands without DMA (for example a simple
TEST_UNIT_READY). On esp hardware, the command has a DMA bit (if dma is to
be used), and when writing to the command register, the s->dma status is
updated accordingly.

When commands with dma are used and dma is disabled, the command is defered
untill dma is enabled again. This is all fine. However, the deferal should
not happen if the command does not use dma.

This can bee seen by booting NetBSD/sparc: for every scsi device attached
there will be a 5 second timeout and an error message.

Here is a trivial patch wich fixes this problem for me:

--- hw/esp.c.orig	2012-06-01 11:13:13.000000000 +0200
+++ hw/esp.c	2012-06-18 01:43:34.000000000 +0200
@@ -270,7 +270,7 @@ static void handle_satn(ESPState *s)
     uint8_t buf[32];
     int len;
 
-    if (!s->dma_enabled) {
+    if (s->dma && !s->dma_enabled) {
         s->dma_cb = handle_satn;
         return;
     }
@@ -284,7 +284,7 @@ static void handle_s_without_atn(ESPStat
     uint8_t buf[32];
     int len;
 
-    if (!s->dma_enabled) {
+    if (s->dma && !s->dma_enabled) {
         s->dma_cb = handle_s_without_atn;
         return;
     }
@@ -296,7 +296,7 @@ static void handle_s_without_atn(ESPStat
 
 static void handle_satn_stop(ESPState *s)
 {
-    if (!s->dma_enabled) {
+    if (s->dma && !s->dma_enabled) {
         s->dma_cb = handle_satn_stop;
         return;
     }


I filed a ticket in the bugtracker for it: #1014099.


Martin

             reply	other threads:[~2012-06-17 21:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-17 21:55 Martin Husemann [this message]
2012-06-17 21:57 ` [Qemu-devel] hw/esp.c mishandles commands without dma Martin Husemann

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=20120617215520.GA7890@mail.duskware.de \
    --to=martin@duskware.de \
    --cc=qemu-devel@nongnu.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).