* [Qemu-devel] scsi interface patch
@ 2007-04-22 2:01 Wang Cheng Yeh
2007-04-22 9:54 ` Hetz Ben Hamo
2007-04-22 13:54 ` Paul Brook
0 siblings, 2 replies; 5+ messages in thread
From: Wang Cheng Yeh @ 2007-04-22 2:01 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
The number of responded bytes from scsi device do not match the expected
value of lsi53c895a driver.
hence, the mismatch interrupt happen, but the driver does not always handle
it correctly.
My patch make the responded bytes as expected and the interrupt will not
happen.
Index: hw/scsi-disk.c
===================================================================
RCS file: /sources/qemu/qemu/hw/scsi-disk.c,v
retrieving revision 1.13
diff -r1.13 scsi-disk.c
359c359
< memset(outbuf, 0, 36);
---
> memset(outbuf, 0, len);
377c377
< r->buf_len = 36;
---
> r->buf_len = len;
442a443,446
> for(;r->buf_len<len;r->buf_len++)
> {
> *p++=0;
> }
[-- Attachment #2: Type: text/html, Size: 1207 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] scsi interface patch
2007-04-22 2:01 [Qemu-devel] scsi interface patch Wang Cheng Yeh
@ 2007-04-22 9:54 ` Hetz Ben Hamo
[not found] ` <a20f395e0704220615n268ca374y152fb23ad225ade7@mail.gmail.com>
2007-04-22 13:54 ` Paul Brook
1 sibling, 1 reply; 5+ messages in thread
From: Hetz Ben Hamo @ 2007-04-22 9:54 UTC (permalink / raw)
To: qemu-devel; +Cc: Wang Cheng Yeh
The "standard" way to submitting patches is unified diff's (diff -u)
Could you re-post your patch in unified format please?
Thanks,
Hetz
On 4/22/07, Wang Cheng Yeh <cywang.eda@gmail.com> wrote:
> The number of responded bytes from scsi device do not match the expected
> value of lsi53c895a driver.
> hence, the mismatch interrupt happen, but the driver does not always handle
> it correctly.
> My patch make the responded bytes as expected and the interrupt will not
> happen.
>
> Index: hw/scsi-disk.c
> ===================================================================
> RCS file: /sources/qemu/qemu/hw/scsi-disk.c,v
> retrieving revision 1.13
> diff -r1.13 scsi-disk.c
> 359c359
> < memset(outbuf, 0, 36);
> ---
> > memset(outbuf, 0, len);
> 377c377
> < r->buf_len = 36;
> ---
> > r->buf_len = len;
> 442a443,446
> > for(;r->buf_len<len;r->buf_len++)
> > {
> > *p++=0;
> > }
>
>
--
Skepticism is the lazy person's default position.
Visit my blog (hebrew) for things that (sometimes) matter:
http://wp.dad-answers.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] scsi interface patch
[not found] ` <a20f395e0704220615n268ca374y152fb23ad225ade7@mail.gmail.com>
@ 2007-04-22 13:22 ` Wang Cheng Yeh
0 siblings, 0 replies; 5+ messages in thread
From: Wang Cheng Yeh @ 2007-04-22 13:22 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1.1: Type: text/plain, Size: 1299 bytes --]
I am sorry. The new attached file is created by (cvs diff -up).
2007/4/22, Hetz Ben Hamo <hetzbh@gmail.com>:
>
> The "standard" way to submitting patches is unified diff's (diff -u)
>
> Could you re-post your patch in unified format please?
>
> Thanks,
> Hetz
>
> On 4/22/07, Wang Cheng Yeh < cywang.eda@gmail.com> wrote:
> > The number of responded bytes from scsi device do not match the expected
> > value of lsi53c895a driver.
> > hence, the mismatch interrupt happen, but the driver does not always
> handle
> > it correctly.
> > My patch make the responded bytes as expected and the interrupt will not
> > happen.
> >
> > Index: hw/scsi-disk.c
> > ===================================================================
> > RCS file: /sources/qemu/qemu/hw/scsi-disk.c,v
> > retrieving revision 1.13
> > diff -r1.13 scsi-disk.c
> > 359c359
> > < memset(outbuf, 0, 36);
> > ---
> > > memset(outbuf, 0, len);
> > 377c377
> > < r->buf_len = 36;
> > ---
> > > r->buf_len = len;
> > 442a443,446
> > > for(;r->buf_len<len;r->buf_len++)
> > > {
> > > *p++=0;
> > > }
> >
> >
>
>
> --
> Skepticism is the lazy person's default position.
> Visit my blog (hebrew) for things that (sometimes) matter:
> http://wp.dad-answers.com
>
[-- Attachment #1.2: Type: text/html, Size: 2521 bytes --]
[-- Attachment #2: tmp.txt --]
[-- Type: text/plain, Size: 1227 bytes --]
Index: hw/scsi-disk.c
===================================================================
RCS file: /sources/qemu/qemu/hw/scsi-disk.c,v
retrieving revision 1.13
diff -u -p -r1.13 scsi-disk.c
--- hw/scsi-disk.c 29 Aug 2006 04:52:16 -0000 1.13
+++ hw/scsi-disk.c 22 Apr 2007 13:11:49 -0000
@@ -356,7 +356,7 @@ int32_t scsi_send_command(SCSIDevice *s,
if (len < 36) {
BADF("Inquiry buffer too small (%d)\n", len);
}
- memset(outbuf, 0, 36);
+ memset(outbuf, 0, len);
if (bdrv_get_type_hint(s->bdrv) == BDRV_TYPE_CDROM) {
outbuf[0] = 5;
outbuf[1] = 0x80;
@@ -374,7 +374,7 @@ int32_t scsi_send_command(SCSIDevice *s,
outbuf[4] = 32;
/* Sync data transfer and TCQ. */
outbuf[7] = 0x10 | (s->tcq ? 0x02 : 0);
- r->buf_len = 36;
+ r->buf_len = len;
break;
case 0x16:
DPRINTF("Reserve(6)\n");
@@ -440,6 +440,10 @@ int32_t scsi_send_command(SCSIDevice *s,
p += 21;
}
r->buf_len = p - outbuf;
+ for(;r->buf_len<len;r->buf_len++)
+ {
+ *p++=0;
+ }
outbuf[0] = r->buf_len - 4;
if (r->buf_len > len)
r->buf_len = len;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] scsi interface patch
2007-04-22 2:01 [Qemu-devel] scsi interface patch Wang Cheng Yeh
2007-04-22 9:54 ` Hetz Ben Hamo
@ 2007-04-22 13:54 ` Paul Brook
2007-04-22 15:26 ` Wang Cheng Yeh
1 sibling, 1 reply; 5+ messages in thread
From: Paul Brook @ 2007-04-22 13:54 UTC (permalink / raw)
To: qemu-devel; +Cc: Wang Cheng Yeh
On Sunday 22 April 2007 03:01, Wang Cheng Yeh wrote:
> The number of responded bytes from scsi device do not match the expected
> value of lsi53c895a driver. hence, the mismatch interrupt happen, but the
> driver does not always handle it correctly.
> My patch make the responded bytes as expected and the interrupt will not
> happen.
What makes you think padding the response with zeros is the right thing to do?
I think this is a bug elsewhere (maybe in your device driver).
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] scsi interface patch
2007-04-22 13:54 ` Paul Brook
@ 2007-04-22 15:26 ` Wang Cheng Yeh
0 siblings, 0 replies; 5+ messages in thread
From: Wang Cheng Yeh @ 2007-04-22 15:26 UTC (permalink / raw)
To: Paul Brook, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
Linux kernel 2.6.18 from http://www.aurel32.net/info/debian_arm_qemu.php
will get this mismatch. I don't know the real hardware implement inside
scsi.
I just modify the hardware emulation consist with the linux driver.
Because the hardware emulation is not 100% complete and many parts are not
implemented,
the mismatch issue the interrupt and the ISR work well in real hardware, but
not in QEMU.
The problem maybe inside the mismatch condition, but I am not familiar with
the mismatch handler.
The patch can workaround the mismatch condition. Maybe we should improve the
mismatch condition.
2007/4/22, Paul Brook <paul@codesourcery.com>:
>
> On Sunday 22 April 2007 03:01, Wang Cheng Yeh wrote:
> > The number of responded bytes from scsi device do not match the expected
> > value of lsi53c895a driver. hence, the mismatch interrupt happen, but
> the
> > driver does not always handle it correctly.
> > My patch make the responded bytes as expected and the interrupt will not
> > happen.
>
> What makes you think padding the response with zeros is the right thing to
> do?
> I think this is a bug elsewhere (maybe in your device driver).
>
> Paul
>
[-- Attachment #2: Type: text/html, Size: 1521 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-22 15:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-22 2:01 [Qemu-devel] scsi interface patch Wang Cheng Yeh
2007-04-22 9:54 ` Hetz Ben Hamo
[not found] ` <a20f395e0704220615n268ca374y152fb23ad225ade7@mail.gmail.com>
2007-04-22 13:22 ` Wang Cheng Yeh
2007-04-22 13:54 ` Paul Brook
2007-04-22 15:26 ` Wang Cheng Yeh
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).