Patch for NCR5380

Kevin Lentin (
Fri, 22 Nov 1996 16:17:21 +1100 (EST)

The following patch fixes a little problem in the ncr53c400 code inside

When writing the code, I noticed that the cards don't conform to the spec
and a certain register goes high too early, when one pdma block is
outstanding. So I added the EXTRA code to push the extra block if it
was still there even if the card said the loop was finished. It later
turned out that in some WRITE cases, the extra block was _not_ necessary
and the card behaved correctly, so I patched pwrite. Recently a
friend's machine started locking up and it turned out that his CDROM was
causing a similar problem in the READ code and I was surprised I had not
mirrored the code.

This patch adds the 'EXTRA' check into the pread function and has fixed the
lockups on that machine. Hopefully it will fix other problems I've had
reported to me, especially on Trantor T130B's.

--- drivers/scsi/g_NCR5380.c.orig Tue Oct 22 22:08:49 1996
+++ drivers/scsi/g_NCR5380.c Tue Oct 22 22:09:47 1996
@@ -386,14 +386,15 @@

+ if (blocks) {
- printk("53C400r: EXTRA: Waiting for buffer\n");
+ printk("53C400r: EXTRA: Waiting for buffer\n");
- ;
+ ;

- printk("53C400r: Transferring EXTRA 128 bytes\n");
+ printk("53C400r: Transferring EXTRA 128 bytes\n");
for (i=0; i<128; i++)
@@ -402,8 +403,13 @@
/* implies CONFIG_SCSI_G_NCR5380_MEM */
- start+=128;
- blocks--;
+ start+=128;
+ blocks--;
+ }
+ else
+ printk("53C400r: No EXTRA required\n");

printk("53C400r: Final values: blocks=%d start=%d\n", blocks, start);

[     Kevin Lentin               Email:      ]
[   finger for PGP public key block.   ]
[  KeyId: 06808EED    FingerPrint: 6024308DE1F84314  811B511DBA6FD596  ]