On Wednesday 25 February 2009 10:56:56 am Jean Schurger wrote: > On Thu, 2009-01-22 at 12:49 -0700, Bjorn Helgaas wrote: > > 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? > > I cannot be less or more sure that the source of the driver as > unfortunatly, i don't have the Poulsbo specs. I don't have the specs either. In the absence of better information, I would assume the driver is just broken, and the BAR needs to be aligned only on its size. > > 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. > > Oh, i was wrong about 0xe0000000, 0xd0000000 seems to be the right > place, and is used with some others intel chipset (at least on two > different PCs), is there a way to 'force' the driver (and the card ?) to > use this address ? The card may be at different addresses on different machines. That's completely normal. I don't know of a way to force the kernel to move the card. I would just remove the alignment check in the driver. A major goal of PCI was to allow generic code to discover devices and program their resources, without device-specific constraints like this. A device that requires alignment on a size larger than the BAR would break all that, so I think it would be a pretty serious hardware defect. I think it's much more likely that the check in the driver is just some misguided bringup debug code or something. 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