Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/spi Reset b_resid when tossing transfer with non-zer...



details:   https://anonhg.NetBSD.org/src/rev/103475d29a2e
branches:  trunk
changeset: 347240:103475d29a2e
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Aug 19 03:23:39 2016 +0000

description:
Reset b_resid when tossing transfer with non-zero b_error.

diffstat:

 sys/dev/spi/spiflash.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 8771c79fe234 -r 103475d29a2e sys/dev/spi/spiflash.c
--- a/sys/dev/spi/spiflash.c    Fri Aug 19 00:05:43 2016 +0000
+++ b/sys/dev/spi/spiflash.c    Fri Aug 19 03:23:39 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spiflash.c,v 1.18 2015/07/22 10:07:59 ryo Exp $ */
+/* $NetBSD: spiflash.c,v 1.19 2016/08/19 03:23:39 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.18 2015/07/22 10:07:59 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.19 2016/08/19 03:23:39 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -313,6 +313,7 @@
        sc = device_lookup_private(&spiflash_cd, DISKUNIT(bp->b_dev));
        if (sc == NULL) {
                bp->b_error = ENXIO;
+               bp->b_resid = bp->b_bcount;
                biodone(bp);
                return;
        }
@@ -320,6 +321,7 @@
        if (((bp->b_bcount % sc->sc_write_size) != 0) ||
            (bp->b_blkno < 0)) {
                bp->b_error = EINVAL;
+               bp->b_resid = bp->b_bcount;
                biodone(bp);
                return;
        }



Home | Main Index | Thread Index | Old Index