Re: is it possible to force PCI resource allocation ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 22 January 2009 10:58:18 am Jean Schurger wrote:
>   I have a video card with a small iommu (in an intel poulsbo) who needs
> to have an PCI resource address aligned to 256M.
> 
> 00:02.0 VGA compatible controller: Intel Corporation System Controller
> Hub (SCH Poulsbo) Graphics Controller (rev 07) (prog-if 00 [VGA
> controller])
> 
> ...
> 	Region 0: Memory at fdf00000 (32-bit, non-prefetchable) [size=512K]
> 	Region 1: I/O ports at ff00 [size=8]
> 	Region 2: Memory at d8000000 (32-bit, non-prefetchable) [size=128M]
> 	Region 3: Memory at fdfc0000 (32-bit, non-prefetchable) [size=128K]	
> ...
> 
> The driver get the address by 
> pg->gatt_start = pci_resource_start(dev->pdev, PSB_GATT_RESOURCE); with
> PSB_GATT_RESOURCE=2

Hi Jean,

The BAR is only 128M in size.  I don't know of a way for a PCI device
to specify that a BAR needs to be aligned on anything larger than its
size.  Are you *sure* it has to be 256M-aligned?

Maybe the card comes in 128M and 256M versions, and the driver
incorrectly assumes all cards are 256M?

> and test it here :
> 
> if (pg->gatt_start & 0x0FFFFFFF) {
>                 DRM_ERROR("Gatt must be 256M aligned. This is a
> bug.\n");
>                 ret = -EINVAL;
>                 goto out_err;
> }
> 
> The only 'place' where the resource can be aligned to 256M is at
> 0xe0000000 who is reserved by 'pnp'
> 
> How can i 'move' this region to 0xe000000 ?

If the region at 0xe0000000 is really in use by some PNP device,
it would be a bad idea to move the VGA device there, too.  PCI
drivers normally just use the resources allocated by the BIOS or
the PCI core.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux