Re: [PATCH v8] PCI: imx6: limit DBI register length

From: Leonard Crestez
Date: Tue Feb 26 2019 - 08:27:30 EST


On Tue, 2019-02-26 at 14:06 +0100, Stefan Agner wrote:
> Define the length of the DBI registers and limit config space to its
> length. This makes sure that the kernel does not access registers
> beyond that point, avoiding the following abort on a i.MX 6Quad:
>
> +static void imx6_pcie_quirk(struct pci_dev *dev)
> +{
> + struct pci_bus *bus = dev->bus;
> + struct pcie_port *pp = bus->sysdata;
> +
> + /* Bus parent is the PCI bridge, its parent is this platform driver */
> + if (!bus->dev.parent || !bus->dev.parent->parent)
> + return;
> +
> + /* Make sure we only quirk devices associated with this driver */
> + if (bus->dev.parent->parent->driver != &imx6_pcie_driver.driver)
> + return;

This looks like it would be enough to prevent interfering with other
dwc-based pci drivers.

Reviewed-by: Leonard Crestez <leonard.crestez@xxxxxxx>