From patchwork Sat Dec 14 03:26:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22463 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C489323908 for ; Sat, 14 Dec 2013 03:26:47 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id jw12sf5225240veb.7 for ; Fri, 13 Dec 2013 19:26:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=S8qcRYNDcCciVxoeyo/GsLCk7KieWM+E17NX5TVoMl4=; b=b3QoXxwkSpC7KlCuGK62bYuyoZ/ZyBRw3BIOMHQW/+V+QVTtz9wyrocHc1uFCS2Tn9 msjqFEIDv3lncoBX8sjsx3ayuXF/SVhR+xoMfV2QBwRDbRD4SbmhypdBVPRJWwl0lHVO kG3vAQwCRicuc1bNgRIRd2iI/67guKSIGIoEDG8hrr72UiqFRAS2pMVCI4Es1Yx8j5mn LVD4bEtRxGSZO85omeLinopFITARf6afuGfsm/nRA3MgWJbeYaAoSMPMsvuOXss7VT72 5qpkIkVWMw+Ka3Z9HTtT3ROcoWGkzqZwtaIXcc1yDdmqem1FNsCvMCDgHTOKw2vT29Xv MPsQ== X-Gm-Message-State: ALoCoQmiAVa3kZBu5QSLIfETUVgI/k5Mm++AnUbppltFpuj1w78KG2ckJvvBJhC6eWZB7zsD+qFb X-Received: by 10.224.104.8 with SMTP id m8mr2202157qao.0.1386991606838; Fri, 13 Dec 2013 19:26:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.228 with SMTP id f4ls1220575qef.85.gmail; Fri, 13 Dec 2013 19:26:46 -0800 (PST) X-Received: by 10.58.181.230 with SMTP id dz6mr2554924vec.35.1386991606611; Fri, 13 Dec 2013 19:26:46 -0800 (PST) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id er6si1422136vdc.75.2013.12.13.19.26.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id w20so1853293vbb.33 for ; Fri, 13 Dec 2013 19:26:46 -0800 (PST) X-Received: by 10.58.187.129 with SMTP id fs1mr2546737vec.45.1386991606417; Fri, 13 Dec 2013 19:26:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp86923vcz; Fri, 13 Dec 2013 19:26:45 -0800 (PST) X-Received: by 10.68.212.10 with SMTP id ng10mr7183733pbc.158.1386991605478; Fri, 13 Dec 2013 19:26:45 -0800 (PST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id am2si2988736pad.38.2013.12.13.19.26.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.48; Received: by mail-pa0-f48.google.com with SMTP id rd3so796952pab.35 for ; Fri, 13 Dec 2013 19:26:44 -0800 (PST) X-Received: by 10.68.224.38 with SMTP id qz6mr7293961pbc.156.1386991604718; Fri, 13 Dec 2013 19:26:44 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nw11sm11680086pab.13.2013.12.13.19.26.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:43 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 093/115] ion: don't use phys_to_page or __phys_to_pfn Date: Fri, 13 Dec 2013 19:26:13 -0800 Message-Id: <1386991595-6251-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Colin Cross phys_to_page and __phys_to_pfn don't exist on all platforms. Use a combination of pfn_to_page, PFN_DOWN, page_to_pfn, and virt_to_page to get the same results. Signed-off-by: Colin Cross Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_carveout_heap.c | 4 ++-- drivers/staging/android/ion/ion_chunk_heap.c | 5 +++-- drivers/staging/android/ion/ion_system_heap.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index 051363a..1d53e91 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -96,8 +96,8 @@ struct sg_table *ion_carveout_heap_map_dma(struct ion_heap *heap, kfree(table); return ERR_PTR(ret); } - sg_set_page(table->sgl, phys_to_page(buffer->priv_phys), buffer->size, - 0); + sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(buffer->priv_phys)), + buffer->size, 0); return table; } diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index d3363d6..fb1a7b9 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -71,7 +71,8 @@ static int ion_chunk_heap_allocate(struct ion_heap *heap, chunk_heap->chunk_size); if (!paddr) goto err; - sg_set_page(sg, phys_to_page(paddr), chunk_heap->chunk_size, 0); + sg_set_page(sg, pfn_to_page(PFN_DOWN(paddr)), + chunk_heap->chunk_size, 0); sg = sg_next(sg); } @@ -167,7 +168,7 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) goto error; } for (i = 0; i < chunk_heap->size; i += PAGE_SIZE) { - struct page *page = phys_to_page(chunk_heap->base + i); + struct page *page = pfn_to_page(PFN_DOWN(chunk_heap->base + i)); struct page **pages = &page; ret = map_vm_area(vm_struct, pgprot, &pages); diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 62a07ec..3b2f420 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -426,7 +426,7 @@ int ion_system_contig_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, struct vm_area_struct *vma) { - unsigned long pfn = __phys_to_pfn(virt_to_phys(buffer->priv_virt)); + unsigned long pfn = page_to_pfn(virt_to_page(buffer->priv_virt)); return remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot);