From: Ingo Molnar <mingo@elte.hu>
To: Jan Beulich <JBeulich@novell.com>
Cc: tglx@linutronix.de, hpa@zytor.com,
Andreas Herrmann3 <Andreas.Herrmann3@amd.com>,
Joerg Roedel <joerg.roedel@amd.com>,
Robert Richter <robert.richter@amd.com>,
Jeremy Fitzhardinge <jeremy@goop.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH, tip] x86: use PCI method for enabling AMD extended config space before MSR method
Date: Fri, 7 Jan 2011 18:02:59 +0100 [thread overview]
Message-ID: <20110107170259.GA9552@elte.hu> (raw)
In-Reply-To: <4D274F58020000780002B11D@vpn.id2.novell.com>
* Jan Beulich <JBeulich@novell.com> wrote:
> --- tip/arch/x86/pci/amd_bus.c
> +++ tip-x86-amd-ecs/arch/x86/pci/amd_bus.c
> @@ -4,6 +4,7 @@
> #include <linux/cpu.h>
> #include <linux/range.h>
>
> +#include <asm/amd_nb.h>
> #include <asm/pci_x86.h>
>
> #include <asm/pci-direct.h>
> @@ -386,6 +387,35 @@ static int __init pci_io_ecs_init(void)
> if (boot_cpu_data.x86 < 0x10)
> return 0;
>
> +#ifdef CONFIG_AMD_NB
> + /* Try the PCI method first. */
> + if (early_pci_allowed()) {
> + unsigned int i, n;
> +
> + for (n = i = 0; !n && amd_nb_bus_dev_ranges[i].dev_limit; ++i) {
> + u8 bus = amd_nb_bus_dev_ranges[i].bus;
> + u8 slot = amd_nb_bus_dev_ranges[i].dev_base;
> + u8 limit = amd_nb_bus_dev_ranges[i].dev_limit;
> +
> + for (; slot < limit; ++slot) {
> + u32 val = read_pci_config(bus, slot, 3, 0);
> +
> + if (!early_is_amd_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);
> + }
> +#endif
Please, instead of plopping such a big #ifdef-ed block of code into an existing
function create a new helper function instead. That will make it less ugly and more
readable.
Thanks,
Ingo
prev parent reply other threads:[~2011-01-07 17:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 16:37 [PATCH, tip] x86: use PCI method for enabling AMD extended config space before MSR method Jan Beulich
2011-01-07 17:02 ` Ingo Molnar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110107170259.GA9552@elte.hu \
--to=mingo@elte.hu \
--cc=Andreas.Herrmann3@amd.com \
--cc=JBeulich@novell.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=joerg.roedel@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.richter@amd.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.