Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/pci Pull up following revision(s) (requested by u...



details:   https://anonhg.NetBSD.org/src/rev/57833f2bd1b3
branches:  netbsd-8
changeset: 434644:57833f2bd1b3
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Feb 19 18:19:15 2018 +0000

description:
Pull up following revision(s) (requested by uwe in ticket #553):
        sys/dev/pci/virtio_pci.c: 1.2 via patch to sys/dev/pci/virtio.c
Explicitly enable PCI_COMMAND_MASTER_ENABLE and PCI_COMMAND_IO_ENABLE.
Recent versions of VirtualBox do not enable bus-mastering by default -
this will be fixed, but it doesn't hurt to do it ourselves too.

diffstat:

 sys/dev/pci/virtio.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 24053e4719a0 -r 57833f2bd1b3 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c      Fri Feb 16 16:36:03 2018 +0000
+++ b/sys/dev/pci/virtio.c      Mon Feb 19 18:19:15 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtio.c,v 1.28 2017/06/01 02:45:11 chs Exp $  */
+/*     $NetBSD: virtio.c,v 1.28.2.1 2018/02/19 18:19:15 snj Exp $      */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.28 2017/06/01 02:45:11 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.28.2.1 2018/02/19 18:19:15 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -392,6 +392,7 @@
        pcitag_t tag = pa->pa_tag;
        int revision;
        pcireg_t id;
+       pcireg_t csr;
 
        revision = PCI_REVISION(pa->pa_class);
        if (revision != 0) {
@@ -409,6 +410,10 @@
                           virtio_device_name[PCI_SUBSYS_ID(id)] : "Unknown"),
                          revision);
 
+       csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
+       csr |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_IO_ENABLE;
+       pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+
        sc->sc_dev = self;
        sc->sc_pc = pc;
        sc->sc_tag = tag;



Home | Main Index | Thread Index | Old Index