PCI: rockchip: Advertise 128-byte Read Completion Boundary support
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 20 Mar 2017 09:39:40 +0000 (17:39 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 3 Apr 2017 21:04:48 +0000 (16:04 -0500)
Rockchip Root Ports support either 64 or 128 byte Read Completion Boundary
(RCB).  Set the RCB bit in the Link Control register to indicate this.

A 128 byte RCB significantly improves performance of NVMe with libaio.

[bhelgaas: changelog]
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Brian Norris <briannorris@chromium.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
drivers/pci/host/pcie-rockchip.c

index b4dfe3bd15c3f6af8ae7694c9c6e37c79dbef5e7..a7467212ea18f6c792766a177582088739ce7df5 100644 (file)
@@ -601,6 +601,11 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
        status |= PCI_EXP_LNKCTL_CCC;
        rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS);
 
+       /* Set RC's RCB to 128 */
+       status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS);
+       status |= PCI_EXP_LNKCTL_RCB;
+       rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS);
+
        /* Enable Gen1 training */
        rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE,
                            PCIE_CLIENT_CONFIG);