Re: [PATCH] PCI: Exclude VTBAR range from Local MMIOL if necessary

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

 



On Thursday 14 January 2010 12:16:32 am Yinghai Lu wrote:
> Index: linux-2.6/arch/x86/pci/intel_bus.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/pci/intel_bus.c
> +++ linux-2.6/arch/x86/pci/intel_bus.c
> @@ -41,6 +41,9 @@ static inline void print_ioh_resources(s
>  #define IOH_LMMIOH_LIMITU	0x118
>  #define IOH_LCFGBUS		0x11c
>  
> +#define IOH_VTBAR		0x180
> +#define IOH_VTSIZE		0x2000	/* Fixed HW size (not programmable) */
> +
>  static void __devinit pci_root_bus_res(struct pci_dev *dev)
>  {
>  	u16 word;
> @@ -52,7 +55,7 @@ static void __devinit pci_root_bus_res(s
>  	int bus_base, bus_end;
>  
>  	/* some sys doesn't get mmconf enabled */
> -	if (dev->cfg_size < 0x120)
> +	if (dev->cfg_size < 0x200)
>  		return;

I think the idea is that the config registers we're about to read:
  IOH_LCFGBUS at 0x11c
  IOH_LIO     at 0x108
  IOH_LMMIOL  at 0x10c
and now
  IOH_VTBAR   at 0x180
are in extended config space, so the legacy PCI config accessors
might not be able to read them.

But I think this is an ugly way to check.  Can't we just check whether
pci_read_config_dword() returns failure?

This actually raises an interesting point: if we ever reassign any PCI
resources, it is essential that we have correct information about these
host bridge windows.  If we have to bail out early because we can't
access extended config space, e.g., maybe MMCONFIG is disabled for some
reason, our idea of the windows will be wrong.

This is a case where we'd be better off paying attention to the _CRS
information from ACPI.

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