From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ming Lei Subject: Re: [PATCH V4 11/16] scsi: aha152x: use sg helper to operate scatterlist Date: Tue, 18 Jun 2019 08:15:37 +0800 Message-ID: <20190618001536.GA5774@ming.t460p> References: <20190617030349.26415-1-ming.lei@redhat.com> <20190617030349.26415-12-ming.lei@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Finn Thain Cc: Michael Schmitz , devel@driverdev.osuosl.org, Hannes Reinecke , Benjamin Block , linux-scsi@vger.kernel.org, "Martin K . Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, James Smart , "Ewan D . Milne" , Jim Gill , James Bottomley , Brian King , "Juergen E . Fischer" , Christoph Hellwig , Dan Carpenter , Bart Van Assche List-Id: linux-scsi@vger.kernel.org On Tue, Jun 18, 2019 at 09:35:48AM +1000, Finn Thain wrote: > On Mon, 17 Jun 2019, Finn Thain wrote: > > > On Mon, 17 Jun 2019, Ming Lei wrote: > > > > > Use the scatterlist iterators and remove direct indexing of the > > > scatterlist array. > > > > > > This way allows us to pre-allocate one small scatterlist, which can be > > > chained with one runtime allocated scatterlist if the pre-allocated one > > > isn't enough for the whole request. > > > > > > Finn added the change to replace SCp.buffers_residual with sg_is_last() > > > for fixing updating it, and the similar change has been applied on > > > NCR5380.c > > > > > > Cc: Finn Thain > > > Signed-off-by: Ming Lei > > > > Reviewed-by: Finn Thain > > > > I have to retract that. I think this patch is still wrong. > > GETSTCNT() appears to be the number of bytes sent since datao_init() and > not the number of bytes sent since the start of the command. (Note the > CLRSTCNT in datao_init() which appears to clear the transfer counter.) I > don't see how the existing datao_end() could work otherwise. (Juergen?) > > So here's another attempt. Ming, I'd be happy to take the blame/credit (in > the form of a From tag etc.) in case you don't want to spend more time on > this. Sure, will do that in V5. Thanks, Ming