From owner-freebsd-current@FreeBSD.ORG Wed Oct 6 06:43:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5897216A4ED for ; Wed, 6 Oct 2004 06:43:45 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id D762F43D45 for ; Wed, 6 Oct 2004 06:43:44 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i966gFEX017345 for ; Wed, 6 Oct 2004 00:42:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 06 Oct 2004 00:43:53 -0600 (MDT) Message-Id: <20041006.004353.49436123.imp@bsdimp.com> To: Bcc-Receiver: ; From: "M. Warner Losh" X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Oct__6_00:43:53_2004_540)--" Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 06 Oct 2004 12:19:13 +0000 Subject: A blind carbon copy X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 06:43:45 -0000 ----Next_Part(Wed_Oct__6_00:43:53_2004_540)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit This is a blind carbon copy. ----Next_Part(Wed_Oct__6_00:43:53_2004_540)-- Content-Type: Message/Rfc822 Content-Transfer-Encoding: 7bit Date: Wed, 06 Oct 2004 00:43:53 -0600 (MDT) Message-Id: <20041006.004353.08394386.imp@bsdimp.com> To: mobile@freebsd.org Subject: Please test fix for bad Vcc errors From: M. Warner Losh Reply-To: mobile@freebsd.org X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Oct__6_00:43:53_2004_716)--" Content-Transfer-Encoding: 7bit ----Next_Part(Wed_Oct__6_00:43:53_2004_716)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit If you have an older laptop that's getting bad Vcc errors, please test this patch. There's a number of laptops with resource issues. If you are using ACPI, this won't change anything (I have a separate patch for that). Warner ----Next_Part(Wed_Oct__6_00:43:53_2004_716)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="legacy.diff" Index: pci_bus.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/sys/i386/pci/pci_bus.c,v retrieving revision 1.112 diff -u -r1.112 pci_bus.c --- pci_bus.c 1 Jun 2004 19:51:29 -0000 1.112 +++ pci_bus.c 6 Oct 2004 06:35:12 -0000 @@ -45,6 +45,7 @@ #endif #include #include +#include #include "pcib_if.h" @@ -77,11 +78,11 @@ static const char * legacy_pcib_is_host_bridge(int bus, int slot, int func, - u_int32_t id, u_int8_t class, u_int8_t subclass, - u_int8_t *busnum) + uint32_t id, uint8_t class, uint8_t subclass, + uint8_t *busnum) { const char *s = NULL; - static u_int8_t pxb[4]; /* hack for 450nx */ + static uint8_t pxb[4]; /* hack for 450nx */ *busnum = 0; @@ -468,6 +469,24 @@ return ENOENT; } +static struct resource * +legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + /* + * If no memory preference is given, use upper 32MB slot most + * bioses use for their memory window. Typically other bridges + * before us get in the way to assert their preferences on memory. + * Hardcoding like this sucks, so a more MD/MI way needs to be + * found to do it. This is typically only used on older laptops + * that don't have pci busses behind pci bridge, so assuming > 32MB + * is liekly OK. + */ + if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) + start = 0xfe000000; + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, + count, flags)); +} static device_method_t legacy_pcib_methods[] = { /* Device interface */ @@ -482,7 +501,7 @@ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), ----Next_Part(Wed_Oct__6_00:43:53_2004_716)---- ----Next_Part(Wed_Oct__6_00:43:53_2004_540)----