From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDAC0C43331 for ; Thu, 11 Mar 2021 12:38:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F27564FE2 for ; Thu, 11 Mar 2021 12:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233349AbhCKMhi (ORCPT ); Thu, 11 Mar 2021 07:37:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbhCKMhY (ORCPT ); Thu, 11 Mar 2021 07:37:24 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79FE6C061574; Thu, 11 Mar 2021 04:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vJSr/GMFzS2IPyn11BIby5mlM7bzUpTd/5u2QdjX24c=; b=LASDnO6q08S6flHgSsiq/NgLoc WMh3mPClSKCdYGCN1uG60ilkiCplcvrphwvmYkS1Ityfs4vVhZePIp+cJ8rdqNqWBuJnfxPm7NdTz kQvx5QqDg47ZxUvcDHii6bzPHleHomTd6kuICU4oNXihW1G+GjppTR6T1kdzIIIsfjseZxt5YEleJ G7hdVlO8xgzBnFWgzjAm3wAUyF2p9BUaHYy3bVDGdVgcqDHyH/eG2fM6+pk1kSzM9Xv2wSOok7CNb 6iG+sEWL8B8aU34S9UfR3lwLU/jl3dhgIwNLGRY9QS7SENly3ysT+C2jM0nNjWhQbXkhOXogGjaBe e5Hgnz7g==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lKKYU-007JMi-2f; Thu, 11 Mar 2021 12:36:48 +0000 Date: Thu, 11 Mar 2021 12:36:42 +0000 From: Christoph Hellwig To: Paul Cercueil Cc: Christoph Hellwig , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sam Ravnborg , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent Message-ID: <20210311123642.GA1741910@infradead.org> References: <20210307202835.253907-1-paul@crapouillou.net> <20210307202835.253907-4-paul@crapouillou.net> <20210311122642.GB1739082@infradead.org> <3I1TPQ.E55GRWWDYVRG@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3I1TPQ.E55GRWWDYVRG@crapouillou.net> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 12:32:27PM +0000, Paul Cercueil wrote: > > dma_to_phys must not be used by drivers. > > > > I have a proper helper for this waiting for users: > > > > http://git.infradead.org/users/hch/misc.git/commitdiff/96a546e7229ec53aadbdb7936d1e5e6cb5958952 > > > > If you can confirm the helpers works for you I can try to still sneak > > it to Linus for 5.12 to ease the merge pain. > > I can try. How do I get a page pointer from a dma_addr_t? You don't - you get it from using virt_to_page on the pointer returned from dma_alloc_noncoherent. That beind said to keep the API sane I should probably add a wrapper that does that for you.