Skip to contentSkip to conversation

linux-2.5.6 scsi DMA mapping and compilation fixes (not yet working)

DISCUSSION Adam J. Richter 3 participants 3 messages Mar 12, 2002 – Mar 13, 2002

lore
Share & tools
lore
#0 lore raw

Warning: these drivers do not work yet.

ftp://ftp.yggdrasil.com/private/adam/scsi-linux-2.5.6-diff.gz

This patch allows all of the SCSI drivers that are available on
x86 to build, except for these:
o The NCR53c80-based drivers (according to Alan Cox, there is a new driver in the 2.4.x tree, and I don't want to add a port of that driver to this already huge patch).

o 53c7,8xx - I believe we have other scsi drivers that cover the same hardware, so I have skipped this driver.

o dpt_i2o - I need to understand the i2o system a little more to determine whether all of the similar looking code in drivers/messages/i2o and dpt_i2o is redundant or necessary.

The patch adds a little code to scsi.c to allow scsi drivers
to tell the mid-level code to automatically map and unmap gather/scatter lists. This has simplified the porting process immensely.

The patch also adds a routine for using the SCSI request
scratchpad area for accessing scsi requests in memory (primarily for non-DMA drivers). This eliminated some code replicated in a multiple scsi drivers and basically enabled me to the need to add very many calls to kmap and kunmap in each driver.

There are also a few patches that juat add PCI or ISAPnP
device ID's, so that the boards will work with automatic module loading based on device ID's.

I owe an email to Tim Sullivan who tried my BusLogic and found
that it paniced at initialization. So, these drivers probably do not work yet. Nevertheless, I would be interested in people looking at the patch or even trying it just to see how it fares on other hardware. All that I know is that the code compiles and has no undefined symbols, except for scsi_reset_host in BusLogic.c (I guess you can comment it out for now, which is I told Tim to try).

I want to emphasize that this patch is just a snapshot of
work in progress at this point. I just finished getting the drivers to compile and link. I am going to step away from this for a while, perhaps until tomorrow, but I thought I should post this in case anyone is interested.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[email protected]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America

fax +1 408 261-6631 "Free Software For The Rest Of Us."

#1 lore raw
Quoted 3 lines · Adam J. Richter

o The NCR53c80-based drivers (according to Alan Cox, there is a new driver in the 2.4.x tree, and I don't want to add a port of that driver to this already huge patch).

I believe changes to NCR53c80 were recently reverted back because these "fixes" lead to massive data corruption. It is preferable that the driver remains unbuildable, and therefore doesn't cause data corruption than to be buildable and case data corruption.

Alan has always advocated taking the 2.4 driver as an important first step in fixing it for 2.5 - this provides a sound base for the 2.5 fixes to be built upon. Not doing this just makes whoevers job to really fix the driver harder.

Hint: kernel programming is not about getting things to build. It's about making this work properly.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#2 lore raw
Quoted 4 lines

I believe changes to NCR53c80 were recently reverted back because these "fixes" lead to massive data corruption. It is preferable that the driver remains unbuildable, and therefore doesn't cause data corruption than to be buildable and case data corruption.

Someone "fixed" the 2.5 one by just frobbing randomly with the io_request_lock without noticing its not always used per queue in the driver (study the host list code - and dont think you can just clean that up by
using SHIRQ - that wont help on some non x86 stuff). I fed Dave Jones
the 2.4 stuff where the locking is fixed (tho using io_request_lock) and actually works SMP.

Dave then I suspect fed it to Linus