Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Avoid xcall(9) while cold.



details:   https://anonhg.NetBSD.org/src/rev/e17b0c681378
branches:  trunk
changeset: 796245:e17b0c681378
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon May 26 19:13:20 2014 +0000

description:
Avoid xcall(9) while cold.

diffstat:

 sys/dev/pci/agp_i810.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 176f9e25b949 -r e17b0c681378 sys/dev/pci/agp_i810.c
--- a/sys/dev/pci/agp_i810.c    Mon May 26 19:12:43 2014 +0000
+++ b/sys/dev/pci/agp_i810.c    Mon May 26 19:13:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_i810.c,v 1.76 2014/05/24 14:17:29 riastradh Exp $  */
+/*     $NetBSD: agp_i810.c,v 1.77 2014/05/26 19:13:20 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.76 2014/05/24 14:17:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.77 2014/05/26 19:13:20 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -203,7 +203,19 @@
                break;
        case CHIP_I830:
        case CHIP_I855:
-               xc_wait(xc_broadcast(0, &agp_flush_cache_xc, NULL, NULL));
+               /*
+                * Flush all CPU caches.  If we're cold, we can't run
+                * xcalls, but there should be only one CPU up, so
+                * flushing only the local CPU's cache should suffice.
+                *
+                * XXX Come to think of it, do these chipsets appear in
+                * any multi-CPU systems?
+                */
+               if (cold)
+                       agp_flush_cache();
+               else
+                       xc_wait(xc_broadcast(0, &agp_flush_cache_xc,
+                               NULL, NULL));
                WRITE4(AGP_I830_HIC, READ4(AGP_I830_HIC) | __BIT(31));
                while (ISSET(READ4(AGP_I830_HIC), __BIT(31))) {
                        if (timo-- == 0)



Home | Main Index | Thread Index | Old Index