diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2012-07-25 17:19:49 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-05 01:18:43 -0400 |
commit | aa97c32c1e6d6564cc385c36bfd28a2663a9bad6 (patch) | |
tree | b566e8bc4d55c5e6ce0a109c3f1a4593fea9e9bd /drivers/infiniband/hw/ehca/ehca_mrmw.c | |
parent | 7187dafc1e7fde551001ba91ea94cf6faa73256a (diff) |
IB/ehca: Don't use phys_to_abs(), it's a nop
Since commit f5339277 phys_to_abs() is 100% a nop, so just remove it.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_mrmw.c')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index b781b2cb0624..47baa5456534 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -1870,9 +1870,8 @@ static int ehca_set_pagebuf_user1(struct ehca_mr_pginfo *pginfo, | |||
1870 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { | 1870 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { |
1871 | pgaddr = page_to_pfn(sg_page(&chunk->page_list[i])) | 1871 | pgaddr = page_to_pfn(sg_page(&chunk->page_list[i])) |
1872 | << PAGE_SHIFT ; | 1872 | << PAGE_SHIFT ; |
1873 | *kpage = phys_to_abs(pgaddr + | 1873 | *kpage = pgaddr + (pginfo->next_hwpage * |
1874 | (pginfo->next_hwpage * | 1874 | pginfo->hwpage_size); |
1875 | pginfo->hwpage_size)); | ||
1876 | if ( !(*kpage) ) { | 1875 | if ( !(*kpage) ) { |
1877 | ehca_gen_err("pgaddr=%llx " | 1876 | ehca_gen_err("pgaddr=%llx " |
1878 | "chunk->page_list[i]=%llx " | 1877 | "chunk->page_list[i]=%llx " |
@@ -1927,7 +1926,7 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list, | |||
1927 | u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT; | 1926 | u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT; |
1928 | if (ehca_debug_level >= 3) | 1927 | if (ehca_debug_level >= 3) |
1929 | ehca_gen_dbg("chunk_page=%llx value=%016llx", pgaddr, | 1928 | ehca_gen_dbg("chunk_page=%llx value=%016llx", pgaddr, |
1930 | *(u64 *)abs_to_virt(phys_to_abs(pgaddr))); | 1929 | *(u64 *)abs_to_virt(pgaddr)); |
1931 | if (pgaddr - PAGE_SIZE != *prev_pgaddr) { | 1930 | if (pgaddr - PAGE_SIZE != *prev_pgaddr) { |
1932 | ehca_gen_err("uncontiguous page found pgaddr=%llx " | 1931 | ehca_gen_err("uncontiguous page found pgaddr=%llx " |
1933 | "prev_pgaddr=%llx page_list_i=%x", | 1932 | "prev_pgaddr=%llx page_list_i=%x", |
@@ -1962,7 +1961,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, | |||
1962 | if (nr_kpages == kpages_per_hwpage) { | 1961 | if (nr_kpages == kpages_per_hwpage) { |
1963 | pgaddr = ( page_to_pfn(sg_page(&chunk->page_list[i])) | 1962 | pgaddr = ( page_to_pfn(sg_page(&chunk->page_list[i])) |
1964 | << PAGE_SHIFT ); | 1963 | << PAGE_SHIFT ); |
1965 | *kpage = phys_to_abs(pgaddr); | 1964 | *kpage = pgaddr; |
1966 | if ( !(*kpage) ) { | 1965 | if ( !(*kpage) ) { |
1967 | ehca_gen_err("pgaddr=%llx i=%x", | 1966 | ehca_gen_err("pgaddr=%llx i=%x", |
1968 | pgaddr, i); | 1967 | pgaddr, i); |
@@ -1990,13 +1989,11 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, | |||
1990 | (pginfo->hwpage_size - 1)) >> | 1989 | (pginfo->hwpage_size - 1)) >> |
1991 | PAGE_SHIFT; | 1990 | PAGE_SHIFT; |
1992 | nr_kpages -= pginfo->kpage_cnt; | 1991 | nr_kpages -= pginfo->kpage_cnt; |
1993 | *kpage = phys_to_abs( | 1992 | *kpage = pgaddr & |
1994 | pgaddr & | 1993 | ~(pginfo->hwpage_size - 1); |
1995 | ~(pginfo->hwpage_size - 1)); | ||
1996 | } | 1994 | } |
1997 | if (ehca_debug_level >= 3) { | 1995 | if (ehca_debug_level >= 3) { |
1998 | u64 val = *(u64 *)abs_to_virt( | 1996 | u64 val = *(u64 *)abs_to_virt(pgaddr); |
1999 | phys_to_abs(pgaddr)); | ||
2000 | ehca_gen_dbg("kpage=%llx chunk_page=%llx " | 1997 | ehca_gen_dbg("kpage=%llx chunk_page=%llx " |
2001 | "value=%016llx", | 1998 | "value=%016llx", |
2002 | *kpage, pgaddr, val); | 1999 | *kpage, pgaddr, val); |
@@ -2084,9 +2081,8 @@ static int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo, | |||
2084 | pginfo->num_hwpages, i); | 2081 | pginfo->num_hwpages, i); |
2085 | return -EFAULT; | 2082 | return -EFAULT; |
2086 | } | 2083 | } |
2087 | *kpage = phys_to_abs( | 2084 | *kpage = (pbuf->addr & ~(pginfo->hwpage_size - 1)) + |
2088 | (pbuf->addr & ~(pginfo->hwpage_size - 1)) + | 2085 | (pginfo->next_hwpage * pginfo->hwpage_size); |
2089 | (pginfo->next_hwpage * pginfo->hwpage_size)); | ||
2090 | if ( !(*kpage) && pbuf->addr ) { | 2086 | if ( !(*kpage) && pbuf->addr ) { |
2091 | ehca_gen_err("pbuf->addr=%llx pbuf->size=%llx " | 2087 | ehca_gen_err("pbuf->addr=%llx pbuf->size=%llx " |
2092 | "next_hwpage=%llx", pbuf->addr, | 2088 | "next_hwpage=%llx", pbuf->addr, |
@@ -2124,8 +2120,8 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, | |||
2124 | /* loop over desired page_list entries */ | 2120 | /* loop over desired page_list entries */ |
2125 | fmrlist = pginfo->u.fmr.page_list + pginfo->u.fmr.next_listelem; | 2121 | fmrlist = pginfo->u.fmr.page_list + pginfo->u.fmr.next_listelem; |
2126 | for (i = 0; i < number; i++) { | 2122 | for (i = 0; i < number; i++) { |
2127 | *kpage = phys_to_abs((*fmrlist & ~(pginfo->hwpage_size - 1)) + | 2123 | *kpage = (*fmrlist & ~(pginfo->hwpage_size - 1)) + |
2128 | pginfo->next_hwpage * pginfo->hwpage_size); | 2124 | pginfo->next_hwpage * pginfo->hwpage_size; |
2129 | if ( !(*kpage) ) { | 2125 | if ( !(*kpage) ) { |
2130 | ehca_gen_err("*fmrlist=%llx fmrlist=%p " | 2126 | ehca_gen_err("*fmrlist=%llx fmrlist=%p " |
2131 | "next_listelem=%llx next_hwpage=%llx", | 2127 | "next_listelem=%llx next_hwpage=%llx", |
@@ -2152,8 +2148,7 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, | |||
2152 | u64 prev = *kpage; | 2148 | u64 prev = *kpage; |
2153 | /* check if adrs are contiguous */ | 2149 | /* check if adrs are contiguous */ |
2154 | for (j = 1; j < cnt_per_hwpage; j++) { | 2150 | for (j = 1; j < cnt_per_hwpage; j++) { |
2155 | u64 p = phys_to_abs(fmrlist[j] & | 2151 | u64 p = fmrlist[j] & ~(pginfo->hwpage_size - 1); |
2156 | ~(pginfo->hwpage_size - 1)); | ||
2157 | if (prev + pginfo->u.fmr.fmr_pgsize != p) { | 2152 | if (prev + pginfo->u.fmr.fmr_pgsize != p) { |
2158 | ehca_gen_err("uncontiguous fmr pages " | 2153 | ehca_gen_err("uncontiguous fmr pages " |
2159 | "found prev=%llx p=%llx " | 2154 | "found prev=%llx p=%llx " |
@@ -2388,8 +2383,8 @@ static int ehca_update_busmap(unsigned long pfn, unsigned long nr_pages) | |||
2388 | memset(ehca_bmap, 0xFF, EHCA_TOP_MAP_SIZE); | 2383 | memset(ehca_bmap, 0xFF, EHCA_TOP_MAP_SIZE); |
2389 | } | 2384 | } |
2390 | 2385 | ||
2391 | start_section = phys_to_abs(pfn * PAGE_SIZE) / EHCA_SECTSIZE; | 2386 | start_section = (pfn * PAGE_SIZE) / EHCA_SECTSIZE; |
2392 | end_section = phys_to_abs((pfn + nr_pages) * PAGE_SIZE) / EHCA_SECTSIZE; | 2387 | end_section = ((pfn + nr_pages) * PAGE_SIZE) / EHCA_SECTSIZE; |
2393 | for (i = start_section; i < end_section; i++) { | 2388 | for (i = start_section; i < end_section; i++) { |
2394 | int ret; | 2389 | int ret; |
2395 | top = ehca_calc_index(i, EHCA_TOP_INDEX_SHIFT); | 2390 | top = ehca_calc_index(i, EHCA_TOP_INDEX_SHIFT); |