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/pci Don't try to interpret the second ...



details:   https://anonhg.NetBSD.org/src/rev/3ae0e0df1dcf
branches:  trunk
changeset: 445859:3ae0e0df1dcf
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Nov 15 06:53:58 2018 +0000

description:
Don't try to interpret the second half of a 64-bit BAR as another one.

>From msaitoh@.

diffstat:

 sys/external/bsd/drm2/pci/drm_pci.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r eea2ceb27648 -r 3ae0e0df1dcf sys/external/bsd/drm2/pci/drm_pci.c
--- a/sys/external/bsd/drm2/pci/drm_pci.c       Thu Nov 15 05:43:57 2018 +0000
+++ b/sys/external/bsd/drm2/pci/drm_pci.c       Thu Nov 15 06:53:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_pci.c,v 1.31 2018/08/28 03:41:39 riastradh Exp $   */
+/*     $NetBSD: drm_pci.c,v 1.32 2018/11/15 06:53:58 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.31 2018/08/28 03:41:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.32 2018/11/15 06:53:58 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -106,6 +106,14 @@
                        continue;
                }
 
+               /*
+                * If it's a 64-bit mapping, don't interpret the second
+                * half of it as another BAR in the next iteration of
+                * the loop -- move on to the next unit.
+                */
+               if (PCI_MAPREG_MEM_TYPE(type) == PCI_MAPREG_MEM_TYPE_64BIT)
+                       unit++;
+
                /* Inquire about it.  We'll map it in drm_legacy_ioremap.  */
                if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, reg, type,
                        &bm->bm_base, &bm->bm_size, &bm->bm_flags) != 0) {



Home | Main Index | Thread Index | Old Index