Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/jdolecek-ncq]: src/sys/dev/ic only clear the bcount for NCQ case when th...



details:   https://anonhg.NetBSD.org/src/rev/d7c9fa8a5a6e
branches:  jdolecek-ncq
changeset: 822910:d7c9fa8a5a6e
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Apr 24 18:22:31 2017 +0000

description:
only clear the bcount for NCQ case when the transfer actually ended w/o error

diffstat:

 sys/dev/ic/ahcisata_core.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 99b25e30f8ac -r d7c9fa8a5a6e sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Mon Apr 24 15:15:02 2017 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Mon Apr 24 18:22:31 2017 +0000
@@ -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 @@
         * 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 -=



Home | Main Index | Thread Index | Old Index