Module Name: src Committed By: jdolecek Date: Mon Apr 24 18:22:32 UTC 2017
Modified Files: src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c Log Message: only clear the bcount for NCQ case when the transfer actually ended w/o error To generate a diff of this commit: cvs rdiff -u -r1.57.6.10 -r1.57.6.11 src/sys/dev/ic/ahcisata_core.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/dev/ic/ahcisata_core.c diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.10 src/sys/dev/ic/ahcisata_core.c:1.57.6.11 --- src/sys/dev/ic/ahcisata_core.c:1.57.6.10 Mon Apr 24 15:15:02 2017 +++ src/sys/dev/ic/ahcisata_core.c Mon Apr 24 18:22:31 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_core.c,v 1.57.6.10 2017/04/24 15:15:02 jdolecek Exp $ */ +/* $NetBSD: ahcisata_core.c,v 1.57.6.11 2017/04/24 18:22:31 jdolecek Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.10 2017/04/24 15:15:02 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.11 2017/04/24 18:22:31 jdolecek Exp $"); #include <sys/types.h> #include <sys/malloc.h> @@ -1339,7 +1339,8 @@ ahci_bio_complete(struct ata_channel *ch * not required to be valid; in that case underflow is always illegal. */ if ((xfer->c_flags & C_NCQ) != 0) { - ata_bio->bcount = 0; + if (ata_bio->error == NOERROR) + ata_bio->bcount = 0; } else { if ((ata_bio->flags & ATA_READ) || ata_bio->error == NOERROR) ata_bio->bcount -=