Re: [patch 0/4] aha152x.c - Cleanup, need help in testing and auditing

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

 



On Thu, 2007-08-16 at 10:20 -0700, Randy Dunlap wrote:
> > For DMA transfers ... which is where you give the device a bus physical
> > address and a length and tell it to go off and perform the transfer on
> > its own, you need to use the dma_map_ functions.
> > 
> > For PIO transfers, which are usually ones where you have to feed the
> > data into a special device register, since the kernel needs access to do
> > this, it has to be done via kmap_atomic()/kunmap_atomic().  So, if
> > everything has to go via pio, you use a sequence like
> 
> Thanks for the confirmation.
> 
> > scsi_for_each_sg(cmd, sg, max, i) {
> > 	offset = sg->offset;
> > 	len = sg->len;
> 		->length;
> 
> > 	do {
> > 		coffset = offset; clen =len;
> > 		buf = scsi_kmap_atomic_sg(sg, 1, &coffset, &clen)
> 
> 					why   1 ?

You're mapping a single segment at a time to do the PIO.

> > 		offset -= coffset; clen -= len;
> 
> 		       += ?
> 
> > 		<feed buf+coffset to/from PIO for clen>
> > 		scsi_kunmap_atomic_sg(buf);
> > 	} while (len > 0);
> > }
> 

James


-
To unsubscribe from this list: 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