Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbXLWVKL (ORCPT ); Sun, 23 Dec 2007 16:10:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751499AbXLWVJ6 (ORCPT ); Sun, 23 Dec 2007 16:09:58 -0500 Received: from gate.crashing.org ([63.228.1.57]:49230 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbXLWVJ6 (ORCPT ); Sun, 23 Dec 2007 16:09:58 -0500 Subject: Re: [patch] Make MMCONFIG space (extended PCI config space) a driver opt-in issue From: Benjamin Herrenschmidt Reply-To: benh@kernel.crashing.org To: Linus Torvalds Cc: Jeff Garzik , Arjan van de Ven , linux-kernel@vger.kernel.org, gregkh@suse.de, linux-pci@atrey.karlin.mff.cuni.cz In-Reply-To: References: <20071222043139.0cd59804@laptopd505.fenrus.org> <476D1D16.5090703@garzik.org> <20071222064719.73fdd9a4@laptopd505.fenrus.org> <476DB95F.3090801@garzik.org> <476DDFEE.3010009@garzik.org> <476DE98F.2010009@garzik.org> Content-Type: text/plain Date: Mon, 24 Dec 2007 08:09:10 +1100 Message-Id: <1198444150.6686.17.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 53 On Sat, 2007-12-22 at 21:00 -0800, Linus Torvalds wrote: > > On Sat, 22 Dec 2007, Jeff Garzik wrote: > > > > But regardless of problems, enabling should be done globally, not per > > device... > > I'm ok with trying the "globally" idea, but it has to be "globally but > only if absolutely required". > > And quite frankly, how do you tell whether it's absolutely required or > not? > > I have an idea: the drivers that really need it will do a "please enable > MMCONFIG, because I will need it" thing? What about this approach: - At boot, MMCONFIG is disabled, you perform the initial probe of all devices. - During that probe, you set a flag if any device has capabilities that extend beyond 0xff. - Once the main probe pass is done (before drivers are hooked up, which on PCI is a separate phase), if that flag has been set, you print a fat warning (on peecee's, which are our main concern, this will generally be visible on vga console), that you're about to enable MMCONFIG for this device and if the machine crashes, send a bug report and boot with nommconfig. Then, for each of those devices, attempt to re-read the config space header with MMCONFIG, and compare to what is supposed to be there (+/- irrelevant status bits). If that fails, warn and keep MMCONFIG disabled. At this point, you can decide to either keep MMCONFIG on/off on a per-device basis (if a device has capabilities in the ext space, use MMCONFIG for it). In that case, your proposed API is useful to force-enabling MMCONFIG for a given device if there are no such capabilities but the driver wants to force-enable. That case should be extremely rare if existing at all Or you can decide to keep the enable/disable global (if a single device fails, don't enable MMCONFIG globally). Ben. -- 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/