Subject: Re: Changing the BAR of a PCI device at driver load time
To: Vincent <10.50@free.fr>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 09/05/2003 21:43:45
On Thu, Sep 04, 2003 at 09:59:48AM +0200, Vincent wrote:
> 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.

My guess - but I may be wrong - is that the page fault is caused by a PCI
error.
I think you shouldn't spend too much time trying to work around this in
software, but instead get the hardware vendor to fix the BIOS

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--