Re: [PATCH] dc395x: dynamically map scatter-gather for PIO (take 2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Apr 2006 23:02:04 +0200 (CEST) Guennadi Liakhovetski wrote:

> On Thu, 13 Apr 2006, Randy.Dunlap wrote:
> 
> > On Sun, 2 Apr 2006 21:57:43 +0200 (CEST) Guennadi Liakhovetski wrote:
> > 
> > > Hello all,
> > > 
> > > This time I really mean it:-)
> > 
> > Hi Guennadi,
> > James pointed me at this patch since I have aha152x also having
> > problems with using page_address() while trying to do PIO.
> > I see a NULL pointer during a data-out phase.  I'll attempt
> > to use the kmap_atomic() support that you have added in the
> > aha152x driver.
> 
> Would be great to put these functions under some more extensive testing! 
> I also want to use them in tmscsim, but there I do not have a test case 
> for PIO:-(

I have a patch that seems to work for the data-in phase of the
aha152x (_cs) driver.  However, the data-out phase is causing
data corruption.  (I'm only using it on a test target, so no big
deal.)

Does anyone know/recall this condition in aha152x.c::datao_end() ?
("bytes to resend"):

	if(TESTLO(DMASTAT, DFIFOEMP)) {
		int data_count = (DATA_LEN - CURRENT_SC->resid) - GETSTCNT();

		DPRINTK(debug_datao, DEBUG_LEAD "datao: %d bytes to resend (%d written, %d transferred)\n",
			CMDINFO(CURRENT_SC),
			data_count,
			DATA_LEN-CURRENT_SC->resid,
			GETSTCNT());

		CURRENT_SC->resid += data_count;

and then (if use_sg), the driver mucks with the SCp scratch/work area:

		if(CURRENT_SC->use_sg) {
			data_count -= CURRENT_SC->SCp.ptr - SG_ADDRESS(CURRENT_SC->SCp.buffer);
			while(data_count>0) {
				CURRENT_SC->SCp.buffer--;
				CURRENT_SC->SCp.buffers_residual++;
				data_count -= CURRENT_SC->SCp.buffer->length;
			}
			CURRENT_SC->SCp.ptr           = SG_ADDRESS(CURRENT_SC->SCp.buffer) - data_count;
			CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length + data_count;
		} else {
			CURRENT_SC->SCp.ptr           -= data_count;
			CURRENT_SC->SCp.this_residual += data_count;
		}
	}

Does modifying the SCp: buffer, buffers_residual, ptr, this_residual...
tell the SCSI mid-layer anything?  or does this tell the driver
internally where to restart a data transfer?  (if so, where is that,
if anyone knows.  I can't find it.)

---
~Randy
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux