From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752919AbaKJOdE (ORCPT ); Mon, 10 Nov 2014 09:33:04 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41036 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbaKJOdC (ORCPT ); Mon, 10 Nov 2014 09:33:02 -0500 Date: Mon, 10 Nov 2014 15:33:00 +0100 Message-ID: From: Takashi Iwai To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Subject: Inconsistent pgprot between dma_alloc_coherent() and dma_mmap_cohernet() User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I noticed using dma_mmap_coherent() on pages allocated via dma_alloc_coherent() results in a warning on x86: map pfn RAM range req uncached-minus for [mem 0x21d500000-0x21d51ffff], got write-back which comes from arch/x86/mm/pat.c. Looking at the code, it seems that dma_mmap_coherent() blindly assumes that the pages are with pgprot_noncached(), but on x86, it's obviously not. Maybe some other archs have the same problem. How should we fix this? Defining a new pgprot_xxx(), and falling back to pgprot_noncached if undefined? Or is it just x86 and do it only there? thanks, Takashi