diff options
author | Liu Gang <Gang.Liu@nxp.com> | 2016-08-11 10:52:24 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-09-25 07:25:40 (GMT) |
commit | 48377e57ba57a30c6956508acbf304a902fdf217 (patch) | |
tree | c6fd405c91a08d41d1382311c2ede38edf901304 | |
parent | 237c326f4d008225de9bc06efcdf115b4ff03429 (diff) | |
download | linux-48377e57ba57a30c6956508acbf304a902fdf217.tar.xz |
pci-ep/ls1046a: Instead of the __get_free_pages with dma_alloc_coherent
For more usability, instead of the the __get_free_pages with
dma_alloc_coherent to ensure the data's cache coherent from
PCI port to DDR memroy space.
Signed-off-by: Liu Gang <Gang.Liu@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
-rw-r--r-- | drivers/pci/host/pci-layerscape-ep-debugfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-layerscape-ep-debugfs.c b/drivers/pci/host/pci-layerscape-ep-debugfs.c index eb79222..c117690 100644 --- a/drivers/pci/host/pci-layerscape-ep-debugfs.c +++ b/drivers/pci/host/pci-layerscape-ep-debugfs.c @@ -328,14 +328,14 @@ static int ls_pcie_ep_init_test(struct ls_ep_dev *ep, u64 bus_addr) spin_lock_init(&test->lock); test->status = TEST_IDLE; - test->buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, - get_order(PCIE_BAR4_SIZE)); + test->buf = dma_alloc_coherent(pcie->dev, get_order(PCIE_BAR4_SIZE), + &test->buf_addr, + GFP_KERNEL); if (!test->buf) { dev_info(&ep->dev, "failed to get mem for bar4\n"); err = -ENOMEM; goto _err; } - test->buf_addr = virt_to_phys(test->buf); test->cfg = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(PCIE_BAR2_SIZE)); |