linux/include
Guennadi Liakhovetski cdb8c2a6d8 [SCSI] dc395x: dynamically map scatter-gather for PIO
The current dc395x driver uses PIO to transfer up to 4 bytes which do not
get transferred by DMA (under unclear circumstances). For this the driver
uses page_address() which is broken on highmem. Apart from this the
actual calculation of the virtual address is wrong (even without highmem).
So, e.g., for reading it reads bytes from the driver to a wrong address
and returns wrong data, I guess, for writing it would just output random
data to the device.

The proper fix, as suggested by many, is to dynamically map data using
kmap_atomic(page, KM_BIO_SRC_IRQ) / kunmap_atomic(virt). The reason why it
has not been done until now, although I've done some preliminary patches
more than a year ago was that nobody interested in fixing this problem was
able to reliably reproduce it. Now it changed - with the help from
Sebastian Frei (CC'ed) I was able to trigger the PIO path. Thus, I was
also able to test and debug it.

There are 4 cases when PIO is used in dc395x - data-in / -out with and
without scatter-gather. I was able to reproduce and test only data-in with
and without SG. So, the data-out path is still untested, but it is also
somewhat simpler than the data-in. Fredrik Roubert (also CC'ed) also had
PIO triggering on his system, and in his case it was data-out without SG.
It would be great if he could test the attached patch on his system, but
even if he cannot, I would still request to apply the patch and just wait
if anybody cries...

Implementation: I put 2 new functions in scsi_lib.c and their declarations
in scsi_cmnd.h. I exported them without _GPL, although, I don't feel
strongly about that - not many drivers are likely to use them. But there
is at least one more - I want to use them in tmscsim.c. Whether these are
the right files for the functions and their declarations - not sure
either. Actually, they are not scsi-specific, so, might go somewhere
around other scattergather magic? They are not platform specific either,
and most SG functions are defined under arch/*/... As these issues were
discussed previously there were some more routines suggested to manipulate
scattergather buffers, I think, some of them were needed around
crypto code... So, might be a common place reasonable, like
lib/scattergather.c? I am open here.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-04-14 16:45:27 -05:00
..
acpi [PATCH] s/;;/;/g 2006-03-24 07:33:24 -08:00
asm-alpha [PATCH] Configurable NODES_SHIFT 2006-04-11 06:18:39 -07:00
asm-arm [PATCH] S3C24XX GPIO LED support 2006-04-11 06:18:40 -07:00
asm-arm26 [PATCH] unify pfn_to_page: arm26 pfn_to_page 2006-03-27 08:44:44 -08:00
asm-cris [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-frv [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-generic [PATCH] mutex: some cleanups 2006-03-31 12:19:01 -08:00
asm-h8300 [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-i386 Merge branch 'splice' of git://brick.kernel.dk/data/git/linux-2.6-block 2006-04-11 06:34:02 -07:00
asm-ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2006-04-11 06:40:17 -07:00
asm-m32r [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-m68k [PATCH] m68k: fix undefined reference to generic_find_next_zero_le_bit 2006-03-26 08:57:13 -08:00
asm-m68knommu [PATCH] bitops: m68knommu: use generic bitops 2006-03-26 08:57:13 -08:00
asm-mips [PATCH] Configurable NODES_SHIFT 2006-04-11 06:18:39 -07:00
asm-parisc [PATCH] Configurable NODES_SHIFT 2006-04-11 06:18:39 -07:00
asm-powerpc [PATCH] Configurable NODES_SHIFT 2006-04-11 06:18:39 -07:00
asm-ppc [PATCH] lock PTE before updating it in 440/BookE page fault handler 2006-03-29 13:44:15 +11:00
asm-s390 [PATCH] S390: fix implicit declaration of (un)likely. 2006-04-11 06:18:39 -07:00
asm-sh [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-sh64 [PATCH] sys_kexec_load() naming fixups 2006-04-11 06:18:42 -07:00
asm-sparc [PATCH] sparc32 vga support 2006-04-11 06:18:54 -07:00
asm-sparc64 [PATCH] for_each_possible_cpu: sparc64 2006-04-11 06:18:31 -07:00
asm-um [PATCH] uml: fix "extern-vs-static" proto conflict in TLS code 2006-04-11 06:18:36 -07:00
asm-v850 [PATCH] Remove unused prepare_to_switch macro 2006-04-11 06:18:34 -07:00
asm-x86_64 [PATCH] x86_64: inline function prefix with __always_inline in vsyscall 2006-04-11 06:38:57 -07:00
asm-xtensa [PATCH] Remove unused prepare_to_switch macro 2006-04-11 06:18:34 -07:00
keys [PATCH] Keys: Remove key duplication 2006-01-06 08:33:29 -08:00
linux [SCSI] unify SCSI_IOCTL_SEND_COMMAND implementations 2006-04-13 10:13:15 -05:00
math-emu
media V4L/DVB (3702): Make msp3400 routing defines more consistent 2006-04-02 04:56:11 -03:00
mtd [MTD] user-abi: Clean up trailing white spaces 2005-11-07 14:43:11 +01:00
net [IPV6]: Deinline few large functions in inet6 code 2006-04-09 22:48:59 -07:00
pcmcia [PATCH] pcmcia: declare pccard_iodyn_ops (fix m8xx_pcmcia.c compilation error) 2006-03-31 21:49:51 +02:00
rdma IB: simplify static rate encoding 2006-04-10 09:43:47 -07:00
rxrpc [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
scsi [SCSI] dc395x: dynamically map scatter-gather for PIO 2006-04-14 16:45:27 -05:00
sound [ALSA] sound/core/pcm.c: make snd_pcm_format_name() static 2006-04-12 11:34:21 +02:00
video [PATCH] Remove MODULE_PARM 2006-03-25 08:22:52 -08:00