aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2016-08-02 17:06:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:34 -0400
commitcb782cdd2ffffbf7fd17e4aefb20f4db5c67caeb (patch)
treee5e2096ca162c5b433850aaab8731f9281a475cb
parent4498c31adff99d243b34b0bf39363a35ea070928 (diff)
rapidio/tsi721: add PCIe MRRS override parameter
Add PCIe Maximum Read Request Size (MRRS) adjustment parameter to allow users to override configuration register value set during PCIe bus initialization. Performance of Tsi721 device as PCIe bus master can be improved if MRRS is set to its maximum value (4096 bytes). Some platforms have limitations for supported MRRS and therefore the default value should be preserved, unless it is known that given platform supports full set of MRRS values defined by PCI Express specification. Link: http://lkml.kernel.org/r/1469125134-16523-6-git-send-email-alexandre.bounine@idt.com Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com> Cc: Barry Wood <barry.wood@idt.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/rapidio/tsi721.txt7
-rw-r--r--drivers/rapidio/devices/tsi721.c16
2 files changed, 22 insertions, 1 deletions
diff --git a/Documentation/rapidio/tsi721.txt b/Documentation/rapidio/tsi721.txt
index 0e0e90bef882..9c6ee3853793 100644
--- a/Documentation/rapidio/tsi721.txt
+++ b/Documentation/rapidio/tsi721.txt
@@ -39,6 +39,13 @@ fully compatible with RIONET driver (Ethernet over RapidIO messaging services).
39 DMA channels not selected by this mask will not be used by this device 39 DMA channels not selected by this mask will not be used by this device
40 driver. Default value is 0x7f (use all channels). 40 driver. Default value is 0x7f (use all channels).
41 41
42- 'pcie_mrrs' - override value for PCIe Maximum Read Request Size (MRRS).
43 This parameter gives an ability to override MRRS value set during PCIe
44 configuration process. Tsi721 supports read request sizes up to 4096B.
45 Value for this parameter must be set as defined by PCIe specification:
46 0 = 128B, 1 = 256B, 2 = 512B, 3 = 1024B, 4 = 2048B and 5 = 4096B.
47 Default value is '-1' (= keep platform setting).
48
42II. Known problems 49II. Known problems
43 50
44 None. 51 None.
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 4c20e9927a7e..85098f8973a9 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -37,11 +37,15 @@
37#include "tsi721.h" 37#include "tsi721.h"
38 38
39#ifdef DEBUG 39#ifdef DEBUG
40u32 dbg_level = DBG_INIT | DBG_EXIT; 40u32 dbg_level;
41module_param(dbg_level, uint, S_IWUSR | S_IRUGO); 41module_param(dbg_level, uint, S_IWUSR | S_IRUGO);
42MODULE_PARM_DESC(dbg_level, "Debugging output level (default 0 = none)"); 42MODULE_PARM_DESC(dbg_level, "Debugging output level (default 0 = none)");
43#endif 43#endif
44 44
45static int pcie_mrrs = -1;
46module_param(pcie_mrrs, int, S_IRUGO);
47MODULE_PARM_DESC(pcie_mrrs, "PCIe MRRS override value (0...5)");
48
45static void tsi721_omsg_handler(struct tsi721_device *priv, int ch); 49static void tsi721_omsg_handler(struct tsi721_device *priv, int ch);
46static void tsi721_imsg_handler(struct tsi721_device *priv, int ch); 50static void tsi721_imsg_handler(struct tsi721_device *priv, int ch);
47 51
@@ -2840,6 +2844,16 @@ static int tsi721_probe(struct pci_dev *pdev,
2840 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL, 2844 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL,
2841 PCI_EXP_DEVCTL_RELAX_EN | PCI_EXP_DEVCTL_NOSNOOP_EN, 0); 2845 PCI_EXP_DEVCTL_RELAX_EN | PCI_EXP_DEVCTL_NOSNOOP_EN, 0);
2842 2846
2847 /* Override PCIe Maximum Read Request Size setting if requested */
2848 if (pcie_mrrs >= 0) {
2849 if (pcie_mrrs <= 5)
2850 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL,
2851 PCI_EXP_DEVCTL_READRQ, pcie_mrrs << 12);
2852 else
2853 tsi_info(&pdev->dev,
2854 "Invalid MRRS override value %d", pcie_mrrs);
2855 }
2856
2843 /* Adjust PCIe completion timeout. */ 2857 /* Adjust PCIe completion timeout. */
2844 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL2, 0xf, 0x2); 2858 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL2, 0xf, 0x2);
2845 2859