Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci If an allocation cannot be satisfied by the pref...



details:   https://anonhg.NetBSD.org/src/rev/3d8307e246fd
branches:  trunk
changeset: 1023261:3d8307e246fd
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Aug 30 22:49:03 2021 +0000

description:
If an allocation cannot be satisfied by the prefetchable range, retry with
the non-prefetchable range.

diffstat:

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

diffs (30 lines):

diff -r 797256b1ac3a -r 3d8307e246fd sys/dev/pci/pciconf.c
--- a/sys/dev/pci/pciconf.c     Mon Aug 30 22:48:16 2021 +0000
+++ b/sys/dev/pci/pciconf.c     Mon Aug 30 22:49:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciconf.c,v 1.52 2021/01/03 10:31:37 skrll Exp $       */
+/*     $NetBSD: pciconf.c,v 1.53 2021/08/30 22:49:03 jmcneill Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.52 2021/01/03 10:31:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.53 2021/08/30 22:49:03 jmcneill Exp $");
 
 #include "opt_pci.h"
 
@@ -1012,6 +1012,11 @@
 
                pm->address = pci_allocate_range(r, pm->size, pm->align,
                                                 ok64);
+               if (~pm->address == 0 && r == &pb->pmem_res) {
+                       r = &pb->mem_res;
+                       pm->address = pci_allocate_range(r, pm->size,
+                                                        pm->align, ok64);
+               }
                if (~pm->address == 0) {
                        print_tag(pd->pc, pd->tag);
                        printf(



Home | Main Index | Thread Index | Old Index