提交 aa97c32c 编写于 作者: M Michael Ellerman 提交者: Benjamin Herrenschmidt

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: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 7187dafc
...@@ -1870,9 +1870,8 @@ static int ehca_set_pagebuf_user1(struct ehca_mr_pginfo *pginfo, ...@@ -1870,9 +1870,8 @@ static int ehca_set_pagebuf_user1(struct ehca_mr_pginfo *pginfo,
for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) {
pgaddr = page_to_pfn(sg_page(&chunk->page_list[i])) pgaddr = page_to_pfn(sg_page(&chunk->page_list[i]))
<< PAGE_SHIFT ; << PAGE_SHIFT ;
*kpage = phys_to_abs(pgaddr + *kpage = pgaddr + (pginfo->next_hwpage *
(pginfo->next_hwpage * pginfo->hwpage_size);
pginfo->hwpage_size));
if ( !(*kpage) ) { if ( !(*kpage) ) {
ehca_gen_err("pgaddr=%llx " ehca_gen_err("pgaddr=%llx "
"chunk->page_list[i]=%llx " "chunk->page_list[i]=%llx "
...@@ -1927,7 +1926,7 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list, ...@@ -1927,7 +1926,7 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list,
u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT; u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT;
if (ehca_debug_level >= 3) if (ehca_debug_level >= 3)
ehca_gen_dbg("chunk_page=%llx value=%016llx", pgaddr, ehca_gen_dbg("chunk_page=%llx value=%016llx", pgaddr,
*(u64 *)abs_to_virt(phys_to_abs(pgaddr))); *(u64 *)abs_to_virt(pgaddr));
if (pgaddr - PAGE_SIZE != *prev_pgaddr) { if (pgaddr - PAGE_SIZE != *prev_pgaddr) {
ehca_gen_err("uncontiguous page found pgaddr=%llx " ehca_gen_err("uncontiguous page found pgaddr=%llx "
"prev_pgaddr=%llx page_list_i=%x", "prev_pgaddr=%llx page_list_i=%x",
...@@ -1962,7 +1961,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, ...@@ -1962,7 +1961,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo,
if (nr_kpages == kpages_per_hwpage) { if (nr_kpages == kpages_per_hwpage) {
pgaddr = ( page_to_pfn(sg_page(&chunk->page_list[i])) pgaddr = ( page_to_pfn(sg_page(&chunk->page_list[i]))
<< PAGE_SHIFT ); << PAGE_SHIFT );
*kpage = phys_to_abs(pgaddr); *kpage = pgaddr;
if ( !(*kpage) ) { if ( !(*kpage) ) {
ehca_gen_err("pgaddr=%llx i=%x", ehca_gen_err("pgaddr=%llx i=%x",
pgaddr, i); pgaddr, i);
...@@ -1990,13 +1989,11 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, ...@@ -1990,13 +1989,11 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo,
(pginfo->hwpage_size - 1)) >> (pginfo->hwpage_size - 1)) >>
PAGE_SHIFT; PAGE_SHIFT;
nr_kpages -= pginfo->kpage_cnt; nr_kpages -= pginfo->kpage_cnt;
*kpage = phys_to_abs( *kpage = pgaddr &
pgaddr & ~(pginfo->hwpage_size - 1);
~(pginfo->hwpage_size - 1));
} }
if (ehca_debug_level >= 3) { if (ehca_debug_level >= 3) {
u64 val = *(u64 *)abs_to_virt( u64 val = *(u64 *)abs_to_virt(pgaddr);
phys_to_abs(pgaddr));
ehca_gen_dbg("kpage=%llx chunk_page=%llx " ehca_gen_dbg("kpage=%llx chunk_page=%llx "
"value=%016llx", "value=%016llx",
*kpage, pgaddr, val); *kpage, pgaddr, val);
...@@ -2084,9 +2081,8 @@ static int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo, ...@@ -2084,9 +2081,8 @@ static int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo,
pginfo->num_hwpages, i); pginfo->num_hwpages, i);
return -EFAULT; return -EFAULT;
} }
*kpage = phys_to_abs( *kpage = (pbuf->addr & ~(pginfo->hwpage_size - 1)) +
(pbuf->addr & ~(pginfo->hwpage_size - 1)) + (pginfo->next_hwpage * pginfo->hwpage_size);
(pginfo->next_hwpage * pginfo->hwpage_size));
if ( !(*kpage) && pbuf->addr ) { if ( !(*kpage) && pbuf->addr ) {
ehca_gen_err("pbuf->addr=%llx pbuf->size=%llx " ehca_gen_err("pbuf->addr=%llx pbuf->size=%llx "
"next_hwpage=%llx", pbuf->addr, "next_hwpage=%llx", pbuf->addr,
...@@ -2124,8 +2120,8 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, ...@@ -2124,8 +2120,8 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo,
/* loop over desired page_list entries */ /* loop over desired page_list entries */
fmrlist = pginfo->u.fmr.page_list + pginfo->u.fmr.next_listelem; fmrlist = pginfo->u.fmr.page_list + pginfo->u.fmr.next_listelem;
for (i = 0; i < number; i++) { for (i = 0; i < number; i++) {
*kpage = phys_to_abs((*fmrlist & ~(pginfo->hwpage_size - 1)) + *kpage = (*fmrlist & ~(pginfo->hwpage_size - 1)) +
pginfo->next_hwpage * pginfo->hwpage_size); pginfo->next_hwpage * pginfo->hwpage_size;
if ( !(*kpage) ) { if ( !(*kpage) ) {
ehca_gen_err("*fmrlist=%llx fmrlist=%p " ehca_gen_err("*fmrlist=%llx fmrlist=%p "
"next_listelem=%llx next_hwpage=%llx", "next_listelem=%llx next_hwpage=%llx",
...@@ -2152,8 +2148,7 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, ...@@ -2152,8 +2148,7 @@ static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo,
u64 prev = *kpage; u64 prev = *kpage;
/* check if adrs are contiguous */ /* check if adrs are contiguous */
for (j = 1; j < cnt_per_hwpage; j++) { for (j = 1; j < cnt_per_hwpage; j++) {
u64 p = phys_to_abs(fmrlist[j] & u64 p = fmrlist[j] & ~(pginfo->hwpage_size - 1);
~(pginfo->hwpage_size - 1));
if (prev + pginfo->u.fmr.fmr_pgsize != p) { if (prev + pginfo->u.fmr.fmr_pgsize != p) {
ehca_gen_err("uncontiguous fmr pages " ehca_gen_err("uncontiguous fmr pages "
"found prev=%llx p=%llx " "found prev=%llx p=%llx "
...@@ -2388,8 +2383,8 @@ static int ehca_update_busmap(unsigned long pfn, unsigned long nr_pages) ...@@ -2388,8 +2383,8 @@ static int ehca_update_busmap(unsigned long pfn, unsigned long nr_pages)
memset(ehca_bmap, 0xFF, EHCA_TOP_MAP_SIZE); memset(ehca_bmap, 0xFF, EHCA_TOP_MAP_SIZE);
} }
start_section = phys_to_abs(pfn * PAGE_SIZE) / EHCA_SECTSIZE; start_section = (pfn * PAGE_SIZE) / EHCA_SECTSIZE;
end_section = phys_to_abs((pfn + nr_pages) * PAGE_SIZE) / EHCA_SECTSIZE; end_section = ((pfn + nr_pages) * PAGE_SIZE) / EHCA_SECTSIZE;
for (i = start_section; i < end_section; i++) { for (i = start_section; i < end_section; i++) {
int ret; int ret;
top = ehca_calc_index(i, EHCA_TOP_INDEX_SHIFT); top = ehca_calc_index(i, EHCA_TOP_INDEX_SHIFT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册