mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
PCI: Tidy resource assignment messages
Print messages about failures in pci_assign_resource(). We can drop the "by-hand" message from _pci_assign_resource() because %pR now prints the size rather than the address if the resource hasn't been assigned. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
9477883595
commit
64da465e98
1 changed files with 9 additions and 20 deletions
|
@ -248,10 +248,8 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
|
||||||
static int _pci_assign_resource(struct pci_dev *dev, int resno,
|
static int _pci_assign_resource(struct pci_dev *dev, int resno,
|
||||||
resource_size_t size, resource_size_t min_align)
|
resource_size_t size, resource_size_t min_align)
|
||||||
{
|
{
|
||||||
struct resource *res = dev->resource + resno;
|
|
||||||
struct pci_bus *bus;
|
struct pci_bus *bus;
|
||||||
int ret;
|
int ret;
|
||||||
char *type;
|
|
||||||
|
|
||||||
bus = dev->bus;
|
bus = dev->bus;
|
||||||
while ((ret = __pci_assign_resource(bus, dev, resno, size, min_align))) {
|
while ((ret = __pci_assign_resource(bus, dev, resno, size, min_align))) {
|
||||||
|
@ -260,21 +258,6 @@ static int _pci_assign_resource(struct pci_dev *dev, int resno,
|
||||||
bus = bus->parent;
|
bus = bus->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
|
||||||
if (res->flags & IORESOURCE_MEM)
|
|
||||||
if (res->flags & IORESOURCE_PREFETCH)
|
|
||||||
type = "mem pref";
|
|
||||||
else
|
|
||||||
type = "mem";
|
|
||||||
else if (res->flags & IORESOURCE_IO)
|
|
||||||
type = "io";
|
|
||||||
else
|
|
||||||
type = "unknown";
|
|
||||||
dev_info(&dev->dev,
|
|
||||||
"BAR %d: can't assign %s (size %#llx)\n",
|
|
||||||
resno, type, (unsigned long long) resource_size(res));
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,11 +283,16 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
|
||||||
* where firmware left it. That at least has a chance of
|
* where firmware left it. That at least has a chance of
|
||||||
* working, which is better than just leaving it disabled.
|
* working, which is better than just leaving it disabled.
|
||||||
*/
|
*/
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res);
|
||||||
ret = pci_revert_fw_address(res, dev, resno, size);
|
ret = pci_revert_fw_address(res, dev, resno, size);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
dev_info(&dev->dev, "BAR %d: failed to assign %pR\n", resno,
|
||||||
|
res);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
res->flags &= ~IORESOURCE_UNSET;
|
res->flags &= ~IORESOURCE_UNSET;
|
||||||
res->flags &= ~IORESOURCE_STARTALIGN;
|
res->flags &= ~IORESOURCE_STARTALIGN;
|
||||||
|
@ -344,7 +332,8 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
|
||||||
|
|
||||||
res->flags &= ~IORESOURCE_UNSET;
|
res->flags &= ~IORESOURCE_UNSET;
|
||||||
res->flags &= ~IORESOURCE_STARTALIGN;
|
res->flags &= ~IORESOURCE_STARTALIGN;
|
||||||
dev_info(&dev->dev, "BAR %d: reassigned %pR\n", resno, res);
|
dev_info(&dev->dev, "BAR %d: reassigned %pR (expanded by %#llx)\n",
|
||||||
|
resno, res, (unsigned long long) addsize);
|
||||||
if (resno < PCI_BRIDGE_RESOURCES)
|
if (resno < PCI_BRIDGE_RESOURCES)
|
||||||
pci_update_resource(dev, resno);
|
pci_update_resource(dev, resno);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue