qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsi53c895a assert with AmigaOS


From: BALATON Zoltan
Subject: Re: lsi53c895a assert with AmigaOS
Date: Sun, 3 Mar 2024 12:29:49 +0100 (CET)

On Sun, 3 Mar 2024, BALATON Zoltan wrote:
On Sun, 3 Mar 2024, Sven Schnelle wrote:
BALATON Zoltan <balaton@eik.bme.hu> writes:

AmigaOS4 also has a driver for this card so I've tried to test it but
it trips an assert. Does anybody have an idea why and how it could be
fixed? Sven's recent patches don't seem to have an effect on this, it
still happens shortly after it tries to access the SCSI device with
those patches applied. (Unfortunately AmigaOS is not freely available
so it's a bit hard to reproduce but I can do tests if needed.) I got
the following traces:
[..]
lsi_do_command Send command len=6
qemu-system-ppc: ../hw/scsi/lsi53c895a.c:863: lsi_do_command: Assertion `s->current == NULL' failed.

Any idea what could it be and what could be done about it?

I think the Host is resetting the SCSI controller while it still has
some request pending. I made a hack to work around that bug, but so
far i haven't spent the time to verify whether it's correct or whether
there are additional changes required. Here it is:

This does avoid the assert and now it boots but then can't read the scsi device. (I've tried with a scsi-cd with an iso image and it thinks it's an audio CD and cannot read data from it). Maybe something else is needed but this seems to go one step further. However I don't see "lsi_reset Reset" traces other than once when the driver starts so not sure it's really related to reset. Could it be that the driver expects it to be able to send commands while another one is still processing so the pending one would need to be put back in the queue instead of cancelling ir? But I don't know how to do that so cannot try unless you can give me a patch.

I've tried this change:

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index f8598a17f5..6f547c0d33 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -860,7 +860,9 @@ static void lsi_do_command(LSIState *s)
         return;
     }

-    assert(s->current == NULL);
+    if (s->current) {
+        lsi_queue_command(s);
+    }
     s->current = g_new0(lsi_request, 1);
     s->current->tag = s->select_tag;
     s->current->req = scsi_req_new(dev, s->current->tag, s->current_lun, buf,

but then I get:

lsi_do_msgout MSG out len=1
lsi_do_msgout_select Select LUN 0
lsi_execute_script SCRIPTS dsp=0x198070 opcode 0x820b0000 arg 0x1981f8
lsi_execute_script_tc_compp Compare phase CMD == CMD
lsi_execute_script_tc_jump Jump to 0x1981f8
lsi_execute_script SCRIPTS dsp=0x1981f8 opcode 0xa000006 arg 0x199000
lsi_do_command Send command len=6
lsi_queue_command Queueing tag=0x0
qemu-system-ppc: ../hw/scsi/lsi53c895a.c:677: lsi_queue_command: Assertion `s->current->dma_len == 0' failed.

So maybe there's some transfer in progress that would need to be finished or what to do in this case?

Regards,
BALATON Zoltan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]