Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4690955pxk; Wed, 30 Sep 2020 09:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1RUbbncoFSFDqHqnhedyJcENT7m57XLJo2X6Fho0xJNw47O4JSRoY8HVWLanTlLsDGUq8 X-Received: by 2002:a17:906:cb94:: with SMTP id mf20mr3769552ejb.8.1601482395870; Wed, 30 Sep 2020 09:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601482395; cv=none; d=google.com; s=arc-20160816; b=Ue2AxVBm+dw2Dfej6WAuKnqCtTnAgqKyifbZHvho+kv8L+8wFGzAqHtJyPDIBBTTN5 rqWHJqu0+iNzxHR9suir6iZtwsVSlOXkXB2Y1Ho+puRTdJXYBVROaPjV+iTzNKn6IsTs IubwB/J1wdH+JI4vdcbuaZV17QqQYZMucZ5BbS17fCKXZcXdnxoJ1h7w7OSK2BeJMioX BY6BZVwXpRAiJuuS93AJR0/69z/mQjg7RDPJXsnX8mZpT/pGW1kUNWIkmsXBPiKP0Dbl DsxqUywN2WjBkK3559JA2eN7S5exW0hogtjGfoLtynjVoTRTob4Z43EaYuY4hGvTKmtg Z+4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=i5JL33FyqdewaZT8N740f39JzLqYqizIVaawwTomBjs=; b=o2mXM5veEpHqOtxKe1jhoNc411BivVuMrLoD8JJSdaheSEWyL6CgRzVt8M09l0yZ9Z PtF0WXLk7fcsAsgqrgIgAyAf57FWA99NZmln8OatIV3Nv2pKL/FpdGhqw03yPbERRPRJ gFanLt3YmjUMg+4+f7EjMnbE3gN87CJowyVZASrXuhQzLerznd8Bag3fhgKBYdWEDCNx lcW4TairGJ+9JfIgqU+9tGKUZHkkX5FjgU28Xltl77FKGmplMKRgq2BzFYSizoGEP5Iw BQcd9ufDP2N7zGUOi8aJGaLea/8tGH5Ay1wFjhld+u19Qc2Jr1vArSDBBZPumtqeVxR7 ALjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m23si1475451ejo.333.2020.09.30.09.12.53; Wed, 30 Sep 2020 09:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731267AbgI3QL1 (ORCPT + 99 others); Wed, 30 Sep 2020 12:11:27 -0400 Received: from verein.lst.de ([213.95.11.211]:45307 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgI3QL1 (ORCPT ); Wed, 30 Sep 2020 12:11:27 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C9D8F6736F; Wed, 30 Sep 2020 18:11:24 +0200 (CEST) Date: Wed, 30 Sep 2020 18:11:24 +0200 From: Christoph Hellwig To: Paul Cercueil Cc: Christoph Hellwig , Stephen Rothwell , Dave Airlie , DRI , Linux Next Mailing List , Linux Kernel Mailing List Subject: Re: linux-next: build failure after merge of the drm tree Message-ID: <20200930161124.GA6859@lst.de> References: <20200928135405.73404219@canb.auug.org.au> <20200928060427.GA15041@lst.de> <20200928113415.GA555@lst.de> <72ADHQ.T6LL1SHQF0RG3@crapouillou.net> <20200928121002.GA3219@lst.de> <20200930090252.GA9357@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 03:33:13PM +0200, Paul Cercueil wrote: > One thing missing for remap_pfn_range(), I have no alternative for this: > > vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, > DMA_ATTR_NON_CONSISTENT); > > So I have to do: > > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK; > pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT; > > And that will only compile on MIPS, because these _CACHE_* macros are only > defined there. > > I would need something like a pgprot_noncoherent(), I think. dma_alloc_pages gives you cached memory, so you can't just use an uncached protection for the userspace mmap here. If you want uncached memory you need to use dma_alloc_coherent paired with dma_mmap_coherent. Or dma_alloc_wc for a slightly different flavor of uncached. (both of the map to dma_alloc_attrs / dma_mmap_attrs eventually).