Linkspfeil Back to Linux/Free Software Page

Linux Tekram DC395/DC315 (TRM-S1040) SCSI driver

Description

This page hosts the Linux Tekram DC395/315 PCI SCSI driver. These SCSI adapters are based on Tekram's TRM-S1040 ASIC chip. A driver for this was written by Erich Chen and C.L. Huang from Tekram.
I did some clean-ups (mostly locking to support Linux-2.2 SMP) immediately. Erich has passed maintainership to me, so I will support this driver now.
Since then, I did spend a considerable time to debug the driver and finally got it working ...
Driver maintenance and support is only possible, because SuSE GmbH is paying me for doing it. Thanks!

Status

Currently (99/07/15), I just received my DC395UW, so the testing has not yet been very extensive. In my revisions (1.01/1.07,1.08) the SMP locking is most probably fixed and I'm pretty sure I introduced no bugs. However, the version given to me by Tekram is not supposed to be bug-free.
So, have backups and disks to boot from, when using this driver to access your harddisk. Have your partition table at some safe location.
(00/02/14)The driver and the adapter has undergone some serious testing by now and should work in most cases. Please still read the README.dc395 file to learn about the maximum speeds being safe for your SCSI setup.

Download

Browse directory

Version 1.41 (2002-06-21)


Doug Gilbert started converting to new exception handling and contributed the code to me. Keith Owens found a number of unaligned accesses on iA64 (the driver seems to work there!) and send fixes. I collected stuff, and cleaned up the exception handling somewhat. It does proper pci unmapping now for the aborted commands, e.g. (Thanks go to Martin Peschke and Aron Zeh for advice on new EH.) The Makefiles now also support 2.5 kernels.
If you want to compile with the new exception handling strategy on 2.4 kernels, you can force so by using make FORCE_NEW_EH=1. It will become default for 2.4 as well in one of the next versions of the driver when I have given it somewhat more testing.
Important: Unfortunately, a TAB slipped in after a backslash (\) in dc395x_trm.h line 68, which prevents successful compilation with old error handling. Please remove the TAB!
dc395-141.tar.gz, 72k, 2002-06-21
dc395-140-141.diff.gz, 9k, 2002-06-21

Version 1.40 (2002-05-10)


Unloading the module resulted in a double free for the DCBs, which could trigger an OOps (or memory corruption). Fixed. Also the debug trace buffer of the temporary SRB is now initialized.
dc395-140.tar.gz, 71k, 2002-05-10
dc395-139-140.diff.gz, 3k, 2002-05-10

Version 1.39 (2002-04-24)


The interrupt handler would Oops if invoked before initialisation of the driver. Even afterwards, if having more than one adapter, deadlocks could occur. Thanks to Paul Rolland for spotting this bug! The 1.38a patch (for compilation on pre 2.4.16 kernels) is included of course.
dc395-139.tar.gz, 71k, 2002-04-27
dc395-138-139.diff.gz, 2k, 2002-04-27

Version 1.38 (2002-03-11)


Fixed a potential memory corruption by having less SRB allocated than defined useable. (Could only be triggered with lots of devices with tagged command queueing enabled, though.) Fix a 2.4 issue on 64GB/PAE mode: scatterlist has either valid address or page/offset. Free DCBs on module unload.
dc395-138.tar.gz, 71k, 2002-03-11
dc395-137-138.diff.gz, 4k, 2002-03-11

Here's a patch that allows installation on pre-2.4.16 kernels.
dc395x-138-pre2416.diff, 0.3k, 2002-03-11

Version 1.37 (2002-02-28)


Changed memory allocation for SG tables and debug trace buffers to not waste memory on alignment. Free them on shutdown. (Note: The latter was missing from 1.36.)
dc395-137.tar.gz, 70k, 2002-02-28
dc395-136-137.diff.gz, 3k, 2002-02-28
dc395-135-137.diff.gz, 14k, 2002-02-28

Version 1.36 (2002-02-28)


Ported the driver to 2.5.5. This includes proper pci_map() usage and the new locking strategy. Furthermore another peculiarity (which appears to be a chip bug) resulting in 1 or 2 (wide) bytes missed at a page boundary and a disconnect on writing has been worked around. DMA interrupts (errors?) are ignored rather than aborting hte SCSI command, now. Some polling for DMA completion has been disabled.
Recreated 2.4 diff (2.4.17) and added 2.5 integration diff (2.5.5).
dc395-135-136.diff.gz, 14k, 2002-02-28

Version 1.35 (2001-12-06)


I slipped in a miscalculation of the residual bytes in the 1.34 changes. Stopped cdrecord from recognizing some CD-Rs and broke scanning. Fixed.
dc395-135.tar.gz, 67k, 2001-12-11
dc395-134-135.diff.gz, 2k, 2001-12-11

Version 1.34 (2001-11-14)


Do SG segment merging, if appropriate. Work around a bug in the chip's SCSI counter. Clean up data phase cleanup.
dc395-134.tar.gz, 67k, 2001-11-14
dc395-133-134.diff.gz, 6k, 2001-11-14

Version 1.33 (2001-07-09)


Just a maintenance release: Fixed compilation issues for gcc-2.96 snapshots (and later). Minor docu fixes. New patch against 2.4.6.
dc395-133.tar.gz, 66k, 2001-07-09
dc395-132-133.diff.gz, 3k, 2001-07-09

Version 1.32 (2000-12-02)


SCSI-IDs would show up twice, once for LUN 0 and once for LUN 1 with the 2.4 kernels due to the way of scanning. Fixed.
Installation: Change to your kernel source dir (probably /usr/src/linux) and apply the integ patch with -p1. You may ignore a FAILED patch in MAINTAINERS.
dc395-132.tar.gz, 66k, 2000-12-03
dc395-131-132.diff.gz, 2k, 2000-12-03

Version 1.31 (2000-11-24)


There was an occurence of pcmd->device left, eventually causing an Oops. Fixed. BIOS can now as well be overriden by cmd line parameters. Documented this. Some debugging changes.
dc395-131.tar.gz, 66k, 2000-11-24
dc395-130-131.diff.gz, 7k, 2000-11-24

Version 1.30 (2000-11-22)


Added PCI device table for 2.4. Use private field for storing INQUIRY flags to prevent null ptr deref on manual INQUIRY.
dc395-130.tar.gz, 65k, 2000-11-22
dc395-129-130.diff.gz, 2k, 2000-11-22

Version 1.29 (00/10/12)


Compilation of the driver statically into kernel 2.4 did not work, as the initializtion routine would not have been called due to kernel changes. Thanks to Ali Akcaagac <ali.akcaagac@stud.fh-wilhelmshaven.de> for telling me and testing the fix.

dc395-129.tar.gz, 65k, 00/10/14
dc395-128-129.diff.gz, 1k, 00/10/14

Version 1.28 (00/09/29)


The bug I'm hunting has still not yet been identified. Some changes for the 2.4 kernel have been done, so it should compile cleanly with that one. A patch to cleanly integrate it into 2.4 kernels is also included.
The code has been changed to only try sync and wide negotiation, if the device reports support for it. This should solve problems with old SCSI-1 scanners and similar devices.
dc395-128.tar.gz, 65k, 00/09/29
dc395-127-128.diff.gz, 5k, 00/09/29

Version 1.27 (00/05/24)


Lot of hacking to little avail. I tried to workaround the chip's failure to generate an IRQ when trying an arbitration/selection on a busy bus by using a timer. Unfortunately, the chip still sometimes thinks it succeeded, while it didn't, thus reporting crazy SCSI phases and data.
Besides that, hopefully an issue with FIFO clearing after receiving a message is solved.
A Makefile has been added to allow compilation outside the kernel. You still need to apply the patch to the kernel, though.
dc395-127.tar.gz, 64k, 00/05/24
dc395-126-127.diff.gz, 11k, 00/05/24

Version 1.26 (00/02/25)


I did intensive tests with write_ and read_buffer and found problems with some sizes. Odd data lengths were not handled well on wide connections in general. Sizes below 4 (2 for narrow) bytes seem to trigger a chip bug. And sizes just above a segment (whenever your device disconnects) were not correctly handled by the driver. All fixed. Plus a few changes to improve the compatibility with 2.0 and 2.3. (More needs to be done, but I wanted to get it out before the weekend. Yes, sometimes there is ...)
dc395-126.tar.gz, 63k, 00/02/25
dc395-125-126.diff.gz, 9k, 00/02/25

Version 1.25 (00/02/19)


There was one FIFO clear at the wrong place causing trouble for high speeds and causing a badblocks failure for at least one tester. Also the driver now does not try to arbitrate and select, if the bus is occupied by another controller, as the chip seems to not reliably generate an IRQ (SelTimeOut, Disconnect, Reselect or Phase Change) in that case.
dc395-125.tar.gz, 61k, 00/02/20
dc395-124-125.diff.gz, 14k, 00/02/20

Version 1.24 (00/02/14)


Minor glitches removed. Added support for command line (kernel or module) parameters. README updated. Downgrading of speeds now works properly.
dc395-124.tar.gz, 58k, 00/02/14
dc395-123-124.diff.gz, 10k, 00/02/14

Version 1.23 (00/02/11)


Finally shaken the bad bugs out of the driver. Please read README.dc395x for a description of problems being still existent, if your bus conditions are not perfect. The driver now also supports Linux 2.3 kernels.
dc395-123.tar.gz, 56k, 00/02/13
dc395-110a-123.diff.gz, 59k, 00/02/13

Version 1.10a (99/08/31)


Fixed a typo in dc395-integ20.diff.
dc395-110a.tar.gz, 36k, 99/08/31
dc395-110-110a.diff.gz, 1k, 99/08/31

Version 1.10 (99/07/19)


Works in nice environments, now ...
dc395-110.tar.gz, 36k, 99/07/19
dc395-109-110.diff.gz, 4k, 99/07/19

Version 1.09 (99/07/18)


Still some bugs left.
dc395-109.tar.gz, 36k, 99/07/18
dc395-108-109.diff.gz, 5k, 99/07/18

Version 1.08 (99/07/15)


Finally tested and known to work. Be careful anyway!
dc395-108.tar.gz, 35k, 99/07/15
dc395-107-108.diff.gz, 8k, 99/07/15

Version 1.07 (99/07/12)


Bugs fixed since 1.01. You need to download the file
dc395-107.tar.gz, 35k, 99/07/12

Installation (1.07 or higher)


It contains the two driver files, dc395x_trm.c and dc395x_trm.h and three patches, which should be applied to a 2.3, 2.2 resp. 2.0 kernel. So the installation is like this

cd /usr/src
cp -p /path/to/dc395/dc395x_trm.? linux/drivers/scsi/
patch -p0 </path/to/dc395/dc395-integ.diff
The included README.dc395x file contains some hints about the status of the driver and its features.
For 2.0 use dc395-integ20.diff instead.

Old Version 1.01 (99/06/28)


You need to download two patches. One with the driver files and one for integration into your kernel setup. Apply these patches by
cd /usr/src/linux
zcat dc395-driver.gz | patch -p1
cat dc395-integ.diff | patch -p1
Here are the files:
dc395-driver.gz, 32k, 99/06/28
dc395-integ.diff, 2.5k, 99/06/28
dc395-integ20.diff, 3.5k, 99/06/28

On reconfiguration of your kernel, enable Tekram DC395/DC315 support (CONFIG_SCSI_DC395x_TRMS1040). Recompile you kernel.

History

Changes since 1.00 (= Tekram's release):

Problems

If you have problems contact me: Kurt Garloff <garloff@suse.de>.
(w) by KG, last change May, 10, 2002