Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 8, 2005
2 parents f44702f + a04ce0f commit 7bbedd5
Show file tree
Hide file tree
Showing 61 changed files with 1,299 additions and 12,082 deletions.
9 changes: 0 additions & 9 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ Who: Pavel Machek <pavel@suse.cz>

---------------------------

What: PCI Name Database (CONFIG_PCI_NAMES)
When: July 2005
Why: It bloats the kernel unnecessarily, and is handled by userspace better
(pciutils supports it.) Will eliminate the need to try to keep the
pci.ids file in sync with the sf.net database all of the time.
Who: Greg Kroah-Hartman <gregkh@suse.de>

---------------------------

What: io_remap_page_range() (macro or function)
When: September 2005
Why: Replaced by io_remap_pfn_range() which allows more memory space
Expand Down
7 changes: 0 additions & 7 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1813,13 +1813,6 @@ M: hch@infradead.org
L: linux-abi-devel@lists.sourceforge.net
S: Maintained

PCI ID DATABASE
P: Martin Mares
M: mj@ucw.cz
L: pciids-devel@lists.sourceforge.net
W: http://pciids.sourceforge.net/
S: Maintained

PCI SOUND DRIVERS (ES1370, ES1371 and SONICVIBES)
P: Thomas Sailer
M: sailer@ife.ee.ethz.ch
Expand Down
5 changes: 2 additions & 3 deletions arch/alpha/kernel/sys_marvel.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,11 @@ marvel_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
irq += 0x80; /* offset for lsi */

#if 1
printk("PCI:%d:%d:%d (hose %d) [%s] is using MSI\n",
printk("PCI:%d:%d:%d (hose %d) is using MSI\n",
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn),
hose->index,
pci_pretty_name (dev));
hose->index);
printk(" %d message(s) from 0x%04x\n",
1 << ((msg_ctl & PCI_MSI_FLAGS_QSIZE) >> 4),
msg_dat);
Expand Down
6 changes: 3 additions & 3 deletions arch/i386/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
/* Write-combine setting is ignored, it is changed via the mtrr
* interfaces on this platform.
*/
if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;

return 0;
Expand Down
1 change: 0 additions & 1 deletion arch/ppc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ fixup_broken_pcnet32(struct pci_dev* dev)
if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
dev->vendor = PCI_VENDOR_ID_AMD;
pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
pci_name_device(dev);
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
Expand Down
31 changes: 14 additions & 17 deletions arch/ppc64/kernel/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ static void pci_addr_cache_print(struct pci_io_addr_cache *cache)
while (n) {
struct pci_io_addr_range *piar;
piar = rb_entry(n, struct pci_io_addr_range, rb_node);
printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s %s\n",
printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s\n",
(piar->flags & IORESOURCE_IO) ? "i/o" : "mem", cnt,
piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev),
pci_pretty_name(piar->pcidev));
piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev));
cnt++;
n = rb_next(n);
}
Expand Down Expand Up @@ -260,17 +259,17 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)

dn = pci_device_to_OF_node(dev);
if (!dn) {
printk(KERN_WARNING "PCI: no pci dn found for dev=%s %s\n",
pci_name(dev), pci_pretty_name(dev));
printk(KERN_WARNING "PCI: no pci dn found for dev=%s\n",
pci_name(dev));
return;
}

/* Skip any devices for which EEH is not enabled. */
if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) ||
dn->eeh_mode & EEH_MODE_NOCHECK) {
#ifdef DEBUG
printk(KERN_INFO "PCI: skip building address cache for=%s %s\n",
pci_name(dev), pci_pretty_name(dev));
printk(KERN_INFO "PCI: skip building address cache for=%s\n",
pci_name(dev));
#endif
return;
}
Expand Down Expand Up @@ -447,12 +446,12 @@ static void eeh_panic(struct pci_dev *dev, int reset_state)
* in light of potential corruption, we can use it here.
*/
if (panic_on_oops)
panic("EEH: MMIO failure (%d) on device:%s %s\n", reset_state,
pci_name(dev), pci_pretty_name(dev));
panic("EEH: MMIO failure (%d) on device:%s\n", reset_state,
pci_name(dev));
else {
__get_cpu_var(ignored_failures)++;
printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s %s\n",
reset_state, pci_name(dev), pci_pretty_name(dev));
printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s\n",
reset_state, pci_name(dev));
}
}

Expand Down Expand Up @@ -482,8 +481,8 @@ static void eeh_event_handler(void *dummy)
break;

printk(KERN_INFO "EEH: MMIO failure (%d), notifiying device "
"%s %s\n", event->reset_state,
pci_name(event->dev), pci_pretty_name(event->dev));
"%s\n", event->reset_state,
pci_name(event->dev));

atomic_set(&eeh_fail_count, 0);
notifier_call_chain (&eeh_notifier_chain,
Expand Down Expand Up @@ -851,8 +850,7 @@ void eeh_add_device_late(struct pci_dev *dev)
return;

#ifdef DEBUG
printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev),
pci_pretty_name(dev));
printk(KERN_DEBUG "EEH: adding device %s\n", pci_name(dev));
#endif

pci_addr_cache_insert_device (dev);
Expand All @@ -873,8 +871,7 @@ void eeh_remove_device(struct pci_dev *dev)

/* Unregister the device with the EEH/PCI address search system */
#ifdef DEBUG
printk(KERN_DEBUG "EEH: remove device %s %s\n", pci_name(dev),
pci_pretty_name(dev));
printk(KERN_DEBUG "EEH: remove device %s\n", pci_name(dev));
#endif
pci_addr_cache_remove_device(dev);
}
Expand Down
5 changes: 1 addition & 4 deletions arch/ppc64/kernel/iSeries_VpdInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,5 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ",
count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor,
frame, card);
if (pci_class_name(PciDev->class >> 8) == 0)
printk("0x%04X\n", (int)(PciDev->class >> 8));
else
printk("%s\n", pci_class_name(PciDev->class >> 8));
printk("0x%04X\n", (int)(PciDev->class >> 8));
}
1 change: 0 additions & 1 deletion arch/ppc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static void fixup_broken_pcnet32(struct pci_dev* dev)
if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
dev->vendor = PCI_VENDOR_ID_AMD;
pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
pci_name_device(dev);
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
Expand Down
127 changes: 5 additions & 122 deletions arch/sparc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,134 +359,17 @@ void pcibios_fixup_bus(struct pci_bus *pbus)
pbus->resource[1] = &pbm->mem_space;
}

int pci_claim_resource(struct pci_dev *pdev, int resource)
struct resource *pcibios_select_root(struct pci_dev *pdev, struct resource *r)
{
struct pci_pbm_info *pbm = pdev->bus->sysdata;
struct resource *res = &pdev->resource[resource];
struct resource *root;

if (!pbm)
return -EINVAL;
struct resource *root = NULL;

if (res->flags & IORESOURCE_IO)
if (r->flags & IORESOURCE_IO)
root = &pbm->io_space;
else
if (r->flags & IORESOURCE_MEM)
root = &pbm->mem_space;

pbm->parent->resource_adjust(pdev, res, root);

return request_resource(root, res);
}

/*
* Given the PCI bus a device resides on, try to
* find an acceptable resource allocation for a
* specific device resource..
*/
static int pci_assign_bus_resource(const struct pci_bus *bus,
struct pci_dev *dev,
struct resource *res,
unsigned long size,
unsigned long min,
int resno)
{
unsigned int type_mask;
int i;

type_mask = IORESOURCE_IO | IORESOURCE_MEM;
for (i = 0 ; i < 4; i++) {
struct resource *r = bus->resource[i];
if (!r)
continue;

/* type_mask must match */
if ((res->flags ^ r->flags) & type_mask)
continue;

/* Ok, try it out.. */
if (allocate_resource(r, res, size, min, -1, size, NULL, NULL) < 0)
continue;

/* PCI config space updated by caller. */
return 0;
}
return -EBUSY;
}

int pci_assign_resource(struct pci_dev *pdev, int resource)
{
struct pcidev_cookie *pcp = pdev->sysdata;
struct pci_pbm_info *pbm = pcp->pbm;
struct resource *res = &pdev->resource[resource];
unsigned long min, size;
int err;

if (res->flags & IORESOURCE_IO)
min = pbm->io_space.start + 0x400UL;
else
min = pbm->mem_space.start;

size = res->end - res->start + 1;

err = pci_assign_bus_resource(pdev->bus, pdev, res, size, min, resource);

if (err < 0) {
printk("PCI: Failed to allocate resource %d for %s\n",
resource, pci_name(pdev));
} else {
/* Update PCI config space. */
pbm->parent->base_address_update(pdev, resource);
}

return err;
}

/* Sort resources by alignment */
void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
{
int i;

for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *r;
struct resource_list *list, *tmp;
unsigned long r_align;

r = &dev->resource[i];
r_align = r->end - r->start;

if (!(r->flags) || r->parent)
continue;
if (!r_align) {
printk(KERN_WARNING "PCI: Ignore bogus resource %d "
"[%lx:%lx] of %s\n",
i, r->start, r->end, pci_name(dev));
continue;
}
r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
for (list = head; ; list = list->next) {
unsigned long align = 0;
struct resource_list *ln = list->next;
int idx;

if (ln) {
idx = ln->res - &ln->dev->resource[0];
align = (idx < PCI_BRIDGE_RESOURCES) ?
ln->res->end - ln->res->start + 1 :
ln->res->start;
}
if (r_align > align) {
tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
if (!tmp)
panic("pdev_sort_resources(): "
"kmalloc() failed!\n");
tmp->next = ln;
tmp->res = r;
tmp->dev = dev;
list->next = tmp;
break;
}
}
}
return root;
}

void pcibios_update_irq(struct pci_dev *pdev, int irq)
Expand Down
Loading

0 comments on commit 7bbedd5

Please sign in to comment.