diff options
-rw-r--r-- | arch/x86/kernel/quirks.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index e95022e4f5d5..94ad0c029f02 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c | |||
@@ -493,5 +493,42 @@ void force_hpet_resume(void) | |||
493 | break; | 493 | break; |
494 | } | 494 | } |
495 | } | 495 | } |
496 | #endif | ||
497 | |||
498 | #if defined(CONFIG_PCI) && defined(CONFIG_NUMA) | ||
499 | /* Set correct numa_node information for AMD NB functions */ | ||
500 | static void __init quirk_amd_nb_node(struct pci_dev *dev) | ||
501 | { | ||
502 | struct pci_dev *nb_ht; | ||
503 | unsigned int devfn; | ||
504 | u32 val; | ||
505 | |||
506 | devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 0); | ||
507 | nb_ht = pci_get_slot(dev->bus, devfn); | ||
508 | if (!nb_ht) | ||
509 | return; | ||
510 | |||
511 | pci_read_config_dword(nb_ht, 0x60, &val); | ||
512 | set_dev_node(&dev->dev, val & 7); | ||
513 | pci_dev_put(dev); | ||
514 | } | ||
496 | 515 | ||
516 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB, | ||
517 | quirk_amd_nb_node); | ||
518 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP, | ||
519 | quirk_amd_nb_node); | ||
520 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MEMCTL, | ||
521 | quirk_amd_nb_node); | ||
522 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC, | ||
523 | quirk_amd_nb_node); | ||
524 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_HT, | ||
525 | quirk_amd_nb_node); | ||
526 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MAP, | ||
527 | quirk_amd_nb_node); | ||
528 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_DRAM, | ||
529 | quirk_amd_nb_node); | ||
530 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC, | ||
531 | quirk_amd_nb_node); | ||
532 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, | ||
533 | quirk_amd_nb_node); | ||
497 | #endif | 534 | #endif |