Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Don't try to set ld->sc_maxxfer below MAXPHYS.



details:   https://anonhg.NetBSD.org/src/rev/226807a7ef20
branches:  trunk
changeset: 771758:226807a7ef20
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sat Dec 03 10:53:09 2011 +0000

description:
Don't try to set ld->sc_maxxfer below MAXPHYS.
At least genfs_io assumes 'ld->sc_maxxfer == MAXPHYS'.

diffstat:

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

diffs (34 lines):

diff -r fa305d26ee8c -r 226807a7ef20 sys/dev/pci/ld_virtio.c
--- a/sys/dev/pci/ld_virtio.c   Sat Dec 03 08:20:12 2011 +0000
+++ b/sys/dev/pci/ld_virtio.c   Sat Dec 03 10:53:09 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld_virtio.c,v 1.3 2011/11/23 19:40:42 hannken Exp $    */
+/*     $NetBSD: ld_virtio.c,v 1.4 2011/12/03 10:53:09 hannken Exp $    */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.3 2011/11/23 19:40:42 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.4 2011/12/03 10:53:09 hannken Exp $");
 
 #include "rnd.h"
 
@@ -272,6 +272,7 @@
                                        VIRTIO_BLK_CONFIG_BLK_SIZE);
        }
        maxxfersize = MAXPHYS;
+#if 0  /* At least genfs_io assumes maxxfer == MAXPHYS. */
        if (features & VIRTIO_BLK_F_SEG_MAX) {
                maxxfersize = virtio_read_device_config_4(vsc,
                                        VIRTIO_BLK_CONFIG_SEG_MAX)
@@ -279,6 +280,7 @@
                if (maxxfersize > MAXPHYS)
                        maxxfersize = MAXPHYS;
        }
+#endif
 
        if (virtio_alloc_vq(vsc, &sc->sc_vq[0], 0,
                            maxxfersize, maxxfersize / NBPG + 2,



Home | Main Index | Thread Index | Old Index