Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343263
b: refs/heads/master
c: b891b4d
h: refs/heads/master
i:
  343261: b0f801b
  343259: 414ef63
  343255: 5420042
  343247: 9a4660b
  343231: c3d7be8
v: v3
  • Loading branch information
Jingoo Han authored and Bjorn Helgaas committed Nov 9, 2012
1 parent 200b404 commit 116e950
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 443 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: f9c15b429a5c82e613d59a32d4f49cea6e9d64eb
refs/heads/master: b891b4dc1eed33543c5818dae43ce8bb55f2080c
21 changes: 3 additions & 18 deletions trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ struct pci_root_info {
char name[16];
unsigned int res_num;
struct resource *res;
resource_size_t *res_offset;
struct pci_sysdata sd;
#ifdef CONFIG_PCI_MMCONFIG
bool mcfg_added;
Expand Down Expand Up @@ -324,7 +323,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
res->flags = flags;
res->start = start;
res->end = end;
info->res_offset[info->res_num] = addr.translation_offset;

if (!pci_use_crs) {
dev_printk(KERN_DEBUG, &info->bridge->dev,
Expand Down Expand Up @@ -394,17 +392,14 @@ static void add_resources(struct pci_root_info *info,
"ignoring host bridge window %pR (conflicts with %s %pR)\n",
res, conflict->name, conflict);
else
pci_add_resource_offset(resources, res,
info->res_offset[i]);
pci_add_resource(resources, res);
}
}

static void free_pci_root_info_res(struct pci_root_info *info)
{
kfree(info->res);
info->res = NULL;
kfree(info->res_offset);
info->res_offset = NULL;
info->res_num = 0;
}

Expand Down Expand Up @@ -455,20 +450,10 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
return;

size = sizeof(*info->res) * info->res_num;
info->res = kzalloc(size, GFP_KERNEL);
if (!info->res) {
info->res_num = 0;
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;
info->res = kzalloc(size, GFP_KERNEL);
if (!info->res)
return;
}

acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
info);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void pcibios_disable_device (struct pci_dev *dev)
pcibios_disable_irq(dev);
}

int pci_ext_cfg_avail(void)
int pci_ext_cfg_avail(struct pci_dev *dev)
{
if (raw_pci_ext_ops)
return 1;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/acpi/pci_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int acpi_pci_unbind(struct acpi_device *device)
if (!dev->subordinate)
goto out;

acpi_pci_irq_del_prt(pci_domain_nr(dev->bus), dev->subordinate->number);
acpi_pci_irq_del_prt(dev->subordinate);

device->ops.bind = NULL;
device->ops.unbind = NULL;
Expand All @@ -63,7 +63,7 @@ static int acpi_pci_bind(struct acpi_device *device)
{
acpi_status status;
acpi_handle handle;
unsigned char bus;
struct pci_bus *bus;
struct pci_dev *dev;

dev = acpi_get_pci_dev(device->handle);
Expand Down Expand Up @@ -100,11 +100,11 @@ static int acpi_pci_bind(struct acpi_device *device)
goto out;

if (dev->subordinate)
bus = dev->subordinate->number;
bus = dev->subordinate;
else
bus = dev->bus->number;
bus = dev->bus;

acpi_pci_irq_add_prt(device->handle, pci_domain_nr(dev->bus), bus);
acpi_pci_irq_add_prt(device->handle, bus);

out:
pci_dev_put(dev);
Expand Down
17 changes: 9 additions & 8 deletions trunk/drivers/acpi/pci_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
}
}

static int acpi_pci_irq_add_entry(acpi_handle handle, int segment, int bus,
static int acpi_pci_irq_add_entry(acpi_handle handle, struct pci_bus *bus,
struct acpi_pci_routing_table *prt)
{
struct acpi_prt_entry *entry;
Expand All @@ -198,8 +198,8 @@ static int acpi_pci_irq_add_entry(acpi_handle handle, int segment, int bus,
* 1=INTA, 2=INTB. We use the PCI encoding throughout, so convert
* it here.
*/
entry->id.segment = segment;
entry->id.bus = bus;
entry->id.segment = pci_domain_nr(bus);
entry->id.bus = bus->number;
entry->id.device = (prt->address >> 16) & 0xFFFF;
entry->pin = prt->pin + 1;

Expand Down Expand Up @@ -244,7 +244,7 @@ static int acpi_pci_irq_add_entry(acpi_handle handle, int segment, int bus,
return 0;
}

int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus)
{
acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
Expand Down Expand Up @@ -273,7 +273,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)

entry = buffer.pointer;
while (entry && (entry->length > 0)) {
acpi_pci_irq_add_entry(handle, segment, bus, entry);
acpi_pci_irq_add_entry(handle, bus, entry);
entry = (struct acpi_pci_routing_table *)
((unsigned long)entry + entry->length);
}
Expand All @@ -282,16 +282,17 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
return 0;
}

void acpi_pci_irq_del_prt(int segment, int bus)
void acpi_pci_irq_del_prt(struct pci_bus *bus)
{
struct acpi_prt_entry *entry, *tmp;

printk(KERN_DEBUG
"ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n",
segment, bus);
pci_domain_nr(bus), bus->number);
spin_lock(&acpi_prt_lock);
list_for_each_entry_safe(entry, tmp, &acpi_prt_list, list) {
if (segment == entry->id.segment && bus == entry->id.bus) {
if (pci_domain_nr(bus) == entry->id.segment
&& bus->number == entry->id.bus) {
list_del(&entry->list);
kfree(entry);
}
Expand Down
Loading

0 comments on commit 116e950

Please sign in to comment.