From: ebiederm@xmission.com (Eric W. Biederman)
To: "Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, tom.l.nguyen@intel.com,
iss_storagedev@hp.com, jens.axboe@oracle.com,
Michael Ellerman <michael@ellerman.id.au>
Subject: Re: msi_free_irqs #2
Date: Thu, 24 May 2007 14:53:08 -0600 [thread overview]
Message-ID: <m1lkfedjuz.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070524200743.GB14083@beardog.cca.cpqcorp.net> (Mike Miller's message of "Thu, 24 May 2007 15:07:43 -0500")
Could you please try the patch below. Unless I have misread something
this should fix your problem....
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 000c9ae..2e1d4af 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -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);
> Michael or Eric, would you please review this patch and see if it's OK? Adding
> an else
> between the the if (list_is....) and the writel resolved the Oops. I'm not sure
> how this
> is supposed to work but using entry->mask_base after iounmap'ing seems wrong.
I think I would rather just swap those two lines of code.
We are manually setting the mask bit to make certain the irq doesn't
fire after we free it, and we clearly want to set the mask bit for
all the irq entries.
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index d9cbd58..0e67723 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -560,10 +560,11 @@ static int msi_free_irqs(struct pci_dev* dev)
> if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) {
> if (list_is_last(&entry->list, &dev->msi_list))
> iounmap(entry->mask_base);
> -
> - writel(1, entry->mask_base + entry->msi_attrib.entry_nr
> - * PCI_MSIX_ENTRY_SIZE
> - + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
> + else
> + writel(1, entry->mask_base
> + + entry->msi_attrib.entry_nr
> + * PCI_MSIX_ENTRY_SIZE
> + + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
> }
> list_del(&entry->list);
> kfree(entry);
> -----------------------------------------------------------------------------------------
>
> I hope this clears up a little of the fog.
Yes it does thanks.
Eric
next prev parent reply other threads:[~2007-05-24 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-24 16:07 msi_free_irqs #2 Mike Miller (OS Dev)
2007-05-24 17:27 ` Andrew Morton
2007-05-24 19:42 ` Eric W. Biederman
2007-05-24 20:59 ` Mike Miller (OS Dev)
2007-05-24 21:08 ` [PATCH] msi: Fix the ordering of msix irqs Eric W. Biederman
2007-05-24 21:17 ` Andrew Morton
2007-05-24 21:36 ` Eric W. Biederman
2007-05-25 2:32 ` Michael Ellerman
2007-05-25 3:04 ` kernel crash in timer interrupt handler gshan
2007-05-24 20:07 ` msi_free_irqs #2 Mike Miller (OS Dev)
2007-05-24 20:53 ` Eric W. Biederman [this message]
2007-05-24 21:01 ` Mike Miller (OS Dev)
2007-05-24 21:11 ` Mike Miller (OS Dev)
2007-05-25 3:16 ` [PATCH] msi: mask the msix vector before we unmap it Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1lkfedjuz.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=iss_storagedev@hp.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@ellerman.id.au \
--cc=mikem@beardog.cca.cpqcorp.net \
--cc=tom.l.nguyen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox