Re: Please revert 928bea964827d7824b548c1f8e06eccbbc4d0d7d

Yinghai Lu
2013-09-27T21:54:08Z

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

On Fri, Sep 27, 2013 at 2:46 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:

> Wouldn't it be better to simply have pci_enable_device() always set bus
> master on a bridge? I don't see any case where it makes sense to have
> an enabled bridge without the master bit set on it...

Do you mean attached?

[-- Attachment #2: pci_set_master_again.patch --]
[-- Type: application/octet-stream, Size: 510 bytes --]

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e8ccf6c..4eff99b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1156,11 +1156,13 @@ static void pci_enable_bridge(struct pci_dev *dev)
pci_enable_bridge(dev->bus->self);

if (pci_is_enabled(dev))
- return;
+ goto out; /* some other driver could skip pci_set_master ! */
retval = pci_enable_device(dev);
if (retval)
dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n",
retval);
+
+out:
pci_set_master(dev);
}