From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rajesh Shah Subject: Re: [PATCH 4/25] msi: Simplify msi enable and disable. Date: Tue, 20 Jun 2006 17:44:24 -0700 Message-ID: <20060620174424.B10402@unix-os.sc.intel.com> References: <11508425183073-git-send-email-ebiederm@xmission.com> <11508425191381-git-send-email-ebiederm@xmission.com> <11508425192220-git-send-email-ebiederm@xmission.com> <11508425191063-git-send-email-ebiederm@xmission.com> Reply-To: Rajesh Shah Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mga07.intel.com ([143.182.124.22]:59746 "EHLO azsmga101.ch.intel.com") by vger.kernel.org with ESMTP id S1751912AbWFUBJt (ORCPT ); Tue, 20 Jun 2006 21:09:49 -0400 Content-Disposition: inline In-Reply-To: <11508425191063-git-send-email-ebiederm@xmission.com>; from ebiederm@xmission.com on Tue, Jun 20, 2006 at 04:28:17PM -0600 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Eric W. Biederman" Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz, discuss@x86-64.org, Ingo Molnar , Thomas Gleixner , Andi Kleen , Natalie Protasevich , Len Brown , Kimball Murray , Brice Goglin , Greg Lindahl , Dave Olson , Jeff Garzik , Greg KH , Grant Grundler , "bibo,mao" , Rajesh Shah , Mark Maule , Jesper Juhl , Shaohua Li , Matthew Wilcox , "Michael S. Tsirkin" , Ashok Raj , Randy Dunlap On Tue, Jun 20, 2006 at 04:28:17PM -0600, Eric W. Biederman wrote: > > @@ -937,27 +936,8 @@ int pci_enable_msi(struct pci_dev* dev) > if (!pos) > return -EINVAL; > > - if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) { > - /* Lookup Sucess */ > - unsigned long flags; > + BUG_ON(!msi_lookup_vector(dev, PCI_CAP_ID_MSI)); > A driver that calls pci_enable_msi() while MSI is already enabled will hit this BUG_ON. This is different from the behavior of some other pci functions like pci_enable_device(), which silently return success if the requested operation is a nop. It's pretty easy to do the same here too (ditto for MSI-X). Rajesh