summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1997-04-24 16:52:18 +0000
committergibbs <gibbs@FreeBSD.org>1997-04-24 16:52:18 +0000
commit3ca5733308e4f7acc28a4cb8b28cbb0ade9573c4 (patch)
tree4124b8ff69ba360421a93675b0bc71e9cbd33383
parent96ee89db8ac466642c97066df622847f516e2f19 (diff)
downloadFreeBSD-src-3ca5733308e4f7acc28a4cb8b28cbb0ade9573c4.zip
FreeBSD-src-3ca5733308e4f7acc28a4cb8b28cbb0ade9573c4.tar.gz
The following scenario would result in a bogus residual being reported
if SCB Paging was enabled: disconnect with more data to transfer disconnected SCB gets paged out target reconnects so we page SCB back in target completes transfer so residual is 0 target disconnects SCB gets reused but not paged out since the residual is 0 (optimization) target reconnects so we page the SCB back in we report a residual because of stale residual information. The fix for this is to set a flag that forces the SCB to be paged back up to the host if we page in an SCB with a residual Pointed out by: Doug Ledford <dledford@dialnet.net>
-rw-r--r--sys/dev/aic7xxx/aic7xxx.reg4
-rw-r--r--sys/dev/aic7xxx/aic7xxx.seq7
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg
index ac45ec2..2bb3184 100644
--- a/sys/dev/aic7xxx/aic7xxx.reg
+++ b/sys/dev/aic7xxx/aic7xxx.reg
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.reg,v 1.1 1997/03/16 07:08:11 gibbs Exp $
+ * $Id: aic7xxx.reg,v 1.2 1997/04/14 02:26:56 gibbs Exp $
*/
/*
@@ -764,7 +764,7 @@ scb {
bit MK_MESSAGE 0x80
bit DISCENB 0x40
bit TAG_ENB 0x20
- bit SPLIT_SG 0x10
+ bit MUST_DMAUP_SCB 0x10
bit ABORT_SCB 0x08
bit DISCONNECTED 0x04
mask SCB_TAG_TYPE 0x03
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq
index 0a64425..f6cfe81 100644
--- a/sys/dev/aic7xxx/aic7xxx.seq
+++ b/sys/dev/aic7xxx/aic7xxx.seq
@@ -37,7 +37,7 @@
*OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*SUCH DAMAGE.
*
- * $Id: aic7xxx.seq,v 1.71 1997/04/14 02:26:59 gibbs Exp $
+ * $Id: aic7xxx.seq,v 1.72 1997/04/18 16:31:55 gibbs Exp $
*
*-M************************************************************************/
@@ -980,6 +980,8 @@ findSCB_loop:
mov ALLZEROS call get_free_or_disc_scb;
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
mov ARG_1 call dma_scb;
+ test SCB_RESID_SGCNT, 0xff jz . + 2;
+ or SCB_CONTROL, MUST_DMAUP_SCB;
test SCB_CONTROL, ABORT_SCB jz return;
find_error:
mvi SINDEX, SCB_LIST_NULL ret;
@@ -1117,6 +1119,9 @@ dequeue_disc_scb:
* and we have to send this SCB back up to the kernel so that the
* saved data pointers and residual information isn't lost.
*/
+ test SCB_CONTROL, MUST_DMAUP_SCB jz . + 3;
+ and SCB_CONTROL, ~MUST_DMAUP_SCB;
+ jmp dma_up_scb;
test SCB_RESID_SGCNT,0xff jnz dma_up_scb;
cmp SCB_LINKED_NEXT, SCB_LIST_NULL je unlink_disc_scb;
dma_up_scb:
OpenPOWER on IntegriCloud