diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_ctrl.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 10a5a7674a8a..771ed34b1819 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -2630,29 +2630,15 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func | |||
2630 | hold_mem_node = NULL; | 2630 | hold_mem_node = NULL; |
2631 | } | 2631 | } |
2632 | 2632 | ||
2633 | /* If we have prefetchable memory resources copy them and | 2633 | memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource)); |
2634 | * fill in the bridge's memory range registers. Otherwise, | 2634 | p_mem_node->next = NULL; |
2635 | * fill in the range registers with values that disable them. */ | ||
2636 | if (p_mem_node) { | ||
2637 | memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource)); | ||
2638 | p_mem_node->next = NULL; | ||
2639 | |||
2640 | /* set Pre Mem base and Limit registers */ | ||
2641 | temp_word = p_mem_node->base >> 16; | ||
2642 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); | ||
2643 | |||
2644 | temp_word = (p_mem_node->base + p_mem_node->length - 1) >> 16; | ||
2645 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); | ||
2646 | } else { | ||
2647 | temp_word = 0xFFFF; | ||
2648 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); | ||
2649 | 2635 | ||
2650 | temp_word = 0x0000; | 2636 | /* set Pre Mem base and Limit registers */ |
2651 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); | 2637 | temp_word = p_mem_node->base >> 16; |
2638 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); | ||
2652 | 2639 | ||
2653 | kfree(hold_p_mem_node); | 2640 | temp_word = (p_mem_node->base + p_mem_node->length - 1) >> 16; |
2654 | hold_p_mem_node = NULL; | 2641 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); |
2655 | } | ||
2656 | 2642 | ||
2657 | /* Adjust this to compensate for extra adjustment in first loop */ | 2643 | /* Adjust this to compensate for extra adjustment in first loop */ |
2658 | irqs.barber_pole--; | 2644 | irqs.barber_pole--; |