Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088AbZJZVMv (ORCPT ); Mon, 26 Oct 2009 17:12:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752925AbZJZVMu (ORCPT ); Mon, 26 Oct 2009 17:12:50 -0400 Received: from mga11.intel.com ([192.55.52.93]:36842 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbZJZVMu (ORCPT ); Mon, 26 Oct 2009 17:12:50 -0400 X-ExtLoop1: 1 Date: Mon, 26 Oct 2009 14:12:52 -0700 From: Jesse Barnes To: Suresh Siddha Cc: Ingo Molnar , Thomas Schlichter , LKML , Eric Anholt , Thomas Hellstrom , Jan Beulich Subject: Re: [patch] x86, pat: return EINVAL for pci mmap WC request for !pat_enabled Message-ID: <20091026141252.57803f63@jbarnes-g45> In-Reply-To: <1256336760.2576.8.camel@sbs-t61> References: <1256336760.2576.8.camel@sbs-t61> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1578 Lines: 38 On Mon, 26 Oct 2009 13:21:32 -0800 Suresh Siddha wrote: > Thomas Schlichter reported: > > X.org uses libpciaccess which tries to mmap with write combining > > enabled via /sys/bus/pci/devices/*/resource0_wc. Currently, when > > PAT is not enabled, the kernel does fall back to uncached mmap. > > Then libpciaccess thinks it succeeded mapping with write combining > > enabled and does not set up suited MTRR entries. ;-( > > Instead of silently mapping pci mmap region as UC minus in the case > of !pat_enabled and wc request, we can return error. Eric Anholt > mentioned that caller (like X) typically follows up with UC minus pci > mmap request and if there is a free mtrr slot, caller will manage > adding WC mtrr. > > Jesse Barnes says: > > Older versions of libpciaccess will behave better if we do it that > > way (iirc it only allocates an MTRR if the resource_wc file doesn't > > exist or fails to get mapped). > > Reported-by: Thomas Schlichter > Signed-off-by: Thomas Schlichter > Signed-off-by: Suresh Siddha > Acked-by: Eric Anholt > Acked-by: Jesse Barnes > --- > Applied to my linux-next branch, thanks. -- Jesse Barnes, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/