From: Roland Dreier Date: Sat, 16 Apr 2005 22:26:18 +0000 (-0700) Subject: [PATCH] IB/mthca: allocate correct number of doorbell pages X-Git-Tag: v2.6.12-rc3~76 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85665c9816a2b38866e03c019bf5c2e47eb9fb04;p=linux-2.6 [PATCH] IB/mthca: allocate correct number of doorbell pages Doorbell record pages are allocated in HCA page size chunks (always 4096 bytes), so we need to divide by 4096 and not PAGE_SIZE when figuring out how many pages we'll need space for. Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c index a70a1c712b..e8f93478f3 100644 --- a/drivers/infiniband/hw/mthca/mthca_memfree.c +++ b/drivers/infiniband/hw/mthca/mthca_memfree.c @@ -446,7 +446,7 @@ int mthca_init_db_tab(struct mthca_dev *dev) init_MUTEX(&dev->db_tab->mutex); - dev->db_tab->npages = dev->uar_table.uarc_size / PAGE_SIZE; + dev->db_tab->npages = dev->uar_table.uarc_size / 4096; dev->db_tab->max_group1 = 0; dev->db_tab->min_group2 = dev->db_tab->npages - 1;