From 9484d469fa9da4eb8089d82aa2c112c73e0cf50b Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Thu, 7 Jul 2016 17:22:11 +1000 Subject: hw/phb3: Increase AIB TX command credit for DMA read in CAPP DMA mode When enabling CAPI in DMA mode, set the AIB TX command credits for channel 2 (DMA read) to 28, rather than 1. This significantly improves DMA read performance in CAPI DMA mode. Fixes: 5477148a439f ("phb3: Add support for CAPP DMA mode") Reported-by: John Walthour Reported-by: Ricardo Mata Reported-by: Michael Perez Cc: Ian Munsie Signed-off-by: Andrew Donnellan Signed-off-by: Stewart Smith --- hw/phb3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/phb3.c b/hw/phb3.c index b97e150..8742c7a 100644 --- a/hw/phb3.c +++ b/hw/phb3.c @@ -3344,8 +3344,17 @@ static int64_t enable_capi_mode(struct phb3 *p, uint64_t pe_number, bool dma_mod /* aib tx cmd cred */ xscom_read(p->chip_id, p->pci_xscom + 0xd, ®); - reg &= ~PPC_BITMASK(42,46); - reg |= PPC_BIT(47); + if (dma_mode) { + /* + * In DMA mode, increase AIB credit value for ch 2 (DMA read) + * for performance reasons + */ + reg &= ~PPC_BITMASK(42, 47); + reg |= PPC_BITMASK(43, 45); + } else { + reg &= ~PPC_BITMASK(42, 46); + reg |= PPC_BIT(47); + } xscom_write(p->chip_id, p->pci_xscom + 0xd, reg); xscom_write(p->chip_id, p->pci_xscom + 0xc, 0xff00000000000000ull); -- cgit v1.1