Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266105AbUAGAG7 (ORCPT ); Tue, 6 Jan 2004 19:06:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266106AbUAGAG7 (ORCPT ); Tue, 6 Jan 2004 19:06:59 -0500 Received: from fw.osdl.org ([65.172.181.6]:35772 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S266105AbUAGAG5 (ORCPT ); Tue, 6 Jan 2004 19:06:57 -0500 Date: Tue, 6 Jan 2004 16:06:42 -0800 (PST) From: Linus Torvalds To: "Eric W. Biederman" cc: Andi Kleen , Mika Penttil? , Andi Kleen , David Hinds , linux-kernel@vger.kernel.org Subject: Re: PCI memory allocation bug with CONFIG_HIGHMEM In-Reply-To: Message-ID: References: <1aJdi-7TH-25@gated-at.bofh.it> <20040106040546.GA77287@colin2.muc.de> <20040106081203.GA44540@colin2.muc.de> <3FFA7BB9.1030803@kolumbus.fi> <20040106094442.GB44540@colin2.muc.de> <20040106153706.GA63471@colin2.muc.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1636 Lines: 37 On Tue, 6 Jan 2004, Eric W. Biederman wrote: > > And mtd map drivers for rom chips run into the same problem except in > that case regions is almost always reserved by the BIOS. > > Which means it's just silly for the drivers to fail when request_mem_region > fails. Note: you're not supposed to need to do "request_mem_region()" for modern drivers. You should only need to claim ownership of the resources, and the PCI driver interfaces should do that automatically. What you should do for resources you know about is to just _create_ them. Not necessarily request them (although that is one way of creating them), but you can literally just tell the kernel that they are there. That will already mean that anybody else that tries to allocate a resource will avoid that area. So if you know the hardware is there, and it _tells_ you it's there (unlike, say, an ISA device), you can just call "request_mem_region()" without ever even checking the error return (although you had better make sure that the name allocation is stable if you are a module - don't want to start oopsin in /proc if the module gets unloaded). The PCI layer already does all of that for the "standard" resources. It's just that the generic code can't do it for nonstandard regions, so drivers for chips that don't have just the regular BAR things should create their own resource entries.. Linus - 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/