[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201204100915.49742.arnd@arndb.de>
Date: Tue, 10 Apr 2012 09:15:49 +0000
From: Arnd Bergmann <arnd@...db.de>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Chris Metcalf <cmetcalf@...era.com>, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, Jesse Barnes <jbarnes@...tuousgeek.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Myron Stowe <myron.stowe@...hat.com>,
Jiri Kosina <jkosina@...e.cz>, Joe Perches <joe@...ches.com>,
David Howells <dhowells@...hat.com>
Subject: Re: [PATCH 3/3] arch/tile: tilegx PCI root complex support
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists