From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brice Goglin Subject: Re: MTRR use in drivers Date: Sun, 23 Jun 2013 08:35:30 +0200 Message-ID: <51C69732.1010906@gmail.com> References: <51C3DDFA.7050204@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <51C3DDFA.7050204@zytor.com> Sender: linux-kernel-owner@vger.kernel.org To: "H. Peter Anvin" Cc: Linux Kernel Mailing List , David Airlie , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Le 21/06/2013 07:00, H. Peter Anvin a =E9crit : > An awful lot of drivers, mostly DRI drivers, are still mucking with > MTRRs directly as opposed to using ioremap_wc() or similar interfaces= =2E > In addition to the architecture dependency, this is really undesirabl= e > because MTRRs are a limited resource, whereas page table attributes a= re not. > > Furthermore, this perpetuates the need for the horrific hack known as > "MTRR cleanup". > > What, if anything, can we do to clean up this mess? > > -hpa > The first network driver that used ioremap_wc() back in 2008 (myri10ge) had to keep using MTRR because ioremap_wc() silently falls back to ioremap_nocache() when PAT is disabled. I asked about this in https://lkml.org/lkml/2008/5/31/42 and there was some talk about putting the MTRR addition in the nocache fallback path but I guess nobody implemented the idea. Brice