Messages in this thread | | | Date | Fri, 7 Jan 2011 10:59:20 +0100 | From | Robert Richter <> | Subject | Re: [PATCH] x86: use PCI method for enabling AMD extended config space before MSR method |
| |
On 07.01.11 02:40:00, Jan Beulich wrote: > >>> On 06.01.11 at 18:20, Robert Richter <robert.richter@amd.com> wrote: > > On 06.01.11 11:57:35, Jan Beulich wrote: > >> +#ifdef CONFIG_AMD_NB > >> + /* Try the PCI method first. */ > >> + if (early_pci_allowed()) { > >> + unsigned int i, n; > >> + > >> + for (n = i = 0; !n && amd_bus_dev_ranges[i].dev_limit; ++i) { > >> + u8 bus = amd_bus_dev_ranges[i].bus; > >> + u8 slot = amd_bus_dev_ranges[i].dev_base; > >> + u8 limit = amd_bus_dev_ranges[i].dev_limit; > >> + > >> + for (; slot < limit; ++slot) { > >> + u32 val = read_pci_config(bus, slot, 3, 0); > >> + > >> + if (!early_is_k8_nb(val)) > >> + continue; > >> + > >> + val = read_pci_config(bus, slot, 3, 0x8c); > >> + if (!(val & (ENABLE_CF8_EXT_CFG >> 32))) { > >> + val |= ENABLE_CF8_EXT_CFG >> 32; > >> + write_pci_config(bus, slot, 3, 0x8c, > >> + val); > >> + } > >> + ++n; > >> + } > >> + } > >> + pr_info("Extended Config Space enabled on %u nodes\n", n); > > > > Isn't i the number of nodes? > > No, "i" is the number of PCI devices looked at (but only those that > pass early_is_k8_nb() are of interest).
Right, your code is correct.
Thanks,
-Robert
-- Advanced Micro Devices, Inc. Operating System Research Center
| |