Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/linux Treat pre-enabled devices as 1 e...



details:   https://anonhg.NetBSD.org/src/rev/16b05f874eaf
branches:  trunk
changeset: 835354:16b05f874eaf
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:19:59 2018 +0000

description:
Treat pre-enabled devices as 1 enablecnt.

diffstat:

 sys/external/bsd/drm2/linux/linux_pci.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 36c6ff8864e9 -r 16b05f874eaf sys/external/bsd/drm2/linux/linux_pci.c
--- a/sys/external/bsd/drm2/linux/linux_pci.c   Mon Aug 27 14:19:47 2018 +0000
+++ b/sys/external/bsd/drm2/linux/linux_pci.c   Mon Aug 27 14:19:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_pci.c,v 1.3 2018/08/27 14:17:04 riastradh Exp $  */
+/*     $NetBSD: linux_pci.c,v 1.4 2018/08/27 14:19:59 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.3 2018/08/27 14:17:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.4 2018/08/27 14:19:59 riastradh Exp $");
 
 #include <linux/pci.h>
 
@@ -711,6 +711,9 @@
 
        s = splhigh();
        csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+       /* If someone else (firmware) already enabled it, credit them.  */
+       if (csr & (PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE))
+               pdev->pd_enablecnt++;
        csr |= PCI_COMMAND_IO_ENABLE;
        csr |= PCI_COMMAND_MEM_ENABLE;
        pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);



Home | Main Index | Thread Index | Old Index