Merge branch 'pci/mike-x86-tra' into next
* pci/mike-x86-tra: x86/PCI: Allow x86 platforms to use translation offsets
This commit is contained in:
commit
0dcccc5c53
@ -12,6 +12,7 @@ struct pci_root_info {
|
|||||||
char name[16];
|
char name[16];
|
||||||
unsigned int res_num;
|
unsigned int res_num;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
resource_size_t *res_offset;
|
||||||
struct pci_sysdata sd;
|
struct pci_sysdata sd;
|
||||||
#ifdef CONFIG_PCI_MMCONFIG
|
#ifdef CONFIG_PCI_MMCONFIG
|
||||||
bool mcfg_added;
|
bool mcfg_added;
|
||||||
@ -323,6 +324,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
|
|||||||
res->flags = flags;
|
res->flags = flags;
|
||||||
res->start = start;
|
res->start = start;
|
||||||
res->end = end;
|
res->end = end;
|
||||||
|
info->res_offset[info->res_num] = addr.translation_offset;
|
||||||
|
|
||||||
if (!pci_use_crs) {
|
if (!pci_use_crs) {
|
||||||
dev_printk(KERN_DEBUG, &info->bridge->dev,
|
dev_printk(KERN_DEBUG, &info->bridge->dev,
|
||||||
@ -392,7 +394,8 @@ static void add_resources(struct pci_root_info *info,
|
|||||||
"ignoring host bridge window %pR (conflicts with %s %pR)\n",
|
"ignoring host bridge window %pR (conflicts with %s %pR)\n",
|
||||||
res, conflict->name, conflict);
|
res, conflict->name, conflict);
|
||||||
else
|
else
|
||||||
pci_add_resource(resources, res);
|
pci_add_resource_offset(resources, res,
|
||||||
|
info->res_offset[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,6 +403,8 @@ static void free_pci_root_info_res(struct pci_root_info *info)
|
|||||||
{
|
{
|
||||||
kfree(info->res);
|
kfree(info->res);
|
||||||
info->res = NULL;
|
info->res = NULL;
|
||||||
|
kfree(info->res_offset);
|
||||||
|
info->res_offset = NULL;
|
||||||
info->res_num = 0;
|
info->res_num = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,10 +455,20 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
size = sizeof(*info->res) * info->res_num;
|
size = sizeof(*info->res) * info->res_num;
|
||||||
info->res_num = 0;
|
|
||||||
info->res = kzalloc(size, GFP_KERNEL);
|
info->res = kzalloc(size, GFP_KERNEL);
|
||||||
if (!info->res)
|
if (!info->res) {
|
||||||
|
info->res_num = 0;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
size = sizeof(*info->res_offset) * info->res_num;
|
||||||
|
info->res_num = 0;
|
||||||
|
info->res_offset = kzalloc(size, GFP_KERNEL);
|
||||||
|
if (!info->res_offset) {
|
||||||
|
kfree(info->res);
|
||||||
|
info->res = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
|
acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
|
||||||
info);
|
info);
|
||||||
|
Loading…
Reference in New Issue
Block a user