Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers
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
..
acorn
acpi [PATCH] x86_64: Support memory hotadd without sparsemem 2006-04-09 11:53:16 -07:00
amba
atm [PATCH] Replace 0xff.. with correct DMA_xBIT_MASK 2006-03-28 09:16:07 -08:00
base [PATCH] Fix NULL pointer dereference in node_read_numastat() 2006-04-11 06:18:30 -07:00
block [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
bluetooth [PATCH] pcmcia: use bitfield instead of p_state and state 2006-03-31 17:26:33 +02:00
cdrom [PATCH] Overrun in cdrom/aztcd.c 2006-04-11 06:18:46 -07:00
char [PATCH] RTC subsystem: VR41XX driver 2006-04-11 06:18:47 -07:00
connector
cpufreq [CPUFREQ] cpufreq_conservative: keep ignore_nice_load and freq_step values when reselected 2006-03-28 12:20:18 -05:00
crypto
dio
edac [PATCH] edac_752x needs CONFIG_HOTPLUG 2006-03-31 12:18:54 -08:00
eisa
fc4
firmware
hwmon [PATCH] hdaps: use ENODEV 2006-04-11 06:18:45 -07:00
i2c
ide Merge master.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2006-04-02 12:49:59 -07:00
ieee1394 [PATCH] sbp2: fix spinlock recursion 2006-04-02 12:58:09 -07:00
infiniband IB/mthca: Fix max_srq_sge returned by ib_query_device for Tavor devices 2006-04-12 11:42:30 -07:00
input Input: synaptics - limit rate to 40pps on Toshiba Protege M300 2006-04-02 00:10:18 -05:00
isdn [ISDN]: Static overruns in drivers/isdn/i4l/isdn_ppp.c 2006-04-11 17:29:17 -07:00
leds [PATCH] leds: reorganise Kconfig 2006-04-11 06:18:40 -07:00
macintosh Merge ../linux-2.6 2006-03-29 13:24:50 +11:00
mca
md [PATCH] md: make sure 64bit fields in version-1 metadata are 64-bit aligned 2006-04-11 06:18:30 -07:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2006-04-11 06:41:02 -07:00
message [SCSI] mptfusion - fix panic in mptsas_slave_configure 2006-04-14 09:35:12 -05:00
mfd
misc [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
mmc [ARM] 3457/1: i.MX: SD/MMC support for i.MX/MX1 2006-04-02 19:27:07 +01:00
mtd [PATCH] Remove blkmtd 2006-04-11 06:18:43 -07:00
net Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2006-04-12 15:24:06 -07:00
nubus
oprofile [PATCH] mark f_ops const in the inode 2006-03-28 09:16:05 -08:00
parisc [PARISC] I/O-Space must be ioremap_nocache()'d 2006-03-30 17:48:42 +00:00
parport [PATCH] parport: remove duplicate entry for NETMOS_9835 2006-04-11 06:18:45 -07:00
pci
pcmcia Merge master.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2006-04-02 12:49:59 -07:00
pnp
rapidio
rtc [PATCH] RTC subsystem: VR41XX cleanup 2006-04-11 06:18:47 -07:00
s390 [PATCH] s390: minor tape fixes 2006-04-11 06:18:38 -07:00
sbus
scsi [SCSI] dc395x: dynamically map scatter-gather for PIO 2006-04-14 16:45:27 -05:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-04-02 12:58:45 -07:00
sh
sn [PATCH] Last DMA_xBIT_MASK cleanups 2006-04-11 06:18:44 -07:00
spi
tc
telephony [PATCH] pcmcia: use bitfield instead of p_state and state 2006-03-31 17:26:33 +02:00
usb [PATCH] Overrun in option-card USB driver 2006-04-11 06:24:15 -07:00
video [PATCH] fbdev: Use logo with depth of 4 or less for static pseudocolor 2006-04-11 06:18:54 -07:00
w1
zorro
Kconfig [PATCH] LED: add LED class 2006-03-31 12:18:56 -08:00
Makefile Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband 2006-04-02 12:51:22 -07:00