NetBSD Problem Report #41522

From db@db.net  Tue Jun  2 00:30:23 2009
Return-Path: <db@db.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id E057D63C282
	for <gnats-bugs@gnats.netbsd.org>; Tue,  2 Jun 2009 00:30:22 +0000 (UTC)
Message-Id: <20090601191005.45A772F718@moonlet.dbn>
Date: Mon,  1 Jun 2009 15:10:05 -0400 (EDT)
From: db@db.net
Reply-To: db@db.net
To: gnats-bugs@gnats.NetBSD.org
Subject: pci devices left turned off
X-Send-Pr-Version: 3.95

>Number:         41522
>Category:       port-i386
>Synopsis:       pci devices left turned off
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 02 00:35:00 +0000 2009
>Last-Modified:  Wed Jul 01 06:10:06 +0000 2009
>Originator:     db@db.net
>Release:        NetBSD 5.0
>Organization:
Not very.

>Environment:


System: NetBSD moonlet 5.0 NetBSD 5.0 (GENERIC) #0: Sun May 31 18:59:58 EDT 2009 db@moonlet:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Hewlett-Packard HP Vectra (VLi8) has a "lazy" bios, and leaves
io/mem turned off on the pci bus. Thus no pci device attaches.
>How-To-Repeat:
Try to boot off of a machine with a "lazy" bios.
>Fix:

This should be optional depending perhaps on boothowto or perhaps
on quirks.
This may not be the best place for the devices to be turned on
if quirks are used. However, this diff works for me for now.

--- dev/pci/pci.c.orig	2008-11-19 21:40:59.000000000 -0500
+++ dev/pci/pci.c	2009-05-24 10:16:01.000000000 -0400
@@ -317,10 +317,14 @@
 	 * as appropriate.
 	 */
 	pa.pa_flags = sc->sc_flags;
-	if ((csr & PCI_COMMAND_IO_ENABLE) == 0)
-		pa.pa_flags &= ~PCI_FLAGS_IO_ENABLED;
-	if ((csr & PCI_COMMAND_MEM_ENABLE) == 0)
-		pa.pa_flags &= ~PCI_FLAGS_MEM_ENABLED;
+	if ((csr & PCI_COMMAND_IO_ENABLE) == 0) {
+		csr |= PCI_COMMAND_IO_ENABLE;
+		pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+	}
+	if ((csr & PCI_COMMAND_MEM_ENABLE) == 0) {
+		csr |= PCI_COMMAND_MEM_ENABLE;
+		pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+	}

 	/*
 	 * If the cache line size is not configured, then



- Diane

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-i386/41522: pci devices left turned off
Date: Wed, 1 Jul 2009 06:07:32 +0000

 On Tue, Jun 02, 2009 at 12:35:00AM +0000, db@db.net wrote:
  > Hewlett-Packard HP Vectra (VLi8) has a "lazy" bios, and leaves
  > io/mem turned off on the pci bus. Thus no pci device attaches.

 Isn't this what options PCI_ADDR_FIXUP is for?

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.