Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109106
b: refs/heads/master
c: 91ede00
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Aug 23, 2008
1 parent 6c7db8c commit ba042bb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b4e27b52853c5da77e61a4e36fbc40688b7a829
refs/heads/master: 91ede005d72df60d6b3f252be177a4743a6aa46a
35 changes: 31 additions & 4 deletions trunk/arch/x86/pci/amd_bus.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/topology.h>
#include <linux/cpu.h>
#include "pci.h"

#ifdef CONFIG_X86_64
Expand Down Expand Up @@ -565,7 +566,7 @@ static int __init early_fill_mp_bus_info(void) { return 0; }

#define ENABLE_CF8_EXT_CFG (1ULL << 46)

static void enable_pci_io_ecs_per_cpu(void *unused)
static void enable_pci_io_ecs(void *unused)
{
u64 reg;
rdmsrl(MSR_AMD64_NB_CFG, reg);
Expand All @@ -575,13 +576,39 @@ static void enable_pci_io_ecs_per_cpu(void *unused)
}
}

static int __init enable_pci_io_ecs(void)
static int __cpuinit amd_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
int cpu = (long)hcpu;
switch(action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
smp_call_function_single(cpu, enable_pci_io_ecs, NULL, 0);
break;
default:
break;
}
return NOTIFY_OK;
}

static struct notifier_block __cpuinitdata amd_cpu_notifier = {
.notifier_call = amd_cpu_notify,
};

static int __init pci_io_ecs_init(void)
{
int cpu;

/* assume all cpus from fam10h have IO ECS */
if (boot_cpu_data.x86 < 0x10)
return 0;
on_each_cpu(enable_pci_io_ecs_per_cpu, NULL, 1);

register_cpu_notifier(&amd_cpu_notifier);
for_each_online_cpu(cpu)
amd_cpu_notify(&amd_cpu_notifier, (unsigned long)CPU_ONLINE,
(void *)(long)cpu);
pci_probe |= PCI_HAS_IO_ECS;

return 0;
}

Expand All @@ -591,7 +618,7 @@ static int __init amd_postcore_init(void)
return 0;

early_fill_mp_bus_info();
enable_pci_io_ecs();
pci_io_ecs_init();

return 0;
}
Expand Down

0 comments on commit ba042bb

Please sign in to comment.