On Fri, Sep 18, 2015 at 3:30 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote: > > commit a4ad03352739c96842af5d06387595665cdd875e > Author: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> > Date: Fri Sep 18 17:15:01 2015 -0500 > > PCI: Clear IORESOURCE_UNSET when clipping a bridge window > > c770cb4cb505 ("PCI: Mark invalid BARs as unassigned") sets IORESOURCE_UNSET > if we fail to claim a resource. If we tried to claim a bridge window, > failed, clipped the window, and tried to claim the clipped window, we > failed again because of IORESOURCE_UNSET. > > When pci_bus_clip_resource() clips a bridge window to fit inside an > upstream window, we're reassigning the window, so clear the > IORESOURCE_UNSET flag. Also clear IORESOURCE_UNSET in our copy of the > unclipped window so we can see exactly what the original window was and how > it now fits inside the upstream window. > > Fixes: c770cb4cb505 ("PCI: Mark invalid BARs as unassigned") > Based-on-patch-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx> > Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> > CC: stable@xxxxxxxxxxxxxxx # 4.1+ > > diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c > index 6fbd3f2..d3346d2 100644 > --- a/drivers/pci/bus.c > +++ b/drivers/pci/bus.c > @@ -256,6 +256,8 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) > > res->start = start; > res->end = end; > + res->flags &= ~IORESOURCE_UNSET; > + orig_res.flags &= ~IORESOURCE_UNSET; > dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n", > &orig_res, res); > I put this patch in https://bugzilla.kernel.org/show_bug.cgi?id=85491 after niam <mailto:niaminbox@xxxxxxxxx> test that, you may apply that directly. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html