From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37652 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLXkC-0007V3-Ew for qemu-devel@nongnu.org; Thu, 25 Nov 2010 04:03:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLXkB-0005CR-9D for qemu-devel@nongnu.org; Thu, 25 Nov 2010 04:03:56 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58330 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLXkA-0005CI-Tn for qemu-devel@nongnu.org; Thu, 25 Nov 2010 04:03:55 -0500 Message-ID: <4CEE2724.6000801@suse.de> Date: Thu, 25 Nov 2010 10:06:44 +0100 From: Hannes Reinecke MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] scsi-generic: bugfixes for 'SCSIRequest' conversion References: <1290586723-8724-1-git-send-email-nab@linux-iscsi.org> <4CECD36E.50401@suse.de> <4CECD50F.9060501@redhat.com> <4CECE609.7080600@suse.de> <4CECEA2A.40008@redhat.com> <4CECED12.5020109@suse.de> <1290674774.32570.106.camel@pasglop> <4CEE2343.3090505@redhat.com> <1290675704.32570.114.camel@pasglop> In-Reply-To: <1290675704.32570.114.camel@pasglop> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel , "Nicholas A. Bellinger" , Gerd Hoffmann , Paolo Bonzini , linux-iscsi-target-dev@googlegroups.com On 11/25/2010 10:01 AM, Benjamin Herrenschmidt wrote: > On Thu, 2010-11-25 at 09:50 +0100, Gerd Hoffmann wrote: >> On 11/25/10 09:46, Benjamin Herrenschmidt wrote: >> >>> So far tho, it appears that I can (at least with scsi-disk) rely on >>> always been eventually called with SCSI_REASON_DONE so my code (and >>> maybe the usb-msd code too, I haven't verified) relies on that to >>> complete requests... Is that incorrect ? >> >> Yes. >=20 > Well, so far it works :-) But I suppose I must be lucky.. I must admit > that it's very unclear how that SCSI "stack" is meant to be used from > the HBA standpoint. >=20 > Right now, I've somewhat come up with: >=20 > - client request occurs > - call device send_command() > - if result is 0, assume my complete() was called with=20 > SCSI_REASON_DONE > - else, use sign of result for transfer direction, store the > absolute value as the total expected transfer len and call > the device scsi_data_read()/write() and wait for complete() > - when complete() is called: > - if SCSI_REASON_DONE, complete client request > - else perform the client "DMA" for "arg" bytes > - call the device scsi_data_read()/write() again >=20 No, this is exactly as I'm expecting the SCSI layer to work. So from the light of this the patch to scsi-generic is valid. And it really looks like papering over a bug in the lsi HBA code. Gerd? Cheers, Hannes --=20 Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg GF: Markus Rex, HRB 16746 (AG N=C3=BCrnberg)