Re: PROBLEM: memory corruption with i815 chipset variant

Alan Cox (alan@lxorguk.ukuu.org.uk)
27 May 2002 11:17:00 +0100


On Mon, 2002-05-27 at 09:56, Nicolas Aspert wrote:
> OK, I have a patch almost ready to do that except, I am not sure about
> what to do for those 3 bits...
>
> The *usual* call is :
> pci_write_config_dword(agp_bridge.dev, INTEL_ATTBASE,
> agp_bridge.gatt_bus_addr);
>
> Where 'gatt_bus_addr' is returned from a 'virt_to_phys' on
> 'gatt_table_real'.
>
> Should I mask those three bits out when writing or write
> 'gatt_bus_addr >> 3' instead ? I am not too sure about the assumptions
> that can be made about what returns 'virt_to_phys' ...

virt_to_phys returns you the CPU physical (after the MMU) address of the
memory in question. You'd want to check the documentation but assuming
the base is still written as an address in bytes then you'd want to do
something like

if(agp_bridge.gatt_bus_addr & ~0x1FFFFFFF)
panic("gatt bus addr too high");
pci_read_config_dword(agp_bridge.dev, INTEL_ATTBASE, &addr);
addr&=~0x1FFFFFFF;
addr|=agp_bridge.gatt_bus_addr;
pci_write_config_dword(agp_bridge.dev, INTEL_ATTBASE, &addr);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/