Re: [PATCH resend 2/2] PCI: don't allocate resource above 4G for 32-bit BAR

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

 



On Wednesday, February 18, 2009 8:34 am Ivan Kokshaysky wrote:
> On Wed, Feb 18, 2009 at 01:56:44AM +0800, Yu Zhao wrote:
> > +	max = pci_resource_limit(dev, resno);
> > +
> >  	/* First, try exact prefetching match.. */
> > -	ret = pci_bus_alloc_resource(bus, res, size, align, min,
> > +	ret = pci_bus_alloc_resource(bus, res, size, align, min, max,
> >  				     IORESOURCE_PREFETCH,
> >  				     pcibios_align_resource, dev);
>
> This breaks resource allocation on alpha and probably other
> arches with multiple pci domains. You cannot assume that resource
> start is equal to the bus address of the respective BAR.
> Even 32-bit BARs can have a resource->start well above 4G.

I wonder if it's worth adding better checks for bus vs CPU space mixups, maybe 
with a sparse annotation or a new typedef...

-- 
Jesse Barnes, Intel Open Source Technology Center
--
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