]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ntb: ntb_hw_intel: init peer_addr in struct intel_ntb_dev
authorDave Jiang <dave.jiang@intel.com>
Thu, 27 Oct 2016 18:06:44 +0000 (11:06 -0700)
committerJon Mason <jdmason@kudzu.us>
Sun, 13 Nov 2016 21:48:29 +0000 (16:48 -0500)
The peer_addr member of intel_ntb_dev is not set, therefore when
acquiring ntb_peer_db and ntb_peer_spad we only get the offset rather
than the actual physical address. Adding fix to correct that.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Acked-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/intel/ntb_hw_intel.c

index 1ee61d92c54b2b6cc15af7e4cc8d59874cdd7753..7310a261c858bab090bab14ecf3646626aac7651 100644 (file)
@@ -1755,6 +1755,8 @@ static int xeon_setup_b2b_mw(struct intel_ntb_dev *ndev,
                                            XEON_B2B_MIN_SIZE);
                if (!ndev->peer_mmio)
                        return -EIO;
+
+               ndev->peer_addr = pci_resource_start(pdev, b2b_bar);
        }
 
        return 0;
@@ -2019,6 +2021,7 @@ static int intel_ntb_init_pci(struct intel_ntb_dev *ndev, struct pci_dev *pdev)
                goto err_mmio;
        }
        ndev->peer_mmio = ndev->self_mmio;
+       ndev->peer_addr = pci_resource_start(pdev, 0);
 
        return 0;