From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL7uI-00058e-DP for qemu-devel@nongnu.org; Wed, 05 Mar 2014 04:14:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL7uD-0001kT-J4 for qemu-devel@nongnu.org; Wed, 05 Mar 2014 04:14:30 -0500 Sender: Paolo Bonzini Message-ID: <5316EAEC.6090503@redhat.com> Date: Wed, 05 Mar 2014 10:14:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393996517-11250-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1393996517-11250-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] spapr-vscsi: fix CRQ status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, 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 > Signed-off-by: Alexey Kardashevskiy > --- > 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