lkml.org 
[lkml]   [2012]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] arch/tile: tilegx PCI root complex support
Date
On Tuesday 10 April 2012, Bjorn Helgaas wrote:
> > + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
> > + /*
> > + * For bridges, we enable both memory and I/O decoding
> > + * in call cases.
> > + */
> > + cmd |= PCI_COMMAND_IO;
> > + cmd |= PCI_COMMAND_MEMORY;
> > + } else {
> > + /*
> > + * For endpoints, we enable memory and/or I/O decoding
> > + * only if they have a memory resource of that type.
> > + */
> > + for (i = 0; i < 6; i++) {
> > + r = &dev->resource[i];
> > + if (r->flags & IORESOURCE_UNSET) {
> > + pr_err("PCI: Device %s not available "
> > + "because of resource collisions\n",
> > + pci_name(dev));
> > + return -EINVAL;
> > + }
> > + if (r->flags & IORESOURCE_IO)
> > + cmd |= PCI_COMMAND_IO;
> > + if (r->flags & IORESOURCE_MEM)
> > + cmd |= PCI_COMMAND_MEMORY;
> > + }
>
> It would be nice if you could use pci_enable_resources() here, though
> you use IORESOURCE_UNSET here, while pci_enable_resources() does not.
> But you could at least use PCI_NUM_RESOURCES and "mask." There's
> nothing fundamentally architecture-dependent here, so I'd like to move
> toward a generic implementation.

Note that if tile does not support I/O space as indicated, it should
never enable PCI_COMMAND_IO.

Arnd



\
 
 \ /
  Last update: 2012-04-10 12:45    [from the cache]
©2003-2011 Jasper Spaans