Re: [PATCH] PCIe: Designware: Do not allow config space through ranges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 23 December 2014 08:24:50 Pratyush Anand wrote:
> On Monday 22 December 2014 02:00 PM, Arnd Bergmann wrote:
> > On Monday 22 December 2014 12:09:04 Pratyush Anand wrote:

> >> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> >> index df781cdf13c1..0b22b42e1ff9 100644
> >> --- a/drivers/pci/host/pcie-designware.c
> >> +++ b/drivers/pci/host/pcie-designware.c
> >> @@ -409,19 +409,6 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
> >>                      pp->mem_mod_base = of_read_number(parser.range -
> >>                                                        parser.np + na, ns);
> >>              }
> >> -            if (restype == 0) {
> >> -                    of_pci_range_to_resource(&range, np, &pp->cfg);
> >> -                    pp->cfg0_size = resource_size(&pp->cfg)/2;
> >> -                    pp->cfg1_size = resource_size(&pp->cfg)/2;
> >> -                    pp->cfg0_base = pp->cfg.start;
> >> -                    pp->cfg1_base = pp->cfg.start + pp->cfg0_size;
> >> -
> >> -                    /* Find the untranslated configuration space address */
> >> -                    pp->cfg0_mod_base = of_read_number(parser.range -
> >> -                                                       parser.np + na, ns);
> >> -                    pp->cfg1_mod_base = pp->cfg0_mod_base +
> >> -                                        pp->cfg0_size;
> >> -            }
> >>      }
> >
> > Since we've allowed this for so long, it may be better to leave this
> > in for compatibility with old dts files. It would however be good to
> > print a warning message. We could also limit it to those machines that
> > are known to have been used with this property in the past.
> 
> I think, only imx6 is using "config from ranges", for which I made the 
> change in this patch. Modification need to be tested and acked by IMX6 
> maintainers.
> I do not see any other driver using it. However, I have kept all 
> designware user in CC here.

The change to look at the 'reg' property for config space was introduced
in 4dd964df36d ("PCI: designware: Look for configuration space in 'reg',
not 'ranges'"), and at the time, we had Exynos5440 and i.MX as users,
which is only a small subset of what we have now. If we are sure that
on both architectures we don't need to support backwards compatibility
for the existing dtbs, then we can do it, but that would be hard to
prove, unless we know for sure that the platforms are already broken
for any user that has old dtb files.

	Arnd
--
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



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux