Messages in this thread Patch in this message |  | | From | Kevin Lentin <> | Subject | Patch for NCR5380 | Date | Fri, 22 Nov 1996 16:17:21 +1100 (EST) |
| |
The following patch fixes a little problem in the ncr53c400 code inside g_NCR5380.c
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 @@ blocks--; } + if (blocks) { #if (NDEBUG & NDEBUG_C400_PREAD) - printk("53C400r: EXTRA: Waiting for buffer\n"); + printk("53C400r: EXTRA: Waiting for buffer\n"); #endif - while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) - ; + while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) + ; #if (NDEBUG & NDEBUG_C400_PREAD) - printk("53C400r: Transferring EXTRA 128 bytes\n"); + printk("53C400r: Transferring EXTRA 128 bytes\n"); #endif #ifdef CONFIG_SCSI_G_NCR5380_PORT for (i=0; i<128; i++) @@ -402,8 +403,13 @@ /* implies CONFIG_SCSI_G_NCR5380_MEM */ memmove(dst+start,NCR53C400_host_buffer+NCR5380_map_name,128); #endif - start+=128; - blocks--; + start+=128; + blocks--; + } +#if (NDEBUG & NDEBUG_C400_PREAD) + else + printk("53C400r: No EXTRA required\n"); +#endif #if (NDEBUG & NDEBUG_C400_PREAD) printk("53C400r: Final values: blocks=%d start=%d\n", blocks, start); -- [======================================================================] [ Kevin Lentin Email: K.Lentin@cs.monash.edu.au ] [ finger kevinl@fangorn.cs.monash.edu.au for PGP public key block. ] [ KeyId: 06808EED FingerPrint: 6024308DE1F84314 811B511DBA6FD596 ] [======================================================================]
|  |