Module Name: src Committed By: nat Date: Sat Oct 26 20:58:35 UTC 2024
Modified Files: src/sys/arch/mac68k/dev: sbc.c Log Message: Write an extra byte to handle the last ACK from 5380. This was found from the example code in the NCR5380 Interface Manual. This is not needed (but does not hurt) on the 53C80 and later. This fixed many problems from stuck busy to phase mismatches when aborting transfers and avoiding hard lockups of the scsi subsystem originating from what I first thought were errors from the target device. XXX pullup-9, pullup 10. I will look next at the pdma_out function to do the same there. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mac68k/dev/sbc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mac68k/dev/sbc.c diff -u src/sys/arch/mac68k/dev/sbc.c:1.61 src/sys/arch/mac68k/dev/sbc.c:1.62 --- src/sys/arch/mac68k/dev/sbc.c:1.61 Sat Oct 26 20:53:07 2024 +++ src/sys/arch/mac68k/dev/sbc.c Sat Oct 26 20:58:34 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: sbc.c,v 1.61 2024/10/26 20:53:07 nat Exp $ */ +/* $NetBSD: sbc.c,v 1.62 2024/10/26 20:58:34 nat Exp $ */ /* * Copyright (C) 1996 Scott Reynolds. All rights reserved. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.61 2024/10/26 20:53:07 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.62 2024/10/26 20:58:34 nat Exp $"); #include "opt_ddb.h" @@ -543,11 +543,17 @@ sbc_drq_intr(void *p) dh->dh_flags |= SBC_DH_DONE; if (dcount >= MAX_DMA_LEN) drq = (volatile u_int8_t *)sc->sc_drq_addr; + /* + * Write an extra byte to handle last ack. + * From NCR5380 Interface manual. + */ + *drq = 0; /* * XXX -- Read a byte from the SBC to trigger a /BERR. * This seems to be necessary for us to notice that * the target has disconnected. Ick. 06 jun 1996 (sr) + * Unsure if this is still necessary - See comment above. */ (void)*drq; } else { /* Data In */