Subject: Changing the BAR of a PCI device at driver load time
To: None <current-users@netbsd.org>
From: Vincent <10.50@free.fr>
List: current-users
Date: 09/04/2003 09:59:48
Hi,

since I have updated the Bios on my Compaq Presario laptop, the EHCI
driver has quit to work. The registers won't read anything else than FF
in MEM space, while the conf space accesses works fine.

I tinkered around in the ehci_pci.c code, and found nothing. At last, I
suspected a BIOS bug in the programming of the PCI bridge. To check it
out, in the driver, I reprogrammed the BAR to close up to another chip
which works, and, indeed, I could read normally at least one of the
registers whose access was impossible before.

Yet, if I could read the capability register, a write access
generated a page fault, and I was thrown into ddb with a uvm_page_fault
(even after a pci_mapreg_map with the updated BAR value).

So, my question is : what to do to write a workaround ?

Is that page fault due to software - does the kernel snapshot the PCI
config right on init time and sets accordingly the PMMU config, or is
that page fault due to the wrong programming of the PCI bridge ? PCIbios
won't fix that up, since the initial BAR address does not conflict with
anything else.

Thanks !
Vincent