Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262005AbVBPL13 (ORCPT ); Wed, 16 Feb 2005 06:27:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262006AbVBPL12 (ORCPT ); Wed, 16 Feb 2005 06:27:28 -0500 Received: from cantor.suse.de ([195.135.220.2]:54725 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262005AbVBPL1Y (ORCPT ); Wed, 16 Feb 2005 06:27:24 -0500 Date: Wed, 16 Feb 2005 12:27:03 +0100 Message-ID: From: Takashi Iwai To: Jeff Garzik Cc: Arjan van de Ven , Greg KH , Linux Kernel , Andrew Morton , Alan Cox Subject: Re: avoiding pci_disable_device()... In-Reply-To: <42115906.3040003@pobox.com> References: <4210021F.7060401@pobox.com> <20050214190619.GA9241@kroah.com> <4211013E.6@pobox.com> <1108411352.5994.27.camel@localhost.localdomain> <42115906.3040003@pobox.com> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 38 At Mon, 14 Feb 2005 21:05:58 -0500, Jeff Garzik wrote: > > Arjan van de Ven wrote: > >>No. You also need to consider situations such as out-of-tree drivers > >>for the same hardware (might not use PCI API), and situations where you > >>have peer devices discovered and used (PCI API doesn't have "hey, > >>device is associated with , too" capability) > > > > > > > > there's not a lot you or anyone else can do about such broken (and often > > proprietary) drivers.... if a device doesn't use the kernel API's its > > end of game basically. Adding more new API's isn't going to help you ... > > > This specific instance isn't about adding a new API, but using an > existing one correctly. > > If pci_request_regions() fails, that implies another driver is using the > kernel API to let you know the region is unavailable. You should honor > that, by not disabling the hardware in that case. I guess an enable counter as Alan proposed would fix this problem well, except for the case that an out-of-tree driver allocates the resource without calling pci_enable_device(). OTOH this will introduce more buglets to broken drivers which don't call pci_disable_device() properly. Consequently, the ad hoc fix to each driver like Jeff's patch might be most practical... Takashi - 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/