qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Linux 2.6.21 doesn't work with qemu-arm SCSI controller anymore.
Date: Tue, 26 Jun 2007 16:41:32 +0200	[thread overview]
Message-ID: <fb249edb0706260741h5eae49ffta57572c6f238992d@mail.gmail.com> (raw)
In-Reply-To: <200706071721.55061.rob@landley.net>

On 07/06/07, Rob Landley <rob@landley.net> wrote:
> In the 2.6.21 kernel the sym53c8xx_2 SCSI controller changed in a way that
> QEMU's virtual SCSI controller doesn't handle this properly:

I spent some time yesterday trying to find out what was happening and
the results are below.

QEMU's virtual SCSI controller does handle it properly and the kernel
sym53c8xx_2 driver changes are not at fault.

The first surprising fact, and one which took me long to figure out,
was that all the SCSI errors are a result of a case of simple
interrupts from the controller not reaching the SCSI driver, hence the
timeouts and whatnot. The sym53c8xx_2 driver gets irq 0 instead of 27,
from the tiwsted PCI irq number assignment logic. This was because the
VersatilePB PCI driver was reading the irq pin number from a wrong
address in the scsi controller's (which is a pci device) config
structure, and the read always returned a 0 which normally means that
the device uses no interrupts (actually all 8-bit accesses were
broken). I corrected the versatile PCI code and sent a patch to linux.
However, the funny part is that this code had not changed since
2.6.18, so how did it break in 2.6.21? Well, it was broken all the
time, but there was a bug in generic PCI code in
drivers/pci/setup-irq.c, which effectively caused the value read from
the device's supplied config, to be discarded, which got fixed in
2.6.21.

If you definitely must use 2.6.21, this qemu workaround also works
(need to do the same for any other PCI device you want to use):
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 19bf2a1..eedbc1d 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1845,6 +1845,7 @@ void *lsi_scsi_init(PCIBus *bus, int devfn)
     s->pci_dev.config[0x02] = 0x12;
     s->pci_dev.config[0x03] = 0x00;
     s->pci_dev.config[0x0b] = 0x01;
+    s->pci_dev.config[0x3c] = 0x01; /* ugly workaround */
     s->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */

     s->mmio_io_addr = cpu_register_io_memory(0, lsi_mmio_readfn,

Regards

  reply	other threads:[~2007-06-26 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 21:21 [Qemu-devel] Linux 2.6.21 doesn't work with qemu-arm SCSI controller anymore Rob Landley
2007-06-26 14:41 ` andrzej zaborowski [this message]
2007-07-06 19:09   ` Rob Landley

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=fb249edb0706260741h5eae49ffta57572c6f238992d@mail.gmail.com \
    --to=balrogg@gmail.com \
    --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).