* [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status
@ 2014-03-05 5:15 Alexey Kardashevskiy
2014-03-05 8:16 ` Paolo Bonzini
2014-03-05 9:14 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2014-03-05 5:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf
Normally VIOSRP_OK (0) means success and non-zero value means error
except VIOSRP_OK2 (0x99) which is another success code by weird accident.
This uses 0 as success code always as some guests do not cope with
the 0x99 value well. The existing linux driver checks for both VIOSRP_OK
and VIOSRP_OK2 since 2.6.32.
This returns non-zero code (VIOSRP_ADAPTER_FAIL == 0x10) on errors which
can only happen if DMA write failed.
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
hw/scsi/spapr_vscsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index e8bca39..6460e06 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -193,9 +193,9 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req,
req->crq.s.IU_data_ptr = req->iu.srp.rsp.tag; /* right byte order */
if (rc == 0) {
- req->crq.s.status = 0x99; /* Just needs to be non-zero */
+ req->crq.s.status = VIOSRP_OK;
} else {
- req->crq.s.status = 0x00;
+ req->crq.s.status = VIOSRP_ADAPTER_FAIL;
}
rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw);
--
1.8.4.rc4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status
2014-03-05 5:15 [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status Alexey Kardashevskiy
@ 2014-03-05 8:16 ` Paolo Bonzini
2014-03-05 9:14 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2014-03-05 8:16 UTC (permalink / raw)
To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, Alexander Graf
Il 05/03/2014 06:15, Alexey Kardashevskiy ha scritto:
> Normally VIOSRP_OK (0) means success and non-zero value means error
> except VIOSRP_OK2 (0x99) which is another success code by weird accident.
>
> This uses 0 as success code always as some guests do not cope with
> the 0x99 value well. The existing linux driver checks for both VIOSRP_OK
> and VIOSRP_OK2 since 2.6.32.
>
> This returns non-zero code (VIOSRP_ADAPTER_FAIL == 0x10) on errors which
> can only happen if DMA write failed.
>
> Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> hw/scsi/spapr_vscsi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
> index e8bca39..6460e06 100644
> --- a/hw/scsi/spapr_vscsi.c
> +++ b/hw/scsi/spapr_vscsi.c
> @@ -193,9 +193,9 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req,
> req->crq.s.IU_data_ptr = req->iu.srp.rsp.tag; /* right byte order */
>
> if (rc == 0) {
> - req->crq.s.status = 0x99; /* Just needs to be non-zero */
> + req->crq.s.status = VIOSRP_OK;
> } else {
> - req->crq.s.status = 0x00;
> + req->crq.s.status = VIOSRP_ADAPTER_FAIL;
> }
>
> rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw);
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status
2014-03-05 5:15 [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status Alexey Kardashevskiy
2014-03-05 8:16 ` Paolo Bonzini
@ 2014-03-05 9:14 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2014-03-05 9:14 UTC (permalink / raw)
To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, Alexander Graf
Il 05/03/2014 06:15, Alexey Kardashevskiy ha scritto:
> Normally VIOSRP_OK (0) means success and non-zero value means error
> except VIOSRP_OK2 (0x99) which is another success code by weird accident.
>
> This uses 0 as success code always as some guests do not cope with
> the 0x99 value well. The existing linux driver checks for both VIOSRP_OK
> and VIOSRP_OK2 since 2.6.32.
>
> This returns non-zero code (VIOSRP_ADAPTER_FAIL == 0x10) on errors which
> can only happen if DMA write failed.
>
> Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> hw/scsi/spapr_vscsi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
> index e8bca39..6460e06 100644
> --- a/hw/scsi/spapr_vscsi.c
> +++ b/hw/scsi/spapr_vscsi.c
> @@ -193,9 +193,9 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req,
> req->crq.s.IU_data_ptr = req->iu.srp.rsp.tag; /* right byte order */
>
> if (rc == 0) {
> - req->crq.s.status = 0x99; /* Just needs to be non-zero */
> + req->crq.s.status = VIOSRP_OK;
> } else {
> - req->crq.s.status = 0x00;
> + req->crq.s.status = VIOSRP_ADAPTER_FAIL;
> }
>
> rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw);
>
Since Alex is on vacation, I've applied this to scsi-next.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-05 9:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 5:15 [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status Alexey Kardashevskiy
2014-03-05 8:16 ` Paolo Bonzini
2014-03-05 9:14 ` Paolo Bonzini
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).