PCI: imx6: Limit DBI register length
authorStefan Agner <stefan@agner.ch>
Fri, 26 Jul 2019 14:40:07 +0000 (16:40 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 15 Aug 2019 10:51:37 +0000 (11:51 +0100)
commit075af61c19cdc32b94fd697c610c9a07fa21866e
tree79a48733d44265c5f12887a4e9fc8a7d463ce47f
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b
PCI: imx6: Limit DBI register length

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:

  # cat /sys/devices/soc0/soc/1ffc000.pcie/pci0000\:00/0000\:00\:00.0/config
  [  100.021433] Unhandled fault: imprecise external abort (0x1406) at 0xb6ea7000
  ...
  [  100.056423] PC is at dw_pcie_read+0x50/0x84
  [  100.060790] LR is at dw_pcie_rd_own_conf+0x44/0x48
  ...

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
drivers/pci/controller/dwc/pci-imx6.c