Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752971AbXEXVTM (ORCPT ); Thu, 24 May 2007 17:19:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750913AbXEXVS7 (ORCPT ); Thu, 24 May 2007 17:18:59 -0400 Received: from smtp1.linux-foundation.org ([207.189.120.13]:36318 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750723AbXEXVS7 (ORCPT ); Thu, 24 May 2007 17:18:59 -0400 Date: Thu, 24 May 2007 14:17:20 -0700 From: Andrew Morton To: ebiederm@xmission.com (Eric W. Biederman) Cc: "Mike Miller (OS Dev)" , linux-kernel@vger.kernel.org, tom.l.nguyen@intel.com, iss_storagedev@hp.com, jens.axboe@oracle.com, Michael Ellerman Subject: Re: [PATCH] msi: Fix the ordering of msix irqs. Message-Id: <20070524141720.c02582db.akpm@linux-foundation.org> In-Reply-To: References: <20070524160756.GA14083@beardog.cca.cpqcorp.net> <20070524102702.bca37396.akpm@linux-foundation.org> <20070524205900.GC14083@beardog.cca.cpqcorp.net> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1767 Lines: 48 On Thu, 24 May 2007 15:08:21 -0600 ebiederm@xmission.com (Eric W. Biederman) wrote: > Yours looks more complete then my test patch so: > > From: "Mike Miller (OS Dev)" writes: > > Found what seems the problem with our vectors being listed backward. In > drivers/pci/msi.c we should be using list_add_tail rather than list_add to > preserve the ordering across various kernels. Please consider this for > inclusion. > > Signed-off-by: "Eric W. Biederman" > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > index 0e67723..d74975d 100644 > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -333,7 +333,7 @@ static int msi_capability_init(struct pci_dev *dev) > msi_mask_bits_reg(pos, is_64bit_address(control)), > maskbits); > } > - list_add(&entry->list, &dev->msi_list); > + list_add_tail(&entry->list, &dev->msi_list); > > /* Configure MSI capability structure */ > ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI); > @@ -404,7 +404,7 @@ static int msix_capability_init(struct pci_dev *dev, > entry->dev = dev; > entry->mask_base = base; > > - list_add(&entry->list, &dev->msi_list); > + list_add_tail(&entry->list, &dev->msi_list); > } > > ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); Is this as fragile as I think it is? What happens when close+open and rmmod+modprobe happen? The list gets reordered then? If this is important then perhaps a big-fat-comment which explains wtf is going on is needed? - 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/