PCI: mediatek: Fixup MSI enablement logic by enabling MSI before clocks
authorHonghui Zhang <honghui.zhang@mediatek.com>
Mon, 15 Oct 2018 08:08:56 +0000 (16:08 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 17 Oct 2018 14:36:17 +0000 (15:36 +0100)
commit3828d60fd2ef99f97a677c1f95af2ab3e65e2576
tree57d2c65fca775d50058b8c16baa711988bd2e908
parent57cb3152b360eabf30d498515dcf9049f3c7b9df
PCI: mediatek: Fixup MSI enablement logic by enabling MSI before clocks

Commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and
MT7622") added MSI support but enabled MSI in the wrong place, at a step
in the probe sequence where clocks were not still enabled.

Fix this issue by calling mtk_pcie_enable_msi() in mtk_pcie_startup_port_v2()
since clocks are enabled when mtk_pcie_startup_port_v2() is called.

To avoid forward declaration of mtk_pcie_enable_msi(), move the
mtk_pcie_startup_port_v2() function definition in the file.

Fixes: 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
[lorenzo.pieralisi@arm.com: squashed commit and adapted log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
drivers/pci/controller/pcie-mediatek.c