aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJohn L. Burr <jlburr@cadence.com>2011-01-11 23:39:46 -0500
committerRoland Dreier <rolandd@cisco.com>2011-01-11 23:39:47 -0500
commiteb4a7cbf27082bea34764bab3bc85595683f967b (patch)
tree4d0d799a04c7d62d9ceb35e73f01112a49dc5d83 /drivers/infiniband
parent4162cf64973df51fc885825bc9ca4d055891c49f (diff)
IB/mthca: Fix driver when sizeof (phys_addr_t) > sizeof (long)
Some systems have PCI addresses that don't fit in unsigned long (eg some 32-bit PowerPC 440 systems have 36-bit bus addresses). Fix up the driver by using phys_addr_t where appropriate, so we don't truncate any PCI resource addresses before ioremapping them. Signed-off-by: John L. Burr <jlburr@cadence.com> [ Update to apply to current driver source. - Roland ] Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_catas.c5
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_eq.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mr.c2
5 files changed, 7 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_catas.c b/drivers/infiniband/hw/mthca/mthca_catas.c
index 0aa0110e4b6c..e4a08c2819e4 100644
--- a/drivers/infiniband/hw/mthca/mthca_catas.c
+++ b/drivers/infiniband/hw/mthca/mthca_catas.c
@@ -146,7 +146,7 @@ static void poll_catas(unsigned long dev_ptr)
146 146
147void mthca_start_catas_poll(struct mthca_dev *dev) 147void mthca_start_catas_poll(struct mthca_dev *dev)
148{ 148{
149 unsigned long addr; 149 phys_addr_t addr;
150 150
151 init_timer(&dev->catas_err.timer); 151 init_timer(&dev->catas_err.timer);
152 dev->catas_err.map = NULL; 152 dev->catas_err.map = NULL;
@@ -158,7 +158,8 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
158 dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4); 158 dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4);
159 if (!dev->catas_err.map) { 159 if (!dev->catas_err.map) {
160 mthca_warn(dev, "couldn't map catastrophic error region " 160 mthca_warn(dev, "couldn't map catastrophic error region "
161 "at 0x%lx/0x%x\n", addr, dev->catas_err.size * 4); 161 "at 0x%llx/0x%x\n", (unsigned long long) addr,
162 dev->catas_err.size * 4);
162 return; 163 return;
163 } 164 }
164 165
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index f4ceecd9684b..7bfa2a164955 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -713,7 +713,7 @@ int mthca_RUN_FW(struct mthca_dev *dev, u8 *status)
713 713
714static void mthca_setup_cmd_doorbells(struct mthca_dev *dev, u64 base) 714static void mthca_setup_cmd_doorbells(struct mthca_dev *dev, u64 base)
715{ 715{
716 unsigned long addr; 716 phys_addr_t addr;
717 u16 max_off = 0; 717 u16 max_off = 0;
718 int i; 718 int i;
719 719
diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c
index 8e8c728aff88..76785c653c13 100644
--- a/drivers/infiniband/hw/mthca/mthca_eq.c
+++ b/drivers/infiniband/hw/mthca/mthca_eq.c
@@ -653,7 +653,7 @@ static int mthca_map_reg(struct mthca_dev *dev,
653 unsigned long offset, unsigned long size, 653 unsigned long offset, unsigned long size,
654 void __iomem **map) 654 void __iomem **map)
655{ 655{
656 unsigned long base = pci_resource_start(dev->pdev, 0); 656 phys_addr_t base = pci_resource_start(dev->pdev, 0);
657 657
658 *map = ioremap(base + offset, size); 658 *map = ioremap(base + offset, size);
659 if (!*map) 659 if (!*map)
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 5eee6665919a..8a40cd539ab1 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -790,7 +790,7 @@ static int mthca_setup_hca(struct mthca_dev *dev)
790 goto err_uar_table_free; 790 goto err_uar_table_free;
791 } 791 }
792 792
793 dev->kar = ioremap(dev->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE); 793 dev->kar = ioremap((phys_addr_t) dev->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
794 if (!dev->kar) { 794 if (!dev->kar) {
795 mthca_err(dev, "Couldn't map kernel access region, " 795 mthca_err(dev, "Couldn't map kernel access region, "
796 "aborting.\n"); 796 "aborting.\n");
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c
index 065b20899876..44045c8846db 100644
--- a/drivers/infiniband/hw/mthca/mthca_mr.c
+++ b/drivers/infiniband/hw/mthca/mthca_mr.c
@@ -853,7 +853,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
853 853
854int mthca_init_mr_table(struct mthca_dev *dev) 854int mthca_init_mr_table(struct mthca_dev *dev)
855{ 855{
856 unsigned long addr; 856 phys_addr_t addr;
857 int mpts, mtts, err, i; 857 int mpts, mtts, err, i;
858 858
859 err = mthca_alloc_init(&dev->mr_table.mpt_alloc, 859 err = mthca_alloc_init(&dev->mr_table.mpt_alloc,