PCI: dwc: Use the DMA-API to get the MSI address
authorNiklas Cassel <niklas.cassel@axis.com>
Tue, 19 Dec 2017 23:29:22 +0000 (00:29 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 21 Dec 2017 11:09:10 +0000 (11:09 +0000)
commit111111a72e677ff13d82d7b26c89a0cd84b32280
treedf7736609b8a1f4075da435277d44871e6b9fec8
parent4751fac776f37e75670c7bdb7a86f81553f538e0
PCI: dwc: Use the DMA-API to get the MSI address

Use the DMA-API to get the MSI address. This address will be written to
our PCI config space and to the register which determines which AXI
address the DWC IP will spoof for incoming MSI irqs.

Since it is a PCIe endpoint device, rather than the CPU, that is supposed
to write to the MSI address, the proper way to get the MSI address is by
using the DMA API, not by using virt_to_phys().

Using virt_to_phys() might work on some systems, but using the DMA API
should work on all systems.

This is essentially the same thing as allocating a buffer in a driver
to which the endpoint will write to. To do this, we use the DMA API.

Tested-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Joao Pinto <jpinto@synopsys.com>
drivers/pci/dwc/pcie-designware-host.c
drivers/pci/dwc/pcie-designware.h