Subject: Re: ioapic, PCI_BUS_FIXUP and power
To: None <current-users@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: current-users
Date: 05/29/2007 15:44:33
--0ntfKIWw70PvrIHh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, May 29, 2007 at 10:59:21PM +1200, Mark Davies wrote:
> Still trying to get my laptop sorted with current. I mentioned a few 
> weeks ago about "halt -p" not completing having upgraded to current 
> and got ioapic sorted.  Having played some more I now see the 
> following is the case:
> 
> With ioapic enabled in the kernel, bge fails with watchdog timeout 
> errors etc unless I define PCI_BUS_FIXUP.  However defining 
> PCI_BUS_FIXUP is what causes "halt -p" not to complete and 
> furthermore it causes the machine to hang if I unplug the ac adapter 
> (to switch to battery).  So is there something in PCI_BUS_FIXUP thats 
> not handling power management properly?

Perhaps the information that this script (attached) prints before and
after PCI_BUS_FIXUP may expose the critical difference.

Dave
 
-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933 ext 24

--0ntfKIWw70PvrIHh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=pcidump

#!/bin/sh

del_leading_zeroes()
{
	x=$1
	while true; do
		ox=$x
		x=${ox##0}
		if [ -z $x ]; then
			x=0
			break
		elif [ $x = $ox ]; then
			break
		fi
	done
	echo $x
}

for i in $(seq 0 7); do
	pcictl pci$i list | {
		IFS=:
		while read bus dev fn rest; do 
			echo -- bus=$bus dev=$dev fn=$fn --
			dev=$(del_leading_zeroes $dev)
			bus=$(del_leading_zeroes $bus)
			fn=$(del_leading_zeroes $fn)
			pcictl pci$i dump -b $bus -d $dev -f $fn
		done
	}
done 2> /dev/null

--0ntfKIWw70PvrIHh--