]> git.baikalelectronics.ru Git - kernel.git/commit
pci: Clamp pcie_set_readrq() when using "performance" settings
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 14 Oct 2011 19:56:15 +0000 (14:56 -0500)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 27 Oct 2011 19:45:44 +0000 (12:45 -0700)
commit23e8f228cae91628a16b0b674e3c6e8eb7f343e5
tree13f1c4565817bab8660e2e38f8fedc5344519788
parente53350d677d60dcaec55a9f00d68ec088a3a39ac
pci: Clamp pcie_set_readrq() when using "performance" settings

When configuring the PCIe settings for "performance", we allow parents
to have a larger Max Payload Size than children and rely on children
Max Read Request Size to not be larger than their own MPS to avoid
having the host bridge generate responses they can't cope with.

However, various drivers in Linux call pci_set_readrq() with arbitrary
values, assuming this to be a simple performance tweak. This breaks
under our "performance" configuration.

Fix that by making sure the value programmed by pcie_set_readrq() is
never larger than the configured MPS for that device.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jon Mason <mason@myri.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci.c