Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94807
b: refs/heads/master
c: 0b64ad7
h: refs/heads/master
i:
  94805: 01223a8
  94803: f9cfbad
  94799: 5863069
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Apr 26, 2008
1 parent b071625 commit c7485ee
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 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: 7752d5cfe3d11ca0bb9c673ec38bd78ba6578f8e
refs/heads/master: 0b64ad7123eb013c3de26750f2d4c356cd566231
1 change: 1 addition & 0 deletions trunk/arch/x86/pci/mmconfig-shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ static void __init pci_mmcfg_reject_broken(void)

reject:
printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
pci_mmcfg_arch_free();
kfree(pci_mmcfg_config);
pci_mmcfg_config = NULL;
pci_mmcfg_config_num = 0;
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86/pci/mmconfig_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ int __init pci_mmcfg_arch_init(void)
raw_pci_ext_ops = &pci_mmcfg;
return 1;
}

void __init pci_mmcfg_arch_free(void)
{
}
22 changes: 21 additions & 1 deletion trunk/arch/x86/pci/mmconfig_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
int __init pci_mmcfg_arch_init(void)
{
int i;
pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) *
pci_mmcfg_virt = kzalloc(sizeof(*pci_mmcfg_virt) *
pci_mmcfg_config_num, GFP_KERNEL);
if (pci_mmcfg_virt == NULL) {
printk(KERN_ERR "PCI: Can not allocate memory for mmconfig structures\n");
Expand All @@ -141,9 +141,29 @@ int __init pci_mmcfg_arch_init(void)
printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
"segment %d\n",
pci_mmcfg_config[i].pci_segment);
pci_mmcfg_arch_free();
return 0;
}
}
raw_pci_ext_ops = &pci_mmcfg;
return 1;
}

void __init pci_mmcfg_arch_free(void)
{
int i;

if (pci_mmcfg_virt == NULL)
return;

for (i = 0; i < pci_mmcfg_config_num; ++i) {
if (pci_mmcfg_virt[i].virt) {
iounmap(pci_mmcfg_virt[i].virt);
pci_mmcfg_virt[i].virt = NULL;
pci_mmcfg_virt[i].cfg = NULL;
}
}

kfree(pci_mmcfg_virt);
pci_mmcfg_virt = NULL;
}
1 change: 1 addition & 0 deletions trunk/arch/x86/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ extern void pci_pcbios_init(void);
/* pci-mmconfig.c */

extern int __init pci_mmcfg_arch_init(void);
extern void __init pci_mmcfg_arch_free(void);

/*
* AMD Fam10h CPUs are buggy, and cannot access MMIO config space
Expand Down

0 comments on commit c7485ee

Please sign in to comment.