diff mbox series

[V2,6/6] PCI: rcar: Allow 64bit MSI addresses

Message ID 20190322023844.18574-6-marek.vasut@gmail.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series [V2,1/6] PCI: rcar: Clean up remaining macros defining bits | expand

Commit Message

Marek Vasut March 22, 2019, 2:38 a.m. UTC
From: Marek Vasut <marek.vasut+renesas@gmail.com>

The MSI address can be 64bit. Switch the data type used to hold the
result of virt_to_phys() to phys_addr_t to reflect its properties
correctly and program the top 32bits of PA into PCIEMSIAUR.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
To: linux-pci@vger.kernel.org
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
V2: - s/it's/its/ in commit message
    - Add R-B from Geert
---
 drivers/pci/controller/pcie-rcar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Wolfram Sang March 22, 2019, 8:34 a.m. UTC | #1
> -	rcar_pci_write_reg(pcie, 0, PCIEMSIAUR);
> +	rcar_pci_write_reg(pcie, base >> 32, PCIEMSIAUR);

Seeing the in-depth discussion between you and Geert, I'll leave this to
you guys :)
Marek Vasut March 23, 2019, 1:52 a.m. UTC | #2
On 3/22/19 9:34 AM, Wolfram Sang wrote:
> 
>> -	rcar_pci_write_reg(pcie, 0, PCIEMSIAUR);
>> +	rcar_pci_write_reg(pcie, base >> 32, PCIEMSIAUR);
> 
> Seeing the in-depth discussion between you and Geert, I'll leave this to
> you guys :)

I think this fix is clear, the discussion is now rather about whether we
should allocate the reserved page with GFP_DMA32 and keep it in 32bit
address range or not.

I'll reword the commit message though.
diff mbox series

Patch

diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
index 989b7b73ed61..75ac83f21035 100644
--- a/drivers/pci/controller/pcie-rcar.c
+++ b/drivers/pci/controller/pcie-rcar.c
@@ -889,7 +889,7 @@  static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
 {
 	struct device *dev = pcie->dev;
 	struct rcar_msi *msi = &pcie->msi;
-	unsigned long base;
+	phys_addr_t base;
 	int err, i;
 
 	mutex_init(&msi->lock);
@@ -931,7 +931,7 @@  static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
 	base = virt_to_phys((void *)msi->pages);
 
 	rcar_pci_write_reg(pcie, base | MSIFE, PCIEMSIALR);
-	rcar_pci_write_reg(pcie, 0, PCIEMSIAUR);
+	rcar_pci_write_reg(pcie, base >> 32, PCIEMSIAUR);
 
 	/* enable all MSI interrupts */
 	rcar_pci_write_reg(pcie, 0xffffffff, PCIEMSIIER);